Jelajahi Sumber

tools: enable linter for TypeScript (#2997)

* tools: enable linter for TypeScript files and code snippets

* types: remove remaning namespaces

* tools: remove unused Babel decorator plugin
Antoine du Hamel 3 tahun lalu
induk
melakukan
5630f7dc07
100 mengubah file dengan 1380 tambahan dan 885 penghapusan
  1. 30 6
      .eslintrc.js
  2. 1 1
      .github/workflows/ci.yml
  3. 68 0
      examples/angular-example/.eslintrc.json
  4. 8 9
      examples/angular-example/angular.json
  5. 13 12
      examples/angular-example/e2e/src/app.e2e-spec.ts
  6. 4 3
      examples/angular-example/e2e/src/app.po.ts
  7. 12 3
      examples/angular-example/package.json
  8. 19 19
      examples/angular-example/src/app/app.component.spec.ts
  9. 15 12
      examples/angular-example/src/app/app.component.ts
  10. 11 8
      examples/angular-example/src/app/app.module.ts
  11. 2 2
      examples/angular-example/src/environments/environment.prod.ts
  12. 2 2
      examples/angular-example/src/environments/environment.ts
  13. 6 6
      examples/angular-example/src/main.ts
  14. 4 5
      examples/angular-example/src/polyfills.ts
  15. 9 9
      examples/angular-example/src/test.ts
  16. 0 152
      examples/angular-example/tslint.json
  17. 4 4
      examples/svelte-example/src/main.ts
  18. 610 88
      package-lock.json
  19. 4 1
      package.json
  20. 45 0
      packages/@uppy/angular/.eslintrc.json
  21. 1 1
      packages/@uppy/angular/README.md
  22. 10 9
      packages/@uppy/angular/angular.json
  23. 11 2
      packages/@uppy/angular/package.json
  24. 52 0
      packages/@uppy/angular/projects/angular/.eslintrc.json
  25. 10 10
      packages/@uppy/angular/projects/angular/src/public-api.ts
  26. 9 9
      packages/@uppy/angular/projects/angular/src/test.ts
  27. 0 17
      packages/@uppy/angular/projects/angular/tslint.json
  28. 3 9
      packages/@uppy/angular/tsconfig.base.json
  29. 0 140
      packages/@uppy/angular/tslint.json
  30. 7 9
      packages/@uppy/aws-s3-multipart/types/index.d.ts
  31. 4 3
      packages/@uppy/aws-s3-multipart/types/index.test-d.ts
  32. 4 6
      packages/@uppy/aws-s3/types/index.d.ts
  33. 2 2
      packages/@uppy/aws-s3/types/index.test-d.ts
  34. 2 4
      packages/@uppy/box/types/index.d.ts
  35. 1 1
      packages/@uppy/box/types/index.test-d.ts
  36. 24 7
      packages/@uppy/companion-client/types/index.d.ts
  37. 1 1
      packages/@uppy/companion-client/types/index.test-d.ts
  38. 2 1
      packages/@uppy/companion/src/server/provider/error.d.ts
  39. 129 58
      packages/@uppy/core/types/index.d.ts
  40. 18 14
      packages/@uppy/core/types/index.test-d.ts
  41. 9 2
      packages/@uppy/dashboard/types/index.d.ts
  42. 15 15
      packages/@uppy/dashboard/types/index.test-d.ts
  43. 10 10
      packages/@uppy/drag-drop/types/index.test-d.ts
  44. 3 5
      packages/@uppy/drop-target/types/index.d.ts
  45. 1 1
      packages/@uppy/drop-target/types/index.test-d.ts
  46. 2 4
      packages/@uppy/dropbox/types/index.d.ts
  47. 1 1
      packages/@uppy/dropbox/types/index.test-d.ts
  48. 2 4
      packages/@uppy/facebook/types/index.d.ts
  49. 1 1
      packages/@uppy/facebook/types/index.test-d.ts
  50. 2 4
      packages/@uppy/file-input/types/index.d.ts
  51. 2 1
      packages/@uppy/file-input/types/index.test-d.ts
  52. 2 4
      packages/@uppy/form/types/index.d.ts
  53. 2 1
      packages/@uppy/form/types/index.test-d.ts
  54. 2 6
      packages/@uppy/golden-retriever/types/index.d.ts
  55. 2 1
      packages/@uppy/golden-retriever/types/index.test-d.ts
  56. 1 3
      packages/@uppy/google-drive/types/index.d.ts
  57. 4 4
      packages/@uppy/google-drive/types/index.test-d.ts
  58. 18 20
      packages/@uppy/image-editor/types/index.d.ts
  59. 2 1
      packages/@uppy/image-editor/types/index.test-d.ts
  60. 4 6
      packages/@uppy/informer/types/index.d.ts
  61. 2 1
      packages/@uppy/informer/types/index.test-d.ts
  62. 2 4
      packages/@uppy/instagram/types/index.d.ts
  63. 1 1
      packages/@uppy/instagram/types/index.test-d.ts
  64. 2 4
      packages/@uppy/onedrive/types/index.d.ts
  65. 1 1
      packages/@uppy/onedrive/types/index.test-d.ts
  66. 0 1
      packages/@uppy/progress-bar/types/index.d.ts
  67. 1 1
      packages/@uppy/progress-bar/types/index.test-d.ts
  68. 2 3
      packages/@uppy/provider-views/types/index.d.ts
  69. 1 1
      packages/@uppy/react/src/Dashboard.d.ts
  70. 1 1
      packages/@uppy/react/src/DashboardModal.d.ts
  71. 3 3
      packages/@uppy/react/src/DragDrop.d.ts
  72. 4 5
      packages/@uppy/react/src/FileInput.d.ts
  73. 1 1
      packages/@uppy/react/src/ProgressBar.d.ts
  74. 1 1
      packages/@uppy/react/src/StatusBar.d.ts
  75. 2 2
      packages/@uppy/react/src/useUppy.d.ts
  76. 1 3
      packages/@uppy/react/types/index.d.ts
  77. 2 6
      packages/@uppy/redux-dev-tools/types/index.d.ts
  78. 1 1
      packages/@uppy/redux-dev-tools/types/index.test-d.ts
  79. 2 4
      packages/@uppy/screen-capture/types/index.d.ts
  80. 15 19
      packages/@uppy/screen-capture/types/index.test-d.ts
  81. 1 1
      packages/@uppy/status-bar/types/index.test-d.ts
  82. 9 3
      packages/@uppy/store-default/types/index.d.ts
  83. 1 1
      packages/@uppy/store-default/types/index.test-d.ts
  84. 11 5
      packages/@uppy/store-redux/types/index.d.ts
  85. 1 0
      packages/@uppy/store-redux/types/index.test-d.ts
  86. 3 7
      packages/@uppy/thumbnail-generator/types/index.d.ts
  87. 1 1
      packages/@uppy/thumbnail-generator/types/index.test-d.ts
  88. 9 10
      packages/@uppy/transloadit/types/index.d.ts
  89. 10 10
      packages/@uppy/transloadit/types/index.test-d.ts
  90. 2 4
      packages/@uppy/tus/types/index.d.ts
  91. 1 1
      packages/@uppy/tus/types/index.test-d.ts
  92. 2 4
      packages/@uppy/unsplash/types/index.d.ts
  93. 1 1
      packages/@uppy/unsplash/types/index.test-d.ts
  94. 2 4
      packages/@uppy/url/types/index.d.ts
  95. 1 1
      packages/@uppy/url/types/index.test-d.ts
  96. 16 8
      packages/@uppy/utils/types/index.d.ts
  97. 6 6
      packages/@uppy/vue/types/dashboard-modal.d.ts
  98. 6 6
      packages/@uppy/vue/types/dashboard.d.ts
  99. 5 5
      packages/@uppy/vue/types/drag-drop.d.ts
  100. 5 5
      packages/@uppy/vue/types/index.d.ts

+ 30 - 6
.eslintrc.js

@@ -9,6 +9,7 @@ const svgPresentationAttributes = [
 ]
 
 module.exports = {
+  root: true,
   extends: ['transloadit'],
   env: {
     es6: true,
@@ -133,6 +134,7 @@ module.exports = {
         packages: path.resolve(__dirname, 'packages'),
       },
     },
+    'import/core-modules': ['tsd'],
     react: {
       pragma: 'h',
     },
@@ -224,12 +226,7 @@ module.exports = {
         sourceType: 'module',
       },
       rules: {
-        'import/no-extraneous-dependencies': ['off'],
-        'import/no-unresolved': ['off'],
-        'react/destructuring-assignment': ['off'],
-        'no-console': ['off'],
-        'no-undef': ['off'],
-        'no-unused-vars': ['off'],
+        'react/destructuring-assignment': 'off',
         'no-restricted-globals': [
           'error',
           {
@@ -255,6 +252,33 @@ module.exports = {
         ],
       },
     },
+    {
+      files: ['**/*.ts', '**/*.md/*.ts', '**/*.md/*.typescript'],
+      excludedFiles: ['examples/angular-example/**/*.ts', 'packages/@uppy/angular/**/*.ts'],
+      parser: '@typescript-eslint/parser',
+      plugins: [
+        '@typescript-eslint',
+      ],
+      extends: [
+        'eslint:recommended',
+        'plugin:@typescript-eslint/eslint-recommended',
+        'plugin:@typescript-eslint/recommended',
+      ],
+      rules: {
+        'import/prefer-default-export': 'off',
+        '@typescript-eslint/no-explicit-any': 'off',
+      },
+    },
+    {
+      files: ['**/*.md/*.*'],
+      rules: {
+        'import/no-extraneous-dependencies': 'off',
+        'import/no-unresolved': 'off',
+        'no-console': 'off',
+        'no-undef': 'off',
+        'no-unused-vars': 'off',
+      },
+    },
     {
       files: ['**/react/*.md/*.js', '**/react.md/*.js', '**/react-*.md/*.js'],
       settings: {

+ 1 - 1
.github/workflows/ci.yml

@@ -23,7 +23,7 @@ jobs:
         run: npm run test:unit
 
   lint_js:
-    name: Lint JavaScript
+    name: Lint JavaScript/TypeScript
     runs-on: ubuntu-latest
     steps:
       - name: Checkout sources

+ 68 - 0
examples/angular-example/.eslintrc.json

@@ -0,0 +1,68 @@
+{
+  "ignorePatterns": [
+    "projects/**/*"
+  ],
+  "overrides": [
+    {
+      "files": [
+        "*.ts"
+      ],
+      "parserOptions": {
+        "project": [
+          "examples/angular-example/tsconfig.json",
+          "examples/angular-example/e2e/tsconfig.json"
+        ],
+        "createDefaultProgram": true
+      },
+      "extends": [
+        "plugin:@angular-eslint/ng-cli-compat",
+        "plugin:@angular-eslint/ng-cli-compat--formatting-add-on",
+        "plugin:@angular-eslint/template/process-inline-templates"
+      ],
+      "rules": {
+        "@angular-eslint/component-selector": [
+          "error",
+          {
+            "type": "element",
+            "prefix": "app",
+            "style": "kebab-case"
+          }
+        ],
+        "@angular-eslint/directive-selector": [
+          "error",
+          {
+            "type": "attribute",
+            "prefix": "app",
+            "style": "camelCase"
+          }
+        ],
+        "@typescript-eslint/semi": ["error", "never"],
+        "dot-notation": "error",
+        "import/no-unresolved": "off",
+        "import/prefer-default-export": "off",
+        "indent": "error",
+        "no-empty-function": "off",
+        "no-shadow": "error",
+        "no-unused-expressions": "error",
+        "no-use-before-define": "off",
+        "quotes": "error",
+        "semi": ["error", "never"]
+      }
+    },
+    {
+      "files": ["e2e/**/*.ts"],
+      "rules": {
+        "import/no-extraneous-dependencies": "off"
+      }
+    },
+    {
+      "files": [
+        "star.html"
+      ],
+      "extends": [
+        "plugin:@angular-eslint/template/recommended"
+      ],
+      "rules": {}
+    }
+  ]
+}

+ 8 - 9
examples/angular-example/angular.json

@@ -105,15 +105,11 @@
           }
         },
         "lint": {
-          "builder": "@angular-devkit/build-angular:tslint",
+          "builder": "@angular-eslint/builder:lint",
           "options": {
-            "tsConfig": [
-              "tsconfig.app.json",
-              "tsconfig.spec.json",
-              "e2e/tsconfig.json"
-            ],
-            "exclude": [
-              "**/node_modules/**"
+            "lintFilePatterns": [
+              "src/**/*.ts",
+              "src/**/*.html"
             ]
           }
         },
@@ -132,5 +128,8 @@
       }
     }
   },
-  "defaultProject": "angular-example"
+  "defaultProject": "angular-example",
+  "cli": {
+    "defaultCollection": "@angular-eslint/schematics"
+  }
 }

+ 13 - 12
examples/angular-example/e2e/src/app.e2e-spec.ts

@@ -1,23 +1,24 @@
-import { browser, logging } from 'protractor';
-import { AppPage } from './app.po';
+/* global jasmine */
+import { browser, logging } from 'protractor'
+import { AppPage } from './app.po'
 
 describe('workspace-project App', () => {
-  let page: AppPage;
+  let page: AppPage
 
   beforeEach(() => {
-    page = new AppPage();
-  });
+    page = new AppPage()
+  })
 
   it('should display welcome message', async () => {
-    await page.navigateTo();
-    expect(await page.getTitleText()).toEqual('angular-example app is running!');
-  });
+    await page.navigateTo()
+    expect(await page.getTitleText()).toEqual('angular-example app is running!')
+  })
 
   afterEach(async () => {
     // Assert that there are no errors emitted from the browser
-    const logs = await browser.manage().logs().get(logging.Type.BROWSER);
+    const logs = await browser.manage().logs().get(logging.Type.BROWSER)
     expect(logs).not.toContain(jasmine.objectContaining({
       level: logging.Level.SEVERE,
-    } as logging.Entry));
-  });
-});
+    } as logging.Entry))
+  })
+})

+ 4 - 3
examples/angular-example/e2e/src/app.po.ts

@@ -1,11 +1,12 @@
-import { browser, by, element } from 'protractor';
+/* eslint-disable class-methods-use-this */
+import { browser, by, element } from 'protractor'
 
 export class AppPage {
   async navigateTo(): Promise<unknown> {
-    return browser.get(browser.baseUrl);
+    return browser.get(browser.baseUrl)
   }
 
   async getTitleText(): Promise<string> {
-    return element(by.css('app-root .content span')).getText();
+    return element(by.css('app-root .content span')).getText()
   }
 }

+ 12 - 3
examples/angular-example/package.json

@@ -20,8 +20,8 @@
     "@angular/router": "~12.1.0",
     "@uppy/angular": "file:../../packages/@uppy/angular",
     "@uppy/core": "file:../../packages/@uppy/core",
-    "@uppy/google-drive": "file:../../packages/@uppy/google-drive",
     "@uppy/drag-drop": "file:../../packages/@uppy/drag-drop",
+    "@uppy/google-drive": "file:../../packages/@uppy/google-drive",
     "@uppy/progress-bar": "file:../../packages/@uppy/progress-bar",
     "@uppy/tus": "file:../../packages/@uppy/tus",
     "@uppy/webcam": "file:../../packages/@uppy/webcam",
@@ -31,11 +31,21 @@
   },
   "devDependencies": {
     "@angular-devkit/build-angular": "~12.1.0",
+    "@angular-eslint/builder": "12.2.0",
+    "@angular-eslint/eslint-plugin": "12.2.0",
+    "@angular-eslint/eslint-plugin-template": "12.2.0",
+    "@angular-eslint/schematics": "12.2.0",
+    "@angular-eslint/template-parser": "12.2.0",
     "@angular/cli": "~12.1.0",
     "@angular/compiler-cli": "~12.1.0",
     "@types/jasmine": "~3.6.0",
     "@types/node": "^12.11.1",
-    "codelyzer": "^6.0.0",
+    "@typescript-eslint/eslint-plugin": "^4.28.2",
+    "@typescript-eslint/parser": "^4.28.2",
+    "eslint": "^7.22.0",
+    "eslint-plugin-import": "^2.22.1",
+    "eslint-plugin-jsdoc": "^35.4.1",
+    "eslint-plugin-prefer-arrow": "latest",
     "jasmine-core": "~3.6.0",
     "jasmine-spec-reporter": "~5.0.0",
     "karma": "~6.1.0",
@@ -45,7 +55,6 @@
     "karma-jasmine-html-reporter": "^1.5.0",
     "protractor": "~7.0.0",
     "ts-node": "~8.3.0",
-    "tslint": "~6.1.0",
     "typescript": "~4.3"
   }
 }

+ 19 - 19
examples/angular-example/src/app/app.component.spec.ts

@@ -1,31 +1,31 @@
-import { TestBed } from '@angular/core/testing';
-import { AppComponent } from './app.component';
+import { TestBed } from '@angular/core/testing'
+import { AppComponent } from './app.component'
 
 describe('AppComponent', () => {
   beforeEach(async () => {
     await TestBed.configureTestingModule({
       declarations: [
-        AppComponent
+        AppComponent,
       ],
-    }).compileComponents();
-  });
+    }).compileComponents()
+  })
 
   it('should create the app', () => {
-    const fixture = TestBed.createComponent(AppComponent);
-    const app = fixture.componentInstance;
-    expect(app).toBeTruthy();
-  });
+    const fixture = TestBed.createComponent(AppComponent)
+    const app = fixture.componentInstance
+    expect(app).toBeTruthy()
+  })
 
   it(`should have as title 'angular-example'`, () => {
-    const fixture = TestBed.createComponent(AppComponent);
-    const app = fixture.componentInstance;
-    expect(app.title).toEqual('angular-example');
-  });
+    const fixture = TestBed.createComponent(AppComponent)
+    const app = fixture.componentInstance
+    expect(app.title).toEqual('angular-example')
+  })
 
   it('should render title', () => {
-    const fixture = TestBed.createComponent(AppComponent);
-    fixture.detectChanges();
-    const compiled = fixture.nativeElement;
-    expect(compiled.querySelector('.content span').textContent).toContain('angular-example app is running!');
-  });
-});
+    const fixture = TestBed.createComponent(AppComponent)
+    fixture.detectChanges()
+    const compiled = fixture.nativeElement
+    expect(compiled.querySelector('.content span').textContent).toContain('angular-example app is running!')
+  })
+})

+ 15 - 12
examples/angular-example/src/app/app.component.ts

@@ -1,4 +1,4 @@
-import { Component } from '@angular/core';
+import { Component, OnInit } from '@angular/core'
 import { Uppy } from '@uppy/core'
 import Webcam from '@uppy/webcam'
 import Tus from '@uppy/tus'
@@ -6,17 +6,17 @@ import GoogleDrive from '@uppy/google-drive'
 
 @Component({
   selector: 'app-root',
-  template: /*html*/`
+  template: /* html */`
   <h1>Uppy Angular Example!</h1>
   <h2>Inline dashboard</h2>
   <label>
-		<input
+    <input
       type="checkbox"
       (change)="showInline = $event.target.checked"
       [checked]="showInline"
     />
-		Show Dashboard
-	</label>
+    Show Dashboard
+  </label>
 
   <uppy-dashboard [uppy]='uppy' [props]='dashboardProps' *ngIf="showInline"></uppy-dashboard>
 
@@ -42,24 +42,27 @@ import GoogleDrive from '@uppy/google-drive'
     '../../../../packages/@uppy/drag-drop/dist/style.min.css',
     '../../../../packages/@uppy/progress-bar/dist/style.min.css',
     '../../../../packages/@uppy/dashboard/dist/style.min.css',
-  ]
+  ],
 })
-export class AppComponent {
-  title = 'angular-example';
+export class AppComponent implements OnInit {
+  title = 'angular-example'
+
   showInline = false
+
   showModal = false
 
   dashboardProps = {
-    plugins: ['Webcam']
+    plugins: ['Webcam'],
   }
+
   dashboardModalProps = {
     target: document.body,
-    onRequestCloseModal: () => this.showModal = false
+    onRequestCloseModal: (): void => { this.showModal = false },
   }
 
-
   uppy: Uppy = new Uppy({ debug: true, autoProceed: true })
-  ngOnInit() {
+
+  ngOnInit(): void {
     this.uppy
       .use(Webcam)
       .use(Tus, { endpoint: 'https://tusd.tusdemo.net/files/' })

+ 11 - 8
examples/angular-example/src/app/app.module.ts

@@ -1,25 +1,28 @@
 import { NgModule } from '@angular/core'
 import { BrowserModule } from '@angular/platform-browser'
 
+import {
+  UppyAngularDashboardModule,
+  UppyAngularStatusBarModule,
+  UppyAngularDragDropModule,
+  UppyAngularProgressBarModule,
+  UppyAngularDashboardModalModule
+} from '@uppy/angular'
 import { AppComponent } from './app.component'
 
-import { UppyAngularDashboardModule, UppyAngularStatusBarModule, UppyAngularDragDropModule, UppyAngularProgressBarModule, UppyAngularDashboardModalModule } from '@uppy/angular'
-
 @NgModule({
-  declarations: [
-    AppComponent
-  ],
+  declarations: [AppComponent],
   imports: [
     BrowserModule,
     UppyAngularDashboardModule,
     UppyAngularStatusBarModule,
     UppyAngularDashboardModalModule,
     UppyAngularDragDropModule,
-    UppyAngularProgressBarModule
+    UppyAngularProgressBarModule,
   ],
   providers: [],
-  bootstrap: [AppComponent]
+  bootstrap: [AppComponent],
 })
-class AppModule { }
+class AppModule {}
 
 export { AppModule }

+ 2 - 2
examples/angular-example/src/environments/environment.prod.ts

@@ -1,3 +1,3 @@
 export const environment = {
-  production: true
-};
+  production: true,
+}

+ 2 - 2
examples/angular-example/src/environments/environment.ts

@@ -3,8 +3,8 @@
 // The list of file replacements can be found in `angular.json`.
 
 export const environment = {
-  production: false
-};
+  production: false,
+}
 
 /*
  * For easier debugging in development mode, you can import the following file

+ 6 - 6
examples/angular-example/src/main.ts

@@ -1,12 +1,12 @@
-import { enableProdMode } from '@angular/core';
-import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
+import { enableProdMode } from '@angular/core'
+import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'
 
-import { AppModule } from './app/app.module';
-import { environment } from './environments/environment';
+import { AppModule } from './app/app.module'
+import { environment } from './environments/environment'
 
 if (environment.production) {
-  enableProdMode();
+  enableProdMode()
 }
 
 platformBrowserDynamic().bootstrapModule(AppModule)
-  .catch(err => console.error(err));
+  .catch(err => console.error(err))

+ 4 - 5
examples/angular-example/src/polyfills.ts

@@ -14,7 +14,7 @@
  * Learn more in https://angular.io/guide/browser-support
  */
 
-/***************************************************************************************************
+/** *************************************************************************************************
  * BROWSER POLYFILLS
  */
 
@@ -54,12 +54,11 @@
  *
  */
 
-/***************************************************************************************************
+/** *************************************************************************************************
  * Zone JS is required by default for Angular itself.
  */
-import 'zone.js/dist/zone';  // Included with Angular CLI.
+import 'zone.js/dist/zone'  // Included with Angular CLI.
 
-
-/***************************************************************************************************
+/** *************************************************************************************************
  * APPLICATION IMPORTS
  */

+ 9 - 9
examples/angular-example/src/test.ts

@@ -1,25 +1,25 @@
 // This file is required by karma.conf.js and loads recursively all the .spec and framework files
 
-import 'zone.js/dist/zone-testing';
-import { getTestBed } from '@angular/core/testing';
+import 'zone.js/dist/zone-testing'
+import { getTestBed } from '@angular/core/testing'
 import {
   BrowserDynamicTestingModule,
-  platformBrowserDynamicTesting
-} from '@angular/platform-browser-dynamic/testing';
+  platformBrowserDynamicTesting,
+} from '@angular/platform-browser-dynamic/testing'
 
 declare const require: {
   context(path: string, deep?: boolean, filter?: RegExp): {
-    keys(): string[];
     <T>(id: string): T;
+    keys(): string[];
   };
-};
+}
 
 // First, initialize the Angular testing environment.
 getTestBed().initTestEnvironment(
   BrowserDynamicTestingModule,
   platformBrowserDynamicTesting()
-);
+)
 // Then we find all the tests.
-const context = require.context('./', true, /\.spec\.ts$/);
+const context = require.context('./', true, /\.spec\.ts$/)
 // And load the modules.
-context.keys().map(context);
+context.keys().map(context)

+ 0 - 152
examples/angular-example/tslint.json

@@ -1,152 +0,0 @@
-{
-  "extends": "tslint:recommended",
-  "rulesDirectory": [
-    "codelyzer"
-  ],
-  "rules": {
-    "align": {
-      "options": [
-        "parameters",
-        "statements"
-      ]
-    },
-    "array-type": false,
-    "arrow-return-shorthand": true,
-    "curly": true,
-    "deprecation": {
-      "severity": "warning"
-    },
-    "eofline": true,
-    "import-blacklist": [
-      true,
-      "rxjs/Rx"
-    ],
-    "import-spacing": true,
-    "indent": {
-      "options": [
-        "spaces"
-      ]
-    },
-    "max-classes-per-file": false,
-    "max-line-length": [
-      true,
-      140
-    ],
-    "member-ordering": [
-      true,
-      {
-        "order": [
-          "static-field",
-          "instance-field",
-          "static-method",
-          "instance-method"
-        ]
-      }
-    ],
-    "no-console": [
-      true,
-      "debug",
-      "info",
-      "time",
-      "timeEnd",
-      "trace"
-    ],
-    "no-empty": false,
-    "no-inferrable-types": [
-      true,
-      "ignore-params"
-    ],
-    "no-non-null-assertion": true,
-    "no-redundant-jsdoc": true,
-    "no-switch-case-fall-through": true,
-    "no-var-requires": false,
-    "object-literal-key-quotes": [
-      true,
-      "as-needed"
-    ],
-    "quotemark": [
-      true,
-      "single"
-    ],
-    "semicolon": {
-      "options": [
-        "always"
-      ]
-    },
-    "space-before-function-paren": {
-      "options": {
-        "anonymous": "never",
-        "asyncArrow": "always",
-        "constructor": "never",
-        "method": "never",
-        "named": "never"
-      }
-    },
-    "typedef": [
-      true,
-      "call-signature"
-    ],
-    "typedef-whitespace": {
-      "options": [
-        {
-          "call-signature": "nospace",
-          "index-signature": "nospace",
-          "parameter": "nospace",
-          "property-declaration": "nospace",
-          "variable-declaration": "nospace"
-        },
-        {
-          "call-signature": "onespace",
-          "index-signature": "onespace",
-          "parameter": "onespace",
-          "property-declaration": "onespace",
-          "variable-declaration": "onespace"
-        }
-      ]
-    },
-    "variable-name": {
-      "options": [
-        "ban-keywords",
-        "check-format",
-        "allow-pascal-case"
-      ]
-    },
-    "whitespace": {
-      "options": [
-        "check-branch",
-        "check-decl",
-        "check-operator",
-        "check-separator",
-        "check-type",
-        "check-typecast"
-      ]
-    },
-    "component-class-suffix": true,
-    "contextual-lifecycle": true,
-    "directive-class-suffix": true,
-    "no-conflicting-lifecycle": true,
-    "no-host-metadata-property": true,
-    "no-input-rename": true,
-    "no-inputs-metadata-property": true,
-    "no-output-native": true,
-    "no-output-on-prefix": true,
-    "no-output-rename": true,
-    "no-outputs-metadata-property": true,
-    "template-banana-in-box": true,
-    "template-no-negated-async": true,
-    "use-lifecycle-interface": true,
-    "use-pipe-transform-interface": true,
-    "directive-selector": [
-      true,
-      "attribute",
-      "app",
-      "camelCase"
-    ],
-    "component-selector": [
-      true,
-      "element",
-      "app",
-      "kebab-case"
-    ]
-  }
-}

+ 4 - 4
examples/svelte-example/src/main.ts

@@ -1,7 +1,7 @@
-import App from './App.svelte';
+import App from './App.svelte'
 
 const app = new App({
-	target: document.body,
-});
+  target: document.body,
+})
 
-export default app;
+export default app

File diff ditekan karena terlalu besar
+ 610 - 88
package-lock.json


+ 4 - 1
package.json

@@ -8,7 +8,8 @@
     "*.md": [
       "remark -f -q -i .gitignore",
       "eslint --fix"
-    ]
+    ],
+    "*.ts": "eslint --fix"
   },
   "remarkConfig": {
     "plugins": [
@@ -46,6 +47,8 @@
     "@goto-bus-stop/envify": "^5.0.0",
     "@jamen/lorem": "^0.2.0",
     "@size-limit/preset-big-lib": "4.5.6",
+    "@typescript-eslint/eslint-plugin": "^4.28.2",
+    "@typescript-eslint/parser": "^4.28.2",
     "@wdio/cli": "^5.18.6",
     "@wdio/local-runner": "^5.18.6",
     "@wdio/mocha-framework": "^5.18.6",

+ 45 - 0
packages/@uppy/angular/.eslintrc.json

@@ -0,0 +1,45 @@
+{
+  "ignorePatterns": [
+    "projects/**/*"
+  ],
+  "overrides": [
+    {
+      "files": [
+        "*.ts"
+      ],
+      "parserOptions": {
+        "project": [
+          "packages/@uppy/angular/tsconfig.json"
+        ],
+        "createDefaultProgram": true
+      },
+      "extends": [
+        "plugin:@angular-eslint/ng-cli-compat",
+        "plugin:@angular-eslint/ng-cli-compat--formatting-add-on",
+        "plugin:@angular-eslint/template/process-inline-templates"
+      ],
+      "rules": {
+        "@typescript-eslint/semi": ["error", "never"],
+        "dot-notation": "error",
+        "import/no-unresolved": "off",
+        "import/prefer-default-export": "off",
+        "indent": "error",
+        "no-empty-function": "off",
+        "no-shadow": "error",
+        "no-unused-expressions": "error",
+        "no-use-before-define": "off",
+        "quotes": "error",
+        "semi": ["error", "never"]
+      }
+    },
+    {
+      "files": [
+        "*.html"
+      ],
+      "extends": [
+        "plugin:@angular-eslint/template/recommended"
+      ],
+      "rules": {}
+    }
+  ]
+}

+ 1 - 1
packages/@uppy/angular/README.md

@@ -12,7 +12,7 @@ Uppy is being developed by the folks at [Transloadit](https://transloadit.com),
 ## Example
 
 ```ts
-// TODO 
+// TODO
 ```
 
 ## Installation

+ 10 - 9
packages/@uppy/angular/angular.json

@@ -30,18 +30,19 @@
           }
         },
         "lint": {
-          "builder": "@angular-devkit/build-angular:tslint",
+          "builder": "@angular-eslint/builder:lint",
           "options": {
-            "tsConfig": [
-              "projects/angular/tsconfig.lib.json",
-              "projects/angular/tsconfig.spec.json"
-            ],
-            "exclude": [
-              "**/node_modules/**"
+            "lintFilePatterns": [
+              "projects/angular/**/*.ts",
+              "projects/angular/**/*.html"
             ]
           }
         }
       }
-    }},
-  "defaultProject": "angular"
+    }
+  },
+  "defaultProject": "angular",
+  "cli": {
+    "defaultCollection": "@angular-eslint/schematics"
+  }
 }

+ 11 - 2
packages/@uppy/angular/package.json

@@ -37,6 +37,11 @@
   },
   "devDependencies": {
     "@angular-devkit/build-angular": "~12.1.0",
+    "@angular-eslint/builder": "12.2.0",
+    "@angular-eslint/eslint-plugin": "12.2.0",
+    "@angular-eslint/eslint-plugin-template": "12.2.0",
+    "@angular-eslint/schematics": "12.2.0",
+    "@angular-eslint/template-parser": "12.2.0",
     "@angular/cli": "~12.1.0",
     "@angular/compiler-cli": "~12.1.0",
     "@babel/core": "^7.10.5",
@@ -48,8 +53,13 @@
     "@types/jasmine": "~3.6.0",
     "@types/jasminewd2": "~2.0.3",
     "@types/node": "^12.11.1",
+    "@typescript-eslint/eslint-plugin": "^4.28.2",
+    "@typescript-eslint/parser": "^4.28.2",
     "babel-loader": "^8.1.0",
-    "codelyzer": "^6.0.0",
+    "eslint": "^7.22.0",
+    "eslint-plugin-import": "^2.22.1",
+    "eslint-plugin-jsdoc": "^35.4.1",
+    "eslint-plugin-prefer-arrow": "latest",
     "jasmine-core": "~3.6.0",
     "jasmine-spec-reporter": "~5.0.0",
     "karma": "~6.1.0",
@@ -61,7 +71,6 @@
     "protractor": "~7.0.0",
     "redux": "^4.0.5",
     "ts-node": "~8.3.0",
-    "tslint": "~6.1.0",
     "typescript": "~4.3"
   },
   "publishConfig": {

+ 52 - 0
packages/@uppy/angular/projects/angular/.eslintrc.json

@@ -0,0 +1,52 @@
+{
+  "extends": "../../.eslintrc.json",
+  "ignorePatterns": [
+    "!**/*"
+  ],
+  "overrides": [
+    {
+      "files": [
+        "*.ts"
+      ],
+      "parserOptions": {
+        "project": [
+          "packages/@uppy/angular/projects/angular/tsconfig.lib.json",
+          "packages/@uppy/angular/projects/angular/tsconfig.spec.json"
+        ],
+        "createDefaultProgram": true
+      },
+      "rules": {
+        "@angular-eslint/component-selector": [
+          "error",
+          {
+            "type": "element",
+            "prefix": "uppy",
+            "style": "kebab-case"
+          }
+        ],
+        "@angular-eslint/directive-selector": [
+          "error",
+          {
+            "type": "attribute",
+            "prefix": "uppy",
+            "style": "camelCase"
+          }
+        ],
+        "dot-notation": "error",
+        "indent": "error",
+        "no-empty-function": "off",
+        "no-shadow": "error",
+        "no-unused-expressions": "error",
+        "no-use-before-define": "off",
+        "quotes": "error",
+        "semi": "error"
+      }
+    },
+    {
+      "files": [
+        "*.html"
+      ],
+      "rules": {}
+    }
+  ]
+}

+ 10 - 10
packages/@uppy/angular/projects/angular/src/public-api.ts

@@ -2,13 +2,13 @@
  * Public API Surface of @uppy/angular
  */
 
-export { UppyAngularDashboardModule } from './lib/components/dashboard/dashboard.module';
-export { UppyAngularDashboardModalModule } from './lib/components/dashboard-modal/dashboard-modal.module';
-export { UppyAngularProgressBarModule } from './lib/components/progress-bar/progress-bar.module';
-export { UppyAngularStatusBarModule } from './lib/components/status-bar/status-bar.module';
-export { UppyAngularDragDropModule } from './lib/components/drag-drop/drag-drop.module';
-export { StatusBarComponent } from './lib/components/status-bar/status-bar.component';
-export { ProgressBarComponent } from './lib/components/progress-bar/progress-bar.component';
-export { DragDropComponent } from './lib/components/drag-drop/drag-drop.component';
-export { DashboardComponent } from './lib/components/dashboard/dashboard.component';
-export { DashboardModalComponent } from './lib/components/dashboard-modal/dashboard-modal.component';
+export { UppyAngularDashboardModule } from './lib/components/dashboard/dashboard.module'
+export { UppyAngularDashboardModalModule } from './lib/components/dashboard-modal/dashboard-modal.module'
+export { UppyAngularProgressBarModule } from './lib/components/progress-bar/progress-bar.module'
+export { UppyAngularStatusBarModule } from './lib/components/status-bar/status-bar.module'
+export { UppyAngularDragDropModule } from './lib/components/drag-drop/drag-drop.module'
+export { StatusBarComponent } from './lib/components/status-bar/status-bar.component'
+export { ProgressBarComponent } from './lib/components/progress-bar/progress-bar.component'
+export { DragDropComponent } from './lib/components/drag-drop/drag-drop.component'
+export { DashboardComponent } from './lib/components/dashboard/dashboard.component'
+export { DashboardModalComponent } from './lib/components/dashboard-modal/dashboard-modal.component'

+ 9 - 9
packages/@uppy/angular/projects/angular/src/test.ts

@@ -1,26 +1,26 @@
 // This file is required by karma.conf.js and loads recursively all the .spec and framework files
 
-import 'zone.js/dist/zone';
-import 'zone.js/dist/zone-testing';
-import { getTestBed } from '@angular/core/testing';
+import 'zone.js/dist/zone'
+import 'zone.js/dist/zone-testing'
+import { getTestBed } from '@angular/core/testing'
 import {
   BrowserDynamicTestingModule,
-  platformBrowserDynamicTesting
-} from '@angular/platform-browser-dynamic/testing';
+  platformBrowserDynamicTesting,
+} from '@angular/platform-browser-dynamic/testing'
 
 declare const require: {
   context(path: string, deep?: boolean, filter?: RegExp): {
     keys(): string[];
     <T>(id: string): T;
   };
-};
+}
 
 // First, initialize the Angular testing environment.
 getTestBed().initTestEnvironment(
   BrowserDynamicTestingModule,
   platformBrowserDynamicTesting()
-);
+)
 // Then we find all the tests.
-const context = require.context('./', true, /\.spec\.ts$/);
+const context = require.context('./', true, /\.spec\.ts$/)
 // And load the modules.
-context.keys().map(context);
+context.keys().map(context)

+ 0 - 17
packages/@uppy/angular/projects/angular/tslint.json

@@ -1,17 +0,0 @@
-{
-  "extends": "../../tslint.json",
-  "rules": {
-    "directive-selector": [
-      true,
-      "attribute",
-      "uppy",
-      "camelCase"
-    ],
-    "component-selector": [
-      true,
-      "element",
-      "uppy",
-      "kebab-case"
-    ]
-  }
-}

+ 3 - 9
packages/@uppy/angular/tsconfig.base.json

@@ -11,15 +11,9 @@
     "importHelpers": true,
     "target": "es2015",
     "module": "es2020",
-    "lib": [
-      "es2018",
-      "dom"
-    ],
+    "lib": ["es2018", "dom"],
     "paths": {
-      "angular": [
-        "dist/angular/angular",
-        "dist/angular"
-      ]
+      "angular": ["dist/angular/angular", "dist/angular"]
     }
   }
-}
+}

+ 0 - 140
packages/@uppy/angular/tslint.json

@@ -1,140 +0,0 @@
-{
-  "extends": "tslint:recommended",
-  "rulesDirectory": [
-    "codelyzer"
-  ],
-  "rules": {
-    "align": {
-      "options": [
-        "parameters",
-        "statements"
-      ]
-    },
-    "array-type": false,
-    "arrow-return-shorthand": true,
-    "curly": true,
-    "deprecation": {
-      "severity": "warning"
-    },
-    "eofline": true,
-    "import-blacklist": [
-      true,
-      "rxjs/Rx"
-    ],
-    "import-spacing": true,
-    "indent": {
-      "options": [
-        "spaces"
-      ]
-    },
-    "max-classes-per-file": false,
-    "max-line-length": [
-      true,
-      140
-    ],
-    "member-ordering": [
-      true,
-      {
-        "order": [
-          "static-field",
-          "instance-field",
-          "static-method",
-          "instance-method"
-        ]
-      }
-    ],
-    "no-console": [
-      true,
-      "debug",
-      "info",
-      "time",
-      "timeEnd",
-      "trace"
-    ],
-    "no-empty": false,
-    "no-inferrable-types": [
-      true,
-      "ignore-params"
-    ],
-    "no-non-null-assertion": true,
-    "no-redundant-jsdoc": true,
-    "no-switch-case-fall-through": true,
-    "no-var-requires": false,
-    "object-literal-key-quotes": [
-      true,
-      "as-needed"
-    ],
-    "quotemark": [
-      true,
-      "single"
-    ],
-    "semicolon": {
-      "options": [
-        "always"
-      ]
-    },
-    "space-before-function-paren": {
-      "options": {
-        "anonymous": "never",
-        "asyncArrow": "always",
-        "constructor": "never",
-        "method": "never",
-        "named": "never"
-      }
-    },
-    "typedef": [
-      true,
-      "call-signature"
-    ],
-    "typedef-whitespace": {
-      "options": [
-        {
-          "call-signature": "nospace",
-          "index-signature": "nospace",
-          "parameter": "nospace",
-          "property-declaration": "nospace",
-          "variable-declaration": "nospace"
-        },
-        {
-          "call-signature": "onespace",
-          "index-signature": "onespace",
-          "parameter": "onespace",
-          "property-declaration": "onespace",
-          "variable-declaration": "onespace"
-        }
-      ]
-    },
-    "variable-name": {
-      "options": [
-        "ban-keywords",
-        "check-format",
-        "allow-pascal-case"
-      ]
-    },
-    "whitespace": {
-      "options": [
-        "check-branch",
-        "check-decl",
-        "check-operator",
-        "check-separator",
-        "check-type",
-        "check-typecast"
-      ]
-    },
-    "component-class-suffix": true,
-    "contextual-lifecycle": true,
-    "directive-class-suffix": true,
-    "no-conflicting-lifecycle": true,
-    "no-host-metadata-property": true,
-    "no-input-rename": true,
-    "no-inputs-metadata-property": true,
-    "no-output-native": true,
-    "no-output-on-prefix": true,
-    "no-output-rename": true,
-    "no-outputs-metadata-property": true,
-    "template-banana-in-box": true,
-    "template-no-negated-async": true,
-    "use-lifecycle-interface": true,
-    "use-pipe-transform-interface": true
-  }
-}

+ 7 - 9
packages/@uppy/aws-s3-multipart/types/index.d.ts

@@ -2,14 +2,13 @@ import type { PluginOptions, BasePlugin, UppyFile } from '@uppy/core'
 
 type MaybePromise<T> = T | Promise<T>
 
-declare module AwsS3Multipart {
-  interface AwsS3Part {
-    PartNumber?: number
-    Size?: number
-    ETag?: string
-  }
+export interface AwsS3Part {
+  PartNumber?: number
+  Size?: number
+  ETag?: string
+}
 
-  interface AwsS3MultipartOptions extends PluginOptions {
+interface AwsS3MultipartOptions extends PluginOptions {
     companionHeaders?: { [type: string]: string }
     companionUrl?: string
     getChunkSize?: (file: UppyFile) => number
@@ -35,11 +34,10 @@ declare module AwsS3Multipart {
     timeout?: number
     limit?: number
     retryDelays?: number[] | null
-  }
 }
 
 declare class AwsS3Multipart extends BasePlugin<
-  AwsS3Multipart.AwsS3MultipartOptions
+  AwsS3MultipartOptions
 > {}
 
 export default AwsS3Multipart

+ 4 - 3
packages/@uppy/aws-s3-multipart/types/index.test-d.ts

@@ -1,7 +1,8 @@
 import { expectError, expectType } from 'tsd'
 import Uppy from '@uppy/core'
 import type { UppyFile } from '@uppy/core'
-import AwsS3Multipart from '../'
+import AwsS3Multipart from '..'
+import type { AwsS3Part } from '..'
 
 {
   const uppy = new Uppy()
@@ -33,9 +34,9 @@ import AwsS3Multipart from '../'
       expectType<UppyFile>(file)
       expectType<string>(opts.uploadId)
       expectType<string>(opts.key)
-      expectType<AwsS3Multipart.AwsS3Part>(opts.parts[0])
+      expectType<AwsS3Part>(opts.parts[0])
       return {}
-    }
+    },
   })
 }
 

+ 4 - 6
packages/@uppy/aws-s3/types/index.d.ts

@@ -2,23 +2,21 @@ import type { PluginOptions, BasePlugin, UppyFile } from '@uppy/core'
 
 type MaybePromise<T> = T | Promise<T>
 
-declare module AwsS3 {
-  interface AwsS3UploadParameters {
+interface AwsS3UploadParameters {
     method?: string
     url: string
     fields?: { [type: string]: string }
     headers?: { [type: string]: string }
-  }
+}
 
-  interface AwsS3Options extends PluginOptions {
+interface AwsS3Options extends PluginOptions {
     companionUrl?: string
     getUploadParameters?: (file: UppyFile) => MaybePromise<AwsS3UploadParameters>
     metaFields?: string[]
     timeout?: number
     limit?: number
-  }
 }
 
-declare class AwsS3 extends BasePlugin<AwsS3.AwsS3Options> {}
+declare class AwsS3 extends BasePlugin<AwsS3Options> {}
 
 export default AwsS3

+ 2 - 2
packages/@uppy/aws-s3/types/index.test-d.ts

@@ -1,7 +1,7 @@
 import { expectType } from 'tsd'
 import Uppy from '@uppy/core'
 import type { UppyFile } from '@uppy/core'
-import AwsS3 from '../'
+import AwsS3 from '..'
 
 {
   const uppy = new Uppy()
@@ -9,6 +9,6 @@ import AwsS3 from '../'
     getUploadParameters (file) {
       expectType<UppyFile>(file)
       return { url: '' }
-    }
+    },
   })
 }

+ 2 - 4
packages/@uppy/box/types/index.d.ts

@@ -1,15 +1,13 @@
 import type { PluginOptions, PluginTarget, UIPlugin } from '@uppy/core'
 import type { PublicProviderOptions, TokenStorage } from '@uppy/companion-client'
 
-declare module Box {
-  interface BoxOptions extends PluginOptions, PublicProviderOptions {
+interface BoxOptions extends PluginOptions, PublicProviderOptions {
     replaceTargetContent?: boolean
     target?: PluginTarget
     title?: string
     storage?: TokenStorage
-  }
 }
 
-declare class Box extends UIPlugin<Box.BoxOptions> {}
+declare class Box extends UIPlugin<BoxOptions> {}
 
 export default Box

+ 1 - 1
packages/@uppy/box/types/index.test-d.ts

@@ -1,2 +1,2 @@
-import Box = require('../')
+// import Box from '..'
 // TODO implement

+ 24 - 7
packages/@uppy/companion-client/types/index.d.ts

@@ -1,3 +1,5 @@
+import type { Uppy } from '@uppy/core'
+
 /**
  * Async storage interface, similar to `localStorage`. This can be used to
  * implement custom storages for authentication tokens.
@@ -10,15 +12,18 @@ export interface TokenStorage {
 
 export interface RequestClientOptions {
   companionUrl: string
-  companionHeaders?: object
+  companionHeaders?: Record<string, unknown>
   companionCookiesRule?: RequestCredentials
 }
 
 export class RequestClient {
-  constructor (uppy: any, opts: RequestClientOptions)
+  constructor (uppy: Uppy, opts: RequestClientOptions)
+
   get (path: string): Promise<any>
-  post (path: string, data: object): Promise<any>
-  delete (path: string, data: object): Promise<any>
+
+  post (path: string, data: Record<string, unknown>): Promise<any>
+
+  delete (path: string, data: Record<string, unknown>): Promise<any>
 }
 
 /**
@@ -39,13 +44,19 @@ export interface ProviderOptions extends PublicProviderOptions {
 }
 
 export class Provider extends RequestClient {
-  constructor (uppy: any, opts: ProviderOptions)
+  constructor (uppy: Uppy, opts: ProviderOptions)
+
   checkAuth (): Promise<boolean>
+
   authUrl (): string
+
   fileUrl (id: string): string
+
   list (directory: string): Promise<any>
+
   logout (redirect?: string): Promise<any>
-  static initPlugin (plugin: any, opts: object, defaultOpts?: object): void
+
+  static initPlugin (plugin: unknown, opts: Record<string, unknown>, defaultOpts?: Record<string, unknown>): void
 }
 
 export interface SocketOptions {
@@ -57,10 +68,16 @@ export class Socket {
   isOpen: boolean
 
   constructor (opts: SocketOptions)
+
   open (): void
+
   close (): void
-  send (action: string, payload: any): void
+
+  send (action: string, payload: unknown): void
+
   on (action: string, handler: (param: any) => void): void
+
   once (action: string, handler: (param: any) => void): void
+
   emit (action: string, payload: (param: any) => void): void
 }

+ 1 - 1
packages/@uppy/companion-client/types/index.test-d.ts

@@ -1,2 +1,2 @@
-import { RequestClient, Provider, Socket } from '../'
+// import { RequestClient, Provider, Socket } from '..'
 // TODO tests

+ 2 - 1
packages/@uppy/companion/src/server/provider/error.d.ts

@@ -1,4 +1,5 @@
-// We need explicit type declarations for `errors.js` because of a typescript bug when generating declaration files. I think it's this one:
+// We need explicit type declarations for `errors.js` because of a typescript bug when generating declaration files.
+// I think it's this one:
 // https://github.com/microsoft/TypeScript/issues/37832
 //
 // We could try removing this file when we upgrade to 4.1 :)

+ 129 - 58
packages/@uppy/core/types/index.d.ts

@@ -1,58 +1,59 @@
-import * as UppyUtils from "@uppy/utils"
+import * as UppyUtils from '@uppy/utils'
 
 // Utility types
 type OmitKey<T, Key> = Pick<T, Exclude<keyof T, Key>>
 
 type UploadHandler = (fileIDs: string[]) => Promise<void>
 
+export interface IndexedObject<T> {
+  [key: string]: T
+  [key: number]: T
+}
+
+// These are defined in @uppy/utils instead of core so it can be used there without creating import cycles
+export type UppyFile<
+  TMeta extends IndexedObject<any> = Record<string, unknown>,
+  TBody extends IndexedObject<any> = Record<string, unknown>
+> = UppyUtils.UppyFile<TMeta, TBody>
+
 // Replace the `meta` property type with one that allows omitting internal metadata addFile() will add that
 type UppyFileWithoutMeta<TMeta, TBody> = OmitKey<
   UppyFile<TMeta, TBody>,
-  "meta"
+  'meta'
 >
 
 type LocaleStrings<TNames extends string> = {
   [K in TNames]?: string | { [n: number]: string }
 }
 
-type LogLevel = "info" | "warning" | "error"
+type LogLevel = 'info' | 'warning' | 'error'
 
 // This hack accepts _any_ string for `Event`, but also tricks VSCode and friends into providing autocompletions
 // for the names listed. https://github.com/microsoft/TypeScript/issues/29729#issuecomment-505826972
+// eslint-disable-next-line no-use-before-define
 type LiteralUnion<T extends U, U = string> = T | (U & Record<never, never>)
 
 type Event = LiteralUnion<
-  | "file-added"
-  | "file-removed"
-  | "upload"
-  | "upload-progress"
-  | "upload-success"
-  | "complete"
-  | "error"
-  | "upload-error"
-  | "upload-retry"
-  | "info-visible"
-  | "info-hidden"
-  | "cancel-all"
-  | "restriction-failed"
-  | "reset-progress"
+  | 'file-added'
+  | 'file-removed'
+  | 'upload'
+  | 'upload-progress'
+  | 'upload-success'
+  | 'complete'
+  | 'error'
+  | 'upload-error'
+  | 'upload-retry'
+  | 'info-visible'
+  | 'info-hidden'
+  | 'cancel-all'
+  | 'restriction-failed'
+  | 'reset-progress'
 >
 
-// These are defined in @uppy/utils instead of core so it can be used there without creating import cycles
-export type UppyFile<
-  TMeta extends IndexedObject<any> = {},
-  TBody extends IndexedObject<any> = {}
-> = UppyUtils.UppyFile<TMeta, TBody>
-
 export type Store = UppyUtils.Store
 
 export type InternalMetadata = UppyUtils.InternalMetadata
 
-export interface IndexedObject<T> {
-  [key: string]: T
-  [key: number]: T
-}
-
 export interface UploadedUppyFile<TMeta, TBody> extends UppyFile<TMeta, TBody> {
   uploadURL: string
 }
@@ -80,25 +81,46 @@ export interface DefaultPluginOptions extends PluginOptions {
 
 export class BasePlugin<TOptions extends PluginOptions = DefaultPluginOptions> {
   id: string
+
+  // eslint-disable-next-line no-use-before-define
   uppy: Uppy
+
   type: string
+
+  // eslint-disable-next-line no-use-before-define
   constructor(uppy: Uppy, opts?: TOptions)
+
   setOptions(update: Partial<TOptions>): void
-  getPluginState(): object
-  setPluginState(update: IndexedObject<any>): object
+
+  getPluginState(): Record<string, unknown>
+
+  setPluginState(update: IndexedObject<any>): Record<string, unknown>
+
   install(): void
+
   uninstall(): void
 }
 
 export class UIPlugin<TOptions extends PluginOptions = DefaultPluginOptions> extends BasePlugin<TOptions> {
   id: string
+
+  // eslint-disable-next-line no-use-before-define
   uppy: Uppy
+
   type: string
+
+  // eslint-disable-next-line no-use-before-define
   constructor(uppy: Uppy, opts?: TOptions)
-  update(state?: object): void
+
+  update(state?: Record<string, unknown>): void
+
+  // eslint-disable-next-line no-use-before-define
   mount(target: PluginTarget, plugin: typeof UIPlugin): void
-  render(state: object): void
+
+  render(state: Record<string, unknown>): void
+
   addTarget<TPlugin extends UIPlugin>(plugin: TPlugin): void
+
   unmount(): void
 }
 
@@ -122,7 +144,7 @@ export interface Restrictions {
   allowedFileTypes?: string[] | null
 }
 
-export interface UppyOptions<TMeta extends IndexedObject<any> = {}> {
+export interface UppyOptions<TMeta extends IndexedObject<any> = Record<string, unknown>> {
   id?: string
   autoProceed?: boolean
   allowMultipleUploads?: boolean
@@ -142,19 +164,19 @@ export interface UppyOptions<TMeta extends IndexedObject<any> = {}> {
 }
 
 export interface UploadResult<
-  TMeta extends IndexedObject<any> = {},
-  TBody extends IndexedObject<any> = {}
+  TMeta extends IndexedObject<any> = Record<string, unknown>,
+  TBody extends IndexedObject<any> = Record<string, unknown>
 > {
   successful: UploadedUppyFile<TMeta, TBody>[]
   failed: FailedUppyFile<TMeta, TBody>[]
 }
 
 export interface State<
-  TMeta extends IndexedObject<any> = {},
-  TBody extends IndexedObject<any> = {}
+  TMeta extends IndexedObject<any> = Record<string, unknown>,
+  TBody extends IndexedObject<any> = Record<string, unknown>
 > extends IndexedObject<any> {
   capabilities?: { resumableUploads?: boolean }
-  currentUploads: {}
+  currentUploads: Record<string, unknown>
   error?: string
   files: {
     [key: string]:
@@ -176,44 +198,71 @@ type UploadCompleteCallback<T> = (result: UploadResult<T>) => void
 
 export class Uppy {
   constructor(opts?: UppyOptions)
-  on<TMeta extends IndexedObject<any> = {}>(event: 'upload-success', callback: UploadSuccessCallback<TMeta>): this
-  on<TMeta extends IndexedObject<any> = {}>(event: 'complete', callback: UploadCompleteCallback<TMeta>): this
+
+  on<TMeta extends IndexedObject<any> = Record<string, unknown>>(event: 'upload-success', callback: UploadSuccessCallback<TMeta>): this
+
+  on<TMeta extends IndexedObject<any> = Record<string, unknown>>(event: 'complete', callback: UploadCompleteCallback<TMeta>): this
+
   on(event: Event, callback: (...args: any[]) => void): this
-  once<TMeta extends IndexedObject<any> = {}>(event: 'upload-success', callback: UploadSuccessCallback<TMeta>): this
-  once<TMeta extends IndexedObject<any> = {}>(event: 'complete', callback: UploadCompleteCallback<TMeta>): this
+
+  once<TMeta extends IndexedObject<any> = Record<string, unknown>>(event: 'upload-success', callback: UploadSuccessCallback<TMeta>): this
+
+  once<TMeta extends IndexedObject<any> = Record<string, unknown>>(event: 'complete', callback: UploadCompleteCallback<TMeta>): this
+
   once(event: Event, callback: (...args: any[]) => void): this
+
   off(event: Event, callback: (...args: any[]) => void): this
+
   off(event: Event, callback: (...args: any[]) => void): this
+
   /**
    * For use by plugins only.
    */
   emit(event: Event, ...args: any[]): void
-  updateAll(state: object): void
+
+  updateAll(state: Record<string, unknown>): void
+
   setOptions(update: Partial<UppyOptions>): void
-  setState(patch: object): void
-  getState<TMeta extends IndexedObject<any> = {}>(): State<TMeta>
+
+  setState(patch: Record<string, unknown>): void
+
+  getState<TMeta extends IndexedObject<any> = Record<string, unknown>>(): State<TMeta>
+
   readonly state: State
-  setFileState(fileID: string, state: object): void
+
+  setFileState(fileID: string, state: Record<string, unknown>): void
+
   resetProgress(): void
+
   addPreProcessor(fn: UploadHandler): void
+
   removePreProcessor(fn: UploadHandler): void
+
   addPostProcessor(fn: UploadHandler): void
+
   removePostProcessor(fn: UploadHandler): void
+
   addUploader(fn: UploadHandler): void
+
   removeUploader(fn: UploadHandler): void
-  setMeta<TMeta extends IndexedObject<any> = {}>(data: TMeta): void
-  setFileMeta<TMeta extends IndexedObject<any> = {}>(
+
+  setMeta<TMeta extends IndexedObject<any> = Record<string, unknown>>(data: TMeta): void
+
+  setFileMeta<TMeta extends IndexedObject<any> = Record<string, unknown>>(
     fileID: string,
     data: TMeta
   ): void
+
   getFile<
-    TMeta extends IndexedObject<any> = {},
-    TBody extends IndexedObject<any> = {}
+    TMeta extends IndexedObject<any> = Record<string, unknown>,
+    TBody extends IndexedObject<any> = Record<string, unknown>
   >(fileID: string): UppyFile<TMeta, TBody>
+
   getFiles<
-    TMeta extends IndexedObject<any> = {},
-    TBody extends IndexedObject<any> = {}
+    TMeta extends IndexedObject<any> = Record<string, unknown>,
+    TBody extends IndexedObject<any> = Record<string, unknown>
   >(): Array<UppyFile<TMeta, TBody>>
+
   getObjectOfFilesPerState(): {
     newFiles: Array<UppyFile>
     startedFiles: Array<UppyFile>
@@ -231,43 +280,65 @@ export class Uppy {
     isUploadInProgress: boolean
     isSomeGhost: boolean
   }
-  addFile<TMeta extends IndexedObject<any> = {}>(
+
+  addFile<TMeta extends IndexedObject<any> = Record<string, unknown>>(
     file: AddFileOptions<TMeta>
   ): string
+
   removeFile(fileID: string): void
+
   pauseResume(fileID: string): boolean
+
   pauseAll(): void
+
   resumeAll(): void
-  retryAll<TMeta extends IndexedObject<any> = {}>(): Promise<
+
+  retryAll<TMeta extends IndexedObject<any> = Record<string, unknown>>(): Promise<
     UploadResult<TMeta>
   >
+
   cancelAll(): void
-  retryUpload<TMeta extends IndexedObject<any> = {}>(
+
+  retryUpload<TMeta extends IndexedObject<any> = Record<string, unknown>>(
     fileID: string
   ): Promise<UploadResult<TMeta>>
+
   reset(): void
+
   getID(): string
+
   use<TOptions, TInstance extends UIPlugin | BasePlugin<TOptions>>(
     pluginClass: new (uppy: this, opts: TOptions) => TInstance,
     opts?: TOptions
   ): this
+
   getPlugin<TPlugin extends UIPlugin | BasePlugin>(name: string): TPlugin
+
   iteratePlugins(callback: (plugin: UIPlugin | BasePlugin) => void): void
+
   removePlugin(instance: UIPlugin | BasePlugin): void
+
   close(): void
+
   logout(): void
+
   info(
     message: string | { message: string; details: string },
     type?: LogLevel,
     duration?: number
   ): void
+
   hideInfo(): void
+
   log(msg: string, type?: LogLevel): void
-  restore<TMeta extends IndexedObject<any> = {}>(
+
+  restore<TMeta extends IndexedObject<any> = Record<string, unknown>>(
     uploadID: string
   ): Promise<UploadResult<TMeta>>
-  addResultData(uploadID: string, data: object): void
-  upload<TMeta extends IndexedObject<any> = {}>(): Promise<UploadResult<TMeta>>
+
+  addResultData(uploadID: string, data: Record<string, unknown>): void
+
+  upload<TMeta extends IndexedObject<any> = Record<string, unknown>>(): Promise<UploadResult<TMeta>>
 }
 
 export default Uppy

+ 18 - 14
packages/@uppy/core/types/index.test-d.ts

@@ -1,25 +1,27 @@
 import { expectError, expectType } from 'tsd'
-import Uppy, { UIPlugin } from '../'
-import type { UploadedUppyFile, FailedUppyFile, PluginOptions } from '../'
 import DefaultStore from '@uppy/store-default'
+import Uppy, { UIPlugin } from '..'
+import type { UploadedUppyFile, FailedUppyFile, PluginOptions } from '..'
+
+type anyObject = Record<string, unknown>
 
 {
   const uppy = new Uppy()
   uppy.addFile({
     data: new Blob([new ArrayBuffer(1024)], {
-      type: 'application/octet-stream'
-    })
+      type: 'application/octet-stream',
+    }),
   })
 
   uppy.upload().then((result) => {
-    expectType<UploadedUppyFile<{}, {}>>(result.successful[0])
-    expectType<FailedUppyFile<{}, {}>>(result.failed[0])
+    expectType<UploadedUppyFile<anyObject, anyObject>>(result.successful[0])
+    expectType<FailedUppyFile<anyObject, anyObject>>(result.failed[0])
   })
 }
 
 {
   const store = DefaultStore()
-  new Uppy({ store })
+  new Uppy({ store }) // eslint-disable-line no-new
 }
 
 {
@@ -33,17 +35,17 @@ import DefaultStore from '@uppy/store-default'
   if (f && f.response && f.response.status === 200) {
     expectType(f.response.body)
   }
-  expectType<number>(f.response!.status)
+  expectType<number>(f.response!.status) // eslint-disable-line @typescript-eslint/no-non-null-assertion
 }
 
 {
-  type Meta = {}
+  type Meta = Record<string, never>
   type ResponseBody = {
     averageColor: string
   }
   const uppy = new Uppy()
-  const f = uppy.getFile<Meta, ResponseBody>('virtual')!
-  expectType<ResponseBody>(f.response!.body)
+  const f = uppy.getFile<Meta, ResponseBody>('virtual')
+  expectType<ResponseBody>(f.response!.body) // eslint-disable-line @typescript-eslint/no-non-null-assertion
 }
 
 {
@@ -51,7 +53,7 @@ import DefaultStore from '@uppy/store-default'
   uppy.addFile({
     name: 'empty.json',
     data: new Blob(['null'], { type: 'application/json' }),
-    meta: { path: 'path/to/file' }
+    meta: { path: 'path/to/file' },
   })
 }
 
@@ -68,6 +70,7 @@ import DefaultStore from '@uppy/store-default'
 }
 
 {
+  /* eslint-disable @typescript-eslint/no-empty-function */
   const uppy = new Uppy()
   // can emit events with internal event types
   uppy.emit('upload')
@@ -88,14 +91,15 @@ import DefaultStore from '@uppy/store-default'
   // can register listeners on custom events
   uppy.on('dashboard:modal-closed', () => {})
   uppy.once('dashboard:modal-closed', () => {})
+  /* eslint-enable @typescript-eslint/no-empty-function */
 }
 
 {
   const uppy = new Uppy()
   uppy.setOptions({
     restrictions: {
-      allowedFileTypes: ['.png']
-    }
+      allowedFileTypes: ['.png'],
+    },
   })
   expectError(uppy.setOptions({ restrictions: false }))
   expectError(uppy.setOptions({ unknownKey: false }))

+ 9 - 2
packages/@uppy/dashboard/types/index.d.ts

@@ -7,7 +7,7 @@ type FieldRenderOptions = {
   onChange: (newVal: string) => void
 }
 
-type PreactRender = (node: any, params: object | null, ...children: any[]) => any
+type PreactRender = (node: any, params: Record<string, unknown> | null, ...children: any[]) => any
 
 interface MetaField {
   id: string
@@ -57,12 +57,19 @@ export interface DashboardOptions extends PluginOptions {
 
 declare class Dashboard extends UIPlugin<DashboardOptions> {
   addTarget (plugin: UIPlugin): HTMLElement
+
   hideAllPanels (): void
+
   openModal (): void
+
   closeModal (): void
+
   isModalOpen (): boolean
-  render (state: object): void
+
+  render (state: Record<string, unknown>): void
+
   install (): void
+
   uninstall (): void
 }
 

+ 15 - 15
packages/@uppy/dashboard/types/index.test-d.ts

@@ -1,11 +1,11 @@
 import { expectType, expectError } from 'tsd'
 import Uppy from '@uppy/core'
-import Dashboard from '../'
+import Dashboard from '..'
 
 {
   const uppy = new Uppy()
   uppy.use(Dashboard, {
-    target: 'body'
+    target: 'body',
   })
 
   const plugin = uppy.getPlugin<Dashboard>('Dashboard')
@@ -24,7 +24,7 @@ import Dashboard from '../'
       {
         id: 'license',
         name: 'License',
-        placeholder: 'Creative Commons, Apache 2.0, ...'
+        placeholder: 'Creative Commons, Apache 2.0, ...',
       },
       {
         id: 'public',
@@ -44,9 +44,9 @@ import Dashboard from '../'
             }
           })
           */
-        }
-      }
-    ]
+        },
+      },
+    ],
   })
 }
 
@@ -58,24 +58,24 @@ import Dashboard from '../'
         // Dashboard string
         addMoreFiles: 'yaddayadda',
         // StatusBar string
-        uploading: '^^^^'
-      }
-    }
+        uploading: '^^^^',
+      },
+    },
   })
   expectError(uppy.use(Dashboard, {
     locale: {
       strings: {
-        somethingThatDoesNotExist: 'wrong'
-      }
-    }
+        somethingThatDoesNotExist: 'wrong',
+      },
+    },
   }))
   const wrongType = 1234
   expectError(uppy.use(Dashboard, {
     locale: {
       strings: {
-        addMoreFiles: wrongType
-      }
-    }
+        addMoreFiles: wrongType,
+      },
+    },
   }))
 }
 {

+ 10 - 10
packages/@uppy/drag-drop/types/index.test-d.ts

@@ -1,26 +1,26 @@
-import Uppy from "@uppy/core"
+import Uppy from '@uppy/core'
 
-import DragDrop from "../"
+import DragDrop from '..'
 
 {
-  const uppy = new Uppy();
+  const uppy = new Uppy()
 
   uppy.use(DragDrop, {
     replaceTargetContent: true,
-    target: "body",
-    inputName: "test",
+    target: 'body',
+    inputName: 'test',
     allowMultipleFiles: true,
     width: 100,
-    height: "100",
-    note: "note",
+    height: '100',
+    note: 'note',
     locale: {
       strings: {
-        dropHereOr: "test",
-        browse: "test",
+        dropHereOr: 'test',
+        browse: 'test',
       },
     },
     onDragOver: (event) => event.clientX,
     onDragLeave: (event) => event.clientY,
     onDrop: (event) => event,
-  });
+  })
 }

+ 3 - 5
packages/@uppy/drop-target/types/index.d.ts

@@ -1,11 +1,9 @@
-import type { PluginOptions, BasePlugin} from '@uppy/core'
+import type { PluginOptions, BasePlugin } from '@uppy/core'
 
-declare module DropTarget {
-  interface DropTargetOptions extends PluginOptions {
+interface DropTargetOptions extends PluginOptions {
     target: string | Element
-  }
 }
 
-declare class DropTarget extends BasePlugin<DropTarget.DropTargetOptions> {}
+declare class DropTarget extends BasePlugin<DropTargetOptions> {}
 
 export default DropTarget

+ 1 - 1
packages/@uppy/drop-target/types/index.test-d.ts

@@ -1,2 +1,2 @@
-import DropTarget = require('../')
+// import DropTarget from '..'
 // TODO implement

+ 2 - 4
packages/@uppy/dropbox/types/index.d.ts

@@ -1,15 +1,13 @@
 import type { PluginOptions, UIPlugin, PluginTarget } from '@uppy/core'
 import type { PublicProviderOptions, TokenStorage } from '@uppy/companion-client'
 
-declare module Dropbox {
-  interface DropboxOptions extends PluginOptions, PublicProviderOptions {
+interface DropboxOptions extends PluginOptions, PublicProviderOptions {
     replaceTargetContent?: boolean
     target?: PluginTarget
     title?: string
     storage?: TokenStorage
-  }
 }
 
-declare class Dropbox extends UIPlugin<Dropbox.DropboxOptions> {}
+declare class Dropbox extends UIPlugin<DropboxOptions> {}
 
 export default Dropbox

+ 1 - 1
packages/@uppy/dropbox/types/index.test-d.ts

@@ -1,2 +1,2 @@
-import Dropbox = require('../')
+// import Dropbox from '..'
 // TODO implement

+ 2 - 4
packages/@uppy/facebook/types/index.d.ts

@@ -1,15 +1,13 @@
 import type { PluginOptions, UIPlugin, PluginTarget } from '@uppy/core'
 import type { PublicProviderOptions, TokenStorage } from '@uppy/companion-client'
 
-declare module Facebook {
-  interface FacebookOptions extends PluginOptions, PublicProviderOptions {
+interface FacebookOptions extends PluginOptions, PublicProviderOptions {
     replaceTargetContent?: boolean
     target?: PluginTarget
     title?: string
     storage?: TokenStorage
-  }
 }
 
-declare class Facebook extends UIPlugin<Facebook.FacebookOptions> {}
+declare class Facebook extends UIPlugin<FacebookOptions> {}
 
 export default Facebook

+ 1 - 1
packages/@uppy/facebook/types/index.test-d.ts

@@ -1,2 +1,2 @@
-import Facebook = require('../')
+// import Facebook from '..'
 // TODO implement

+ 2 - 4
packages/@uppy/file-input/types/index.d.ts

@@ -1,16 +1,14 @@
 import type { PluginOptions, UIPlugin, PluginTarget } from '@uppy/core'
 import FileInputLocale from './generatedLocale'
 
-declare module FileInput {
-  export interface FileInputOptions extends PluginOptions {
+export interface FileInputOptions extends PluginOptions {
     replaceTargetContent?: boolean
     target?: PluginTarget
     pretty?: boolean
     inputName?: string
     locale?: FileInputLocale
-  }
 }
 
-declare class FileInput extends UIPlugin<FileInput.FileInputOptions> {}
+declare class FileInput extends UIPlugin<FileInputOptions> {}
 
 export default FileInput

+ 2 - 1
packages/@uppy/file-input/types/index.test-d.ts

@@ -1 +1,2 @@
-import FileInput = require('../')
+// import FileInput from '..'
+// TODO implement

+ 2 - 4
packages/@uppy/form/types/index.d.ts

@@ -1,7 +1,6 @@
 import type { PluginOptions, PluginTarget, BasePlugin } from '@uppy/core'
 
-declare module Form {
-  interface FormOptions extends PluginOptions {
+interface FormOptions extends PluginOptions {
     replaceTargetContent?: boolean
     target?: PluginTarget
     resultName?: string
@@ -9,9 +8,8 @@ declare module Form {
     addResultToForm?: boolean
     submitOnSuccess?: boolean
     triggerUploadOnSubmit?: boolean
-  }
 }
 
-declare class Form extends BasePlugin<Form.FormOptions> {}
+declare class Form extends BasePlugin<FormOptions> {}
 
 export default Form

+ 2 - 1
packages/@uppy/form/types/index.test-d.ts

@@ -1 +1,2 @@
-import Form = require('../')
+// import Form from '..'
+// TODO implement

+ 2 - 6
packages/@uppy/golden-retriever/types/index.d.ts

@@ -1,15 +1,11 @@
 import type { PluginOptions, BasePlugin } from '@uppy/core'
 
-declare module GoldenRetriever {
-  interface GoldenRetrieverOptions extends PluginOptions {
+interface GoldenRetrieverOptions extends PluginOptions {
     expires?: number
     serviceWorker?: boolean
     indexedDB?: any
-  }
 }
 
-declare class GoldenRetriever extends BasePlugin<
-  GoldenRetriever.GoldenRetrieverOptions
-> {}
+declare class GoldenRetriever extends BasePlugin<GoldenRetrieverOptions> {}
 
 export default GoldenRetriever

+ 2 - 1
packages/@uppy/golden-retriever/types/index.test-d.ts

@@ -1 +1,2 @@
-import GoldenRetriever = require('../')
+// import GoldenRetriever from '..'
+// TODO implements

+ 1 - 3
packages/@uppy/google-drive/types/index.d.ts

@@ -1,15 +1,13 @@
 import type { PluginOptions, UIPlugin, PluginTarget } from '@uppy/core'
 import type { PublicProviderOptions, TokenStorage } from '@uppy/companion-client'
 
-declare module GoogleDrive {
   interface GoogleDriveOptions extends PluginOptions, PublicProviderOptions {
     replaceTargetContent?: boolean
     target?: PluginTarget
     title?: string
     storage?: TokenStorage
-  }
 }
 
-declare class GoogleDrive extends UIPlugin<GoogleDrive.GoogleDriveOptions> {}
+declare class GoogleDrive extends UIPlugin<GoogleDriveOptions> {}
 
 export default GoogleDrive

+ 4 - 4
packages/@uppy/google-drive/types/index.test-d.ts

@@ -1,9 +1,9 @@
-import Uppy, { UIPlugin } from '@uppy/core'
-import GoogleDrive from '../'
+import Uppy, { UIPlugin, PluginOptions } from '@uppy/core'
+import GoogleDrive from '..'
 
-class SomePlugin extends UIPlugin<{}> {}
+class SomePlugin extends UIPlugin<PluginOptions> {}
 
 const uppy = new Uppy()
 uppy.use(GoogleDrive, { companionUrl: '' })
 uppy.use(GoogleDrive, { target: SomePlugin, companionUrl: '' })
-uppy.use(GoogleDrive, { target: document.querySelector('#gdrive')!, companionUrl: '' })
+uppy.use(GoogleDrive, { target: document.querySelector('#gdrive') || (undefined as never), companionUrl: '' })

+ 18 - 20
packages/@uppy/image-editor/types/index.d.ts

@@ -1,28 +1,26 @@
 import type { PluginOptions, UIPlugin, PluginTarget } from '@uppy/core'
 import ImageEditorLocale from './generatedLocale'
 
-declare module ImageEditor {
-  type Actions = {
-    revert: boolean
-    rotate: boolean
-    granularRotate: boolean
-    flip: boolean
-    zoomIn: boolean
-    zoomOut: boolean
-    cropSquare: boolean
-    cropWidescreen: boolean
-    cropWidescreenVertical: boolean
-  }
+type Actions = {
+  revert: boolean
+  rotate: boolean
+  granularRotate: boolean
+  flip: boolean
+  zoomIn: boolean
+  zoomOut: boolean
+  cropSquare: boolean
+  cropWidescreen: boolean
+  cropWidescreenVertical: boolean
+}
 
-  export interface ImageEditorOptions extends PluginOptions {
-    cropperOptions?: object
-    actions?: Actions
-    quality?: number
-    target?: PluginTarget
-    locale?: ImageEditorLocale
-  }
+export interface ImageEditorOptions extends PluginOptions {
+  cropperOptions?: Record<string, unknown>
+  actions?: Actions
+  quality?: number
+  target?: PluginTarget
+  locale?: ImageEditorLocale
 }
 
-declare class ImageEditor extends UIPlugin<ImageEditor.ImageEditorOptions> {}
+declare class ImageEditor extends UIPlugin<ImageEditorOptions> {}
 
 export default ImageEditor

+ 2 - 1
packages/@uppy/image-editor/types/index.test-d.ts

@@ -1 +1,2 @@
-import ImageEditor = require('../')
+// import ImageEditor from '..'
+// TODO implement

+ 4 - 6
packages/@uppy/informer/types/index.d.ts

@@ -1,12 +1,10 @@
 import type { PluginOptions, UIPlugin, PluginTarget } from '@uppy/core'
 
-declare module Informer {
-  interface InformerOptions extends PluginOptions {
-    replaceTargetContent?: boolean
-    target?: PluginTarget
-  }
+interface InformerOptions extends PluginOptions {
+  replaceTargetContent?: boolean
+  target?: PluginTarget
 }
 
-declare class Informer extends UIPlugin<Informer.InformerOptions> {}
+declare class Informer extends UIPlugin<InformerOptions> {}
 
 export default Informer

+ 2 - 1
packages/@uppy/informer/types/index.test-d.ts

@@ -1 +1,2 @@
-import Informer = require('../')
+// import Informer from '..'
+// TODO implement

+ 2 - 4
packages/@uppy/instagram/types/index.d.ts

@@ -1,15 +1,13 @@
 import type { PluginOptions, UIPlugin, PluginTarget } from '@uppy/core'
 import type { PublicProviderOptions, TokenStorage } from '@uppy/companion-client'
 
-declare module Instagram {
-  interface InstagramOptions extends PluginOptions, PublicProviderOptions {
+interface InstagramOptions extends PluginOptions, PublicProviderOptions {
     replaceTargetContent?: boolean
     target?: PluginTarget
     title?: string
     storage?: TokenStorage
-  }
 }
 
-declare class Instagram extends UIPlugin<Instagram.InstagramOptions> {}
+declare class Instagram extends UIPlugin<InstagramOptions> {}
 
 export default Instagram

+ 1 - 1
packages/@uppy/instagram/types/index.test-d.ts

@@ -1,2 +1,2 @@
-import Instagram = require('../')
+// import Instagram from '..'
 // TODO implement

+ 2 - 4
packages/@uppy/onedrive/types/index.d.ts

@@ -1,15 +1,13 @@
 import type { PluginOptions, UIPlugin, PluginTarget } from '@uppy/core'
 import type { PublicProviderOptions, TokenStorage } from '@uppy/companion-client'
 
-declare module OneDrive {
-  interface OneDriveOptions extends PluginOptions, PublicProviderOptions {
+interface OneDriveOptions extends PluginOptions, PublicProviderOptions {
     replaceTargetContent?: boolean
     target?: PluginTarget
     title?: string
     storage?: TokenStorage
-  }
 }
 
-declare class OneDrive extends UIPlugin<OneDrive.OneDriveOptions> {}
+declare class OneDrive extends UIPlugin<OneDriveOptions> {}
 
 export default OneDrive

+ 1 - 1
packages/@uppy/onedrive/types/index.test-d.ts

@@ -1,2 +1,2 @@
-import OneDrive = require('../')
+// import OneDrive from '..'
 // TODO implement

+ 0 - 1
packages/@uppy/progress-bar/types/index.d.ts

@@ -7,7 +7,6 @@ export interface ProgressBarOptions extends PluginOptions {
   fixed?: boolean
 }
 
-
 declare class ProgressBar extends UIPlugin<ProgressBarOptions> {}
 
 export default ProgressBar

+ 1 - 1
packages/@uppy/progress-bar/types/index.test-d.ts

@@ -1,2 +1,2 @@
-import ProgressBar = require('../')
+// import ProgressBar from '..'
 // TODO implement

+ 2 - 3
packages/@uppy/provider-views/types/index.d.ts

@@ -13,10 +13,9 @@ interface OnFirstRenderer {
     onFirstRender: () => any
 }
 
-
 declare class ProviderView {
-    constructor (plugin: UIPlugin & OnFirstRenderer, opts: ProviderViewOptions)
-    // @todo add other provider view methods
+  constructor (plugin: UIPlugin & OnFirstRenderer, opts: ProviderViewOptions)
+  // @todo add other provider view methods
 }
 
 export default ProviderView

+ 1 - 1
packages/@uppy/react/src/Dashboard.d.ts

@@ -1,6 +1,6 @@
 import * as React from 'react'
+import type { DashboardOptions } from '@uppy/dashboard'
 import { Omit, ToUppyProps } from './CommonTypes'
-import type {DashboardOptions} from '@uppy/dashboard'
 
 // This type is mapped into `DashboardProps` below so IntelliSense doesn't display this big mess of nested types
 type DashboardPropsInner = Omit<

+ 1 - 1
packages/@uppy/react/src/DashboardModal.d.ts

@@ -1,5 +1,5 @@
-import { Omit, ToUppyProps } from './CommonTypes'
 import type { DashboardOptions } from '@uppy/dashboard'
+import { Omit, ToUppyProps } from './CommonTypes'
 
 // This type is mapped into `DashboardModalProps` below so IntelliSense doesn't display this big mess of nested types
 type DashboardModalPropsInner = {

+ 3 - 3
packages/@uppy/react/src/DragDrop.d.ts

@@ -1,5 +1,5 @@
-import { ToUppyProps } from './CommonTypes'
 import type { DragDropOptions } from '@uppy/drag-drop'
+import { ToUppyProps } from './CommonTypes'
 
 export type DragDropProps = ToUppyProps<DragDropOptions>  & React.BaseHTMLAttributes<HTMLDivElement>
 
@@ -7,5 +7,5 @@ export type DragDropProps = ToUppyProps<DragDropOptions>  & React.BaseHTMLAttrib
  * React component that renders an area in which files can be dropped to be
  * uploaded.
  */
-declare const DragDropComponent: React.ComponentType<DragDropProps>;
-export default DragDropComponent;
+declare const DragDropComponent: React.ComponentType<DragDropProps>
+export default DragDropComponent

+ 4 - 5
packages/@uppy/react/src/FileInput.d.ts

@@ -1,12 +1,11 @@
+import type { FileInputOptions } from '@uppy/file-input'
 import { ToUppyProps } from './CommonTypes'
-import FileInput from '@uppy/file-input'
 
-export type FileInputProps = ToUppyProps<FileInput.FileInputOptions>
+export type FileInputProps = ToUppyProps<FileInputOptions>
 
 /**
  * React component that renders an area in which files can be dropped to be
  * uploaded.
  */
-declare const FileInputComponent: React.ComponentType<FileInputProps>;
-export default FileInputComponent;
-
+declare const FileInputComponent: React.ComponentType<FileInputProps>
+export default FileInputComponent

+ 1 - 1
packages/@uppy/react/src/ProgressBar.d.ts

@@ -1,5 +1,5 @@
-import { ToUppyProps } from './CommonTypes'
 import type { ProgressBarOptions } from '@uppy/progress-bar'
+import { ToUppyProps } from './CommonTypes'
 
 export type ProgressBarProps = ToUppyProps<ProgressBarOptions> & React.BaseHTMLAttributes<HTMLDivElement>
 

+ 1 - 1
packages/@uppy/react/src/StatusBar.d.ts

@@ -1,5 +1,5 @@
-import { ToUppyProps } from './CommonTypes'
 import type { StatusBarOptions } from '@uppy/status-bar'
+import { ToUppyProps } from './CommonTypes'
 
 export type StatusBarProps = ToUppyProps<StatusBarOptions>  & React.BaseHTMLAttributes<HTMLDivElement>
 

+ 2 - 2
packages/@uppy/react/src/useUppy.d.ts

@@ -1,5 +1,5 @@
-import type Uppy from "@uppy/core"
+import type Uppy from '@uppy/core'
 
 declare function useUppy(factory: () => Uppy): Uppy
 
-export = useUppy
+export default useUppy

+ 1 - 3
packages/@uppy/react/types/index.d.ts

@@ -4,6 +4,4 @@ export { default as DragDrop } from '../src/DragDrop'
 export { default as ProgressBar } from '../src/ProgressBar'
 export { default as StatusBar } from '../src/StatusBar'
 export { default as FileInput } from '../src/FileInput'
-
-import useUppy = require('../src/useUppy')
-export { useUppy }
+export { default as useUppy } from '../src/useUppy'

+ 2 - 6
packages/@uppy/redux-dev-tools/types/index.d.ts

@@ -1,11 +1,7 @@
 import type { PluginOptions, UIPlugin } from '@uppy/core'
 
-declare module ReduxDevTools {
-  interface ReduxDevToolsOptions extends PluginOptions {}
-}
+type ReduxDevToolsOptions = PluginOptions
 
-declare class ReduxDevTools extends UIPlugin<
-  ReduxDevTools.ReduxDevToolsOptions
-> {}
+declare class ReduxDevTools extends UIPlugin<ReduxDevToolsOptions> {}
 
 export default ReduxDevTools

+ 1 - 1
packages/@uppy/redux-dev-tools/types/index.test-d.ts

@@ -1 +1 @@
-import ReduxDevTools = require('../')
+// import ReduxDevTools from '..'

+ 2 - 4
packages/@uppy/screen-capture/types/index.d.ts

@@ -1,6 +1,5 @@
 import type { PluginOptions, UIPlugin } from '@uppy/core'
 
-declare module ScreenCapture {
   // https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints#Properties_of_shared_screen_tracks
   // TODO: use the global DisplayMediaStreamConstraints once typescript includes it by default
   interface DisplayMediaStreamConstraints {
@@ -12,13 +11,12 @@ declare module ScreenCapture {
     });
   }
 
-  export interface ScreenCaptureOptions extends PluginOptions {
+export interface ScreenCaptureOptions extends PluginOptions {
     displayMediaConstraints?: DisplayMediaStreamConstraints,
     userMediaConstraints?: MediaStreamConstraints,
     preferredVideoMimeType?: string
   }
-}
 
-declare class ScreenCapture extends UIPlugin<ScreenCapture.ScreenCaptureOptions> {}
+declare class ScreenCapture extends UIPlugin<ScreenCaptureOptions> {}
 
 export default ScreenCapture

+ 15 - 19
packages/@uppy/screen-capture/types/index.test-d.ts

@@ -1,23 +1,19 @@
 import { expectError } from 'tsd'
 import Uppy from '@uppy/core'
-import ScreenCapture from '../'
+import ScreenCapture from '..'
 
-{
-  new Uppy().use(ScreenCapture)
-  new Uppy().use(ScreenCapture, {})
-  new Uppy().use(ScreenCapture, { preferredVideoMimeType: 'video/mp4' })
-  expectError(new Uppy().use(ScreenCapture, { preferredVideoMimeType: 10 }))
-}
+new Uppy().use(ScreenCapture)
+new Uppy().use(ScreenCapture, {})
+new Uppy().use(ScreenCapture, { preferredVideoMimeType: 'video/mp4' })
+expectError(new Uppy().use(ScreenCapture, { preferredVideoMimeType: 10 }))
 
-{
-  new Uppy().use(ScreenCapture, {
-    displayMediaConstraints: {
-      video: { displaySurface: 'window' }
-    }
-  })
-  expectError(new Uppy().use(ScreenCapture, {
-    displayMediaConstraints: {
-      video: { displaySurface: 'some nonsense' }
-    }
-  }))
-}
+new Uppy().use(ScreenCapture, {
+  displayMediaConstraints: {
+    video: { displaySurface: 'window' },
+  },
+})
+expectError(new Uppy().use(ScreenCapture, {
+  displayMediaConstraints: {
+    video: { displaySurface: 'some nonsense' },
+  },
+}))

+ 1 - 1
packages/@uppy/status-bar/types/index.test-d.ts

@@ -1,2 +1,2 @@
-import StatusBar = require('../')
+// import StatusBar from '..'
 // TODO implement

+ 9 - 3
packages/@uppy/store-default/types/index.d.ts

@@ -1,10 +1,16 @@
 import type { Store } from '@uppy/utils'
 
+type State = Record<string, unknown>
+type StateChangeListener = (prevState: State, nextState: State, patch: State) => void
+
 declare class DefaultStore implements Store {
   constructor ()
-  getState (): object
-  setState (patch: object): void
-  subscribe (listener: any): () => void
+
+  getState (): State
+
+  setState (patch: State): void
+
+  subscribe (listener: StateChangeListener): () => void
 }
 
 declare function createDefaultStore (): DefaultStore

+ 1 - 1
packages/@uppy/store-default/types/index.test-d.ts

@@ -1,4 +1,4 @@
-import DefaultStore from '../'
+import DefaultStore from '..'
 
 const store = DefaultStore()
 

+ 11 - 5
packages/@uppy/store-redux/types/index.d.ts

@@ -1,17 +1,23 @@
 import type { Store } from '@uppy/utils'
 import type { Reducer, Middleware, Store as Redux } from 'redux'
 
+type State = Record<string, unknown>
+type StateChangeListener = (prevState: State, nextState: State, patch: State) => void
+
 interface ReduxStoreOptions {
-  store: Redux<object>
+  store: Redux<State>
   id?: string
-  selector?: (state: any) => object
+  selector?: (state: any) => State
 }
 
 export class ReduxStore implements Store {
   constructor (opts: ReduxStoreOptions)
-  getState (): object
-  setState (patch: object): void
-  subscribe (listener: any): () => void
+
+  getState (): State
+
+  setState (patch: State): void
+
+  subscribe (listener: StateChangeListener): () => void
 }
 
 export const reducer: Reducer<any>

+ 1 - 0
packages/@uppy/store-redux/types/index.test-d.ts

@@ -1,3 +1,4 @@
+// eslint-disable-next-line import/no-extraneous-dependencies
 import { createStore, combineReducers } from 'redux'
 import ReduxStore, { reducer as uppy } from '..'
 

+ 3 - 7
packages/@uppy/thumbnail-generator/types/index.d.ts

@@ -2,19 +2,15 @@ import type { PluginOptions, UIPlugin } from '@uppy/core'
 
 import ThumbnailGeneratorLocale from './generatedLocale'
 
-declare module ThumbnailGenerator {
-  interface ThumbnailGeneratorOptions extends PluginOptions {
+interface ThumbnailGeneratorOptions extends PluginOptions {
     thumbnailWidth?: number,
     thumbnailHeight?: number,
-    thumbnailType?: string, 
+    thumbnailType?: string,
     waitForThumbnailsBeforeUpload?: boolean,
     lazy?: boolean,
     locale?: ThumbnailGeneratorLocale,
-  }
 }
 
-declare class ThumbnailGenerator extends UIPlugin<
-  ThumbnailGenerator.ThumbnailGeneratorOptions
-> {}
+declare class ThumbnailGenerator extends UIPlugin<ThumbnailGeneratorOptions> {}
 
 export default ThumbnailGenerator

+ 1 - 1
packages/@uppy/thumbnail-generator/types/index.test-d.ts

@@ -1,2 +1,2 @@
-import ThumbnailGenerator = require('../')
+// import ThumbnailGenerator from '..'
 // TODO implement

+ 9 - 10
packages/@uppy/transloadit/types/index.d.ts

@@ -1,25 +1,24 @@
 import type { PluginOptions, UppyFile, BasePlugin } from '@uppy/core'
 import TransloaditLocale from './generatedLocale'
 
-declare module Transloadit {
-  interface AssemblyParameters {
+interface AssemblyParameters {
     auth: {
       key: string,
       expires?: string
     }
     template_id?: string
-    steps?: { [step: string]: object }
+    steps?: { [step: string]: Record<string, unknown> }
     notify_url?: string
     fields?: { [name: string]: number | string }
   }
 
-  interface AssemblyOptions {
+interface AssemblyOptions {
     params: AssemblyParameters
     fields?: { [name: string]: number | string }
     signature?: string
   }
 
-  interface TransloaditOptionsBase extends PluginOptions {
+interface TransloaditOptionsBase extends PluginOptions {
     service?: string
     errorReporting?: boolean
     waitForEncoding?: boolean
@@ -28,19 +27,19 @@ declare module Transloadit {
     alwaysRunAssembly?: boolean
     locale?: TransloaditLocale
     limit?: number
-  }
+}
 
-  // Either have a getAssemblyOptions() that returns an AssemblyOptions, *or* have them embedded in the options
-  type TransloaditOptions = TransloaditOptionsBase &
+// Either have a getAssemblyOptions() that returns an AssemblyOptions, *or* have them embedded in the options
+type TransloaditOptions = TransloaditOptionsBase &
     (
       | {
           getAssemblyOptions?: (file: UppyFile) => AssemblyOptions | Promise<AssemblyOptions>
         }
       | AssemblyOptions)
-}
 
-declare class Transloadit extends BasePlugin<Transloadit.TransloaditOptions> {
+declare class Transloadit extends BasePlugin<TransloaditOptions> {
   static COMPANION: string
+
   static COMPANION_PATTERN: RegExp
 }
 

+ 10 - 10
packages/@uppy/transloadit/types/index.test-d.ts

@@ -1,13 +1,13 @@
 import { expectError, expectType } from 'tsd'
 import Uppy from '@uppy/core'
 import type { UppyFile } from '@uppy/core'
-import Transloadit from '../'
+import Transloadit from '..'
 
 expectType<string>(Transloadit.COMPANION)
 expectType<RegExp>(Transloadit.COMPANION_PATTERN)
 
 const validParams = {
-  auth: { key: 'not so secret key' }
+  auth: { key: 'not so secret key' },
 }
 
 {
@@ -22,8 +22,8 @@ const validParams = {
     importFromUploadURLs: false,
     params: {
       auth: { key: 'abc' },
-      steps: {}
-    }
+      steps: {},
+    },
   })
 }
 
@@ -46,22 +46,22 @@ const validParams = {
   expectError(
     uppy.use(Transloadit, {
       params: {
-        auth: { key: null }
-      }
+        auth: { key: null },
+      },
     })
   )
   expectError(
     uppy.use(Transloadit, {
       params: {
         auth: { key: 'abc' },
-        steps: 'test'
-      }
+        steps: 'test',
+      },
     })
   )
   uppy.use(Transloadit, {
     params: {
       auth: { key: 'abc' },
-      steps: { name: {} }
-    }
+      steps: { name: {} },
+    },
   })
 }

+ 2 - 4
packages/@uppy/tus/types/index.d.ts

@@ -1,7 +1,6 @@
 import type { PluginOptions, BasePlugin } from '@uppy/core'
 import type { UploadOptions } from 'tus-js-client'
 
-declare module Tus {
   type TusUploadOptions = Pick<UploadOptions, Exclude<keyof UploadOptions,
     | 'fingerprint'
     | 'metadata'
@@ -13,14 +12,13 @@ declare module Tus {
     | 'uploadSize'
   >>
 
-  export interface TusOptions extends PluginOptions, TusUploadOptions {
+export interface TusOptions extends PluginOptions, TusUploadOptions {
     metaFields?: string[] | null
     limit?: number
     useFastRemoteRetry?: boolean
     withCredentials?: boolean
   }
-}
 
-declare class Tus extends BasePlugin<Tus.TusOptions> {}
+declare class Tus extends BasePlugin<TusOptions> {}
 
 export default Tus

+ 1 - 1
packages/@uppy/tus/types/index.test-d.ts

@@ -1 +1 @@
-import Tus = require('../')
+// import Tus from '../'

+ 2 - 4
packages/@uppy/unsplash/types/index.d.ts

@@ -1,14 +1,12 @@
 import type { PluginOptions, UIPlugin, PluginTarget } from '@uppy/core'
 import type { RequestClientOptions } from '@uppy/companion-client'
 
-declare module Unsplash {
-  interface UnsplashOptions extends PluginOptions, RequestClientOptions {
+interface UnsplashOptions extends PluginOptions, RequestClientOptions {
     replaceTargetContent?: boolean
     target?: PluginTarget
     title?: string
-  }
 }
 
-declare class Unsplash extends UIPlugin<Unsplash.UnsplashOptions> {}
+declare class Unsplash extends UIPlugin<UnsplashOptions> {}
 
 export default Unsplash

+ 1 - 1
packages/@uppy/unsplash/types/index.test-d.ts

@@ -1,2 +1,2 @@
-import Unsplash = require('../')
+// import Unsplash from '../'
 // TODO implement

+ 2 - 4
packages/@uppy/url/types/index.d.ts

@@ -2,15 +2,13 @@ import type { PluginOptions, UIPlugin, PluginTarget } from '@uppy/core'
 import type { RequestClientOptions } from '@uppy/companion-client'
 import UrlLocale from './generatedLocale'
 
-declare module Url {
-  export interface UrlOptions extends PluginOptions, RequestClientOptions {
+export interface UrlOptions extends PluginOptions, RequestClientOptions {
     replaceTargetContent?: boolean
     target?: PluginTarget
     title?: string
     locale?: UrlLocale
-  }
 }
 
-declare class Url extends UIPlugin<Url.UrlOptions> {}
+declare class Url extends UIPlugin<UrlOptions> {}
 
 export default Url

+ 1 - 1
packages/@uppy/url/types/index.test-d.ts

@@ -1,2 +1,2 @@
-import Url = require('../')
+// import Url from '../'
 // TODO implement

+ 16 - 8
packages/@uppy/utils/types/index.d.ts

@@ -10,8 +10,10 @@ declare module '@uppy/utils/lib/Translator' {
 
   class Translator {
     constructor (opts: Translator.Locale | Translator.Locale[])
-    translate (key: string, options: object): string
-    translateArray (key: string, options: object): any[]
+
+    translate (key: string, options: Record<string, unknown>): string
+
+    translateArray (key: string, options: Record<string, unknown>): any[]
   }
 
   export = Translator
@@ -28,7 +30,9 @@ declare module '@uppy/utils/lib/EventTracker' {
 
   class EventTracker {
     constructor (emitter: EventTracker.Emitter)
+
     on (event: string, handler: EventTracker.EventHandler): void
+
     remove (): void
   }
 
@@ -38,7 +42,9 @@ declare module '@uppy/utils/lib/EventTracker' {
 declare module '@uppy/utils/lib/ProgressTimeout' {
   class ProgressTimeout {
     constructor (timeout: number, timeoutHandler: () => void)
+
     progress (): void
+
     done (): void
   }
   export = ProgressTimeout
@@ -59,10 +65,12 @@ declare module '@uppy/utils/lib/RateLimitedQueue' {
 
   export class RateLimitedQueue {
     constructor(limit: number)
+
     run(
       fn: () => RateLimitedQueue.AbortFunction,
       queueOptions?: RateLimitedQueue.QueueOptions
     ): RateLimitedQueue.QueueEntry
+
     wrapPromiseFunction(
       fn: () => RateLimitedQueue.PromiseFunction,
       queueOptions?: RateLimitedQueue.QueueOptions
@@ -107,7 +115,7 @@ declare module '@uppy/utils/lib/emitSocketProgress' {
   }
 
   function emitSocketProgress (
-    uploader: object,
+    uploader: unknown,
     progressData: ProgressData,
     file: UppyUtils.UppyFile
   ): void
@@ -140,7 +148,7 @@ declare module '@uppy/utils/lib/getBytesRemaining' {
 }
 
 declare module '@uppy/utils/lib/getETA' {
-  function getETA (progress: object): number
+  function getETA (progress: unknown): number
   export = getETA
 }
 
@@ -231,7 +239,7 @@ declare module '@uppy/utils/lib/toArray' {
 declare module '@uppy/utils/lib/getDroppedFiles' {
   function getDroppedFiles (
     dataTransfer: DataTransfer,
-    options?: object
+    options?: Record<string, unknown>
   ): Promise<File[]>
   export = getDroppedFiles
 }
@@ -264,7 +272,7 @@ declare module '@uppy/utils' {
     remote?: {
       host: string
       url: string
-      body?: object
+      body?: Record<string, unknown>
     }
     size: number
     source?: string
@@ -276,8 +284,8 @@ declare module '@uppy/utils' {
     }
   }
   export interface Store {
-    getState (): object
-    setState (patch: object): void
+    getState (): Record<string, unknown>
+    setState (patch: Record<string, unknown>): void
     subscribe (listener: any): () => void
   }
 }

+ 6 - 6
packages/@uppy/vue/types/dashboard-modal.d.ts

@@ -1,13 +1,13 @@
-import Vue from 'vue';
-import type { Uppy, UIPlugin, BasePlugin } from '@uppy/core';
-import type DashboardPlugin from '@uppy/dashboard';
+import Vue from 'vue'
+import type { Uppy, UIPlugin, BasePlugin } from '@uppy/core'
+import type DashboardPlugin from '@uppy/dashboard'
 
 interface Data {
     plugin: DashboardPlugin;
 }
 interface Props {
     uppy: Uppy;
-    props: Object;
+    props: Record<string, unknown>;
     plugins: Array<UIPlugin | BasePlugin>
     open: boolean;
 }
@@ -15,5 +15,5 @@ interface Methods {
     installPlugin(): void;
     uninstallPlugin(uppy: Uppy): void;
 }
-declare const _default: import("vue/types/vue").ExtendedVue<Vue, Data, Methods, unknown, Props>;
-export default _default;
+declare const exports: import('vue/types/vue').ExtendedVue<Vue, Data, Methods, unknown, Props>
+export default exports

+ 6 - 6
packages/@uppy/vue/types/dashboard.d.ts

@@ -1,18 +1,18 @@
-import Vue from 'vue';
-import type { Uppy, UIPlugin, BasePlugin } from '@uppy/core';
-import type DashboardPlugin from '@uppy/dashboard';
+import Vue from 'vue'
+import type { Uppy, UIPlugin, BasePlugin } from '@uppy/core'
+import type DashboardPlugin from '@uppy/dashboard'
 
 interface Data {
     plugin: DashboardPlugin;
 }
 interface Props {
     uppy: Uppy;
-    props: Object;
+    props: Record<string, unknown>;
     plugins: Array<UIPlugin | BasePlugin>
 }
 interface Methods {
     installPlugin(): void;
     uninstallPlugin(uppy: Uppy): void;
 }
-declare const _default: import("vue/types/vue").ExtendedVue<Vue, Data, Methods, unknown, Props>;
-export default _default;
+declare const exports: import('vue/types/vue').ExtendedVue<Vue, Data, Methods, unknown, Props>
+export default exports

+ 5 - 5
packages/@uppy/vue/types/drag-drop.d.ts

@@ -1,17 +1,17 @@
-import Vue from 'vue';
-import type { Uppy, UIPlugin, BasePlugin } from '@uppy/core';
+import Vue from 'vue'
+import type { Uppy, UIPlugin, BasePlugin } from '@uppy/core'
 
 interface Data {
     plugin: UIPlugin | BasePlugin;
 }
 interface Props {
     uppy: Uppy;
-    props: Object;
+    props: Record<string, unknown>;
 }
 interface Methods {
     installPlugin(): void;
     uninstallPlugin(uppy: Uppy): void;
 }
-declare const _default: import("vue/types/vue").ExtendedVue<Vue, Data, Methods, unknown, Props>;
+declare const exports: import('vue/types/vue').ExtendedVue<Vue, Data, Methods, unknown, Props>
 
-export default _default;
+export default exports

+ 5 - 5
packages/@uppy/vue/types/index.d.ts

@@ -1,5 +1,5 @@
-export { default as Dashboard } from './dashboard';
-export { default as DashboardModal } from './dashboard-modal';
-export { default as DragDrop } from './drag-drop';
-export { default as ProgressBar } from './progress-bar';
-export { default as StatusBar } from './status-bar';
+export { default as Dashboard } from './dashboard'
+export { default as DashboardModal } from './dashboard-modal'
+export { default as DragDrop } from './drag-drop'
+export { default as ProgressBar } from './progress-bar'
+export { default as StatusBar } from './status-bar'

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini