Parcourir la source

Upgrade linting to 2.0.0-0 (#3280)

* Upgrade linting to 2.0.0-0

* Adjust so we can pass without error

* Fix linting

* Update header-blacklist.js

* Update index.js

* Update Uppy.js

* Update Components.js

* Update StatusBar.js

* Update Assembly.js

* Upgrade to linting 2.0.0 (final release)
Kevin van Zonneveld il y a 3 ans
Parent
commit
bfe659820e
70 fichiers modifiés avec 161 ajouts et 163 suppressions
  1. 1 0
      .eslintignore
  2. 1 1
      .eslintrc.js
  3. 0 1
      bin/after-version-bump.js
  4. 7 7
      bin/build-bundle.js
  5. 2 4
      bin/build-css.js
  6. 2 2
      bin/build-lib.js
  7. 1 1
      bin/upload-to-cdn.js
  8. 1 1
      examples/redux/main.js
  9. 4 4
      examples/transloadit-textarea/main.js
  10. 4 3
      package.json
  11. 1 1
      packages/@uppy/aws-s3-multipart/src/MultipartUploader.js
  12. 1 1
      packages/@uppy/aws-s3-multipart/src/index.js
  13. 4 4
      packages/@uppy/aws-s3-multipart/src/index.test.js
  14. 1 1
      packages/@uppy/aws-s3/src/index.js
  15. 1 1
      packages/@uppy/companion-client/src/Provider.js
  16. 1 1
      packages/@uppy/companion-client/src/Socket.test.js
  17. 1 1
      packages/@uppy/companion/src/companion.js
  18. 1 1
      packages/@uppy/companion/src/server/Uploader.js
  19. 1 1
      packages/@uppy/companion/src/server/controllers/s3.js
  20. 1 2
      packages/@uppy/companion/src/server/header-blacklist.js
  21. 1 1
      packages/@uppy/companion/src/server/helpers/request.js
  22. 1 1
      packages/@uppy/companion/src/server/provider/drive/index.js
  23. 1 2
      packages/@uppy/companion/src/server/provider/unsplash/index.js
  24. 1 1
      packages/@uppy/companion/src/server/s3-client.js
  25. 1 1
      packages/@uppy/companion/src/standalone/index.js
  26. 4 5
      packages/@uppy/core/src/Uppy.js
  27. 11 11
      packages/@uppy/core/src/Uppy.test.js
  28. 1 1
      packages/@uppy/dashboard/src/components/FileList.js
  29. 1 1
      packages/@uppy/dashboard/src/components/PickerPanelTopBar.js
  30. 2 2
      packages/@uppy/dashboard/src/index.test.js
  31. 1 1
      packages/@uppy/golden-retriever/src/index.js
  32. 2 2
      packages/@uppy/image-editor/src/Editor.js
  33. 1 1
      packages/@uppy/image-editor/src/index.js
  34. 3 3
      packages/@uppy/provider-views/src/Browser.js
  35. 1 1
      packages/@uppy/provider-views/src/Item/index.js
  36. 1 1
      packages/@uppy/provider-views/src/ProviderView/ProviderView.js
  37. 1 1
      packages/@uppy/provider-views/src/SearchProviderView/SearchProviderView.js
  38. 1 1
      packages/@uppy/provider-views/src/SharedHandler.js
  39. 1 1
      packages/@uppy/react/src/getHTMLProps.js
  40. 5 6
      packages/@uppy/status-bar/src/Components.js
  41. 4 7
      packages/@uppy/status-bar/src/StatusBar.js
  42. 1 1
      packages/@uppy/status-bar/src/index.js
  43. 1 1
      packages/@uppy/store-default/src/index.js
  44. 1 1
      packages/@uppy/thumbnail-generator/src/index.test.js
  45. 1 2
      packages/@uppy/transloadit/src/Assembly.js
  46. 2 2
      packages/@uppy/transloadit/src/AssemblyOptions.js
  47. 1 1
      packages/@uppy/transloadit/src/AssemblyOptions.test.js
  48. 1 1
      packages/@uppy/transloadit/src/index.js
  49. 4 4
      packages/@uppy/transloadit/types/index.test-d.ts
  50. 1 1
      packages/@uppy/tus/src/index.js
  51. 9 9
      packages/@uppy/utils/src/Translator.test.js
  52. 3 3
      packages/@uppy/utils/src/generateFileID.test.js
  53. 1 1
      packages/@uppy/utils/src/getDroppedFiles/utils/webkitGetAsEntryApi/getFilesAndDirectoriesFromDirectory.js
  54. 2 2
      packages/@uppy/utils/src/getDroppedFiles/utils/webkitGetAsEntryApi/index.js
  55. 4 4
      packages/@uppy/utils/src/getSocketHost.test.js
  56. 1 1
      packages/@uppy/utils/src/settle.js
  57. 2 2
      packages/@uppy/utils/src/settle.test.js
  58. 1 1
      packages/@uppy/webcam/src/formatSeconds.js
  59. 7 7
      packages/@uppy/webcam/src/index.test.js
  60. 1 1
      packages/@uppy/xhr-upload/src/index.js
  61. 2 2
      test/endtoend/providers/helper.js
  62. 1 1
      test/endtoend/providers/main.js
  63. 1 1
      test/endtoend/providers/provider.instagram.test.js
  64. 2 2
      test/endtoend/thumbnails/test.js
  65. 1 1
      test/endtoend/transloadit-assembly-options/test.js
  66. 1 1
      test/endtoend/transloadit/test.js
  67. 1 1
      test/resources/DeepFrozenStore.js
  68. 3 3
      website/inject.js
  69. 3 4
      website/themes/uppy/source/js/common.js
  70. 21 13
      yarn.lock

+ 1 - 0
.eslintignore

@@ -19,3 +19,4 @@ website/src/_posts/2021-03-*.md
 website/src/_posts/2021-04-*.md
 website/src/_posts/2021-05-*.md
 website/src/_posts/2021-06-*.md
+website/src/docs/react-dashboard.md

+ 1 - 1
.eslintrc.js

@@ -43,7 +43,6 @@ module.exports = {
   rules: {
     // transloadit rules we are actually ok with in the uppy repo
     'import/extensions': 'off',
-    'no-await-in-loop': 'off',
     'object-shorthand': ['error', 'always'],
     'strict': 'off',
     'key-spacing': 'off',
@@ -79,6 +78,7 @@ module.exports = {
     'global-require': ['warn'],
     'import/no-unresolved': ['warn'],
     'import/order': ['warn'],
+    'max-classes-per-file': ['warn'],
     'no-mixed-operators': ['warn'],
     'no-param-reassign': ['warn'],
     'no-redeclare': ['warn'],

+ 0 - 1
bin/after-version-bump.js

@@ -42,7 +42,6 @@ async function updateVersions (files, packageName) {
   console.log('replacing', replacements, 'in', files.length, 'files')
 
   for (const f of files) {
-    // eslint-disable-next-line no-await-in-loop
     await replaceInFile(f, replacements)
   }
 }

+ 7 - 7
bin/build-bundle.js

@@ -96,17 +96,17 @@ const methods = [
   buildBundle(
     './packages/uppy/index.js',
     './packages/uppy/dist/uppy.js',
-    { standalone: 'Uppy' }
+    { standalone: 'Uppy' },
   ).then(minifyBundle),
   buildBundle(
     './packages/uppy/bundle.js',
     './packages/uppy/dist/uppy.legacy.js',
-    { standalone: 'Uppy (with polyfills)' }
+    { standalone: 'Uppy (with polyfills)' },
   ).then(transpileDownForIE),
   buildBundle(
     './packages/@uppy/robodog/bundle.js',
     './packages/@uppy/robodog/dist/robodog.js',
-    { standalone: 'Robodog' }
+    { standalone: 'Robodog' },
   ).then(minifyBundle),
 ]
 
@@ -118,8 +118,8 @@ glob.sync(localePackagePath).forEach((localePath) => {
     buildBundle(
       `./packages/@uppy/locales/src/${localeName}.js`,
       `./packages/@uppy/locales/dist/${localeName}.min.js`,
-      { minify: true }
-    )
+      { minify: true },
+    ),
   )
 })
 
@@ -127,8 +127,8 @@ glob.sync(localePackagePath).forEach((localePath) => {
 methods.push(
   fs.promises.copyFile(
     `${__dirname}/../BUNDLE-README.md`,
-    `./packages/uppy/dist/README.md`
-  )
+    `./packages/uppy/dist/README.md`,
+  ),
 )
 
 Promise.all(methods).then(() => {

+ 2 - 4
bin/build-css.js

@@ -23,7 +23,6 @@ function handleErr (err) {
 async function compileCSS () {
   const files = await glob('packages/{,@uppy/}*/src/style.scss')
 
-  /* eslint-disable no-await-in-loop */
   for (const file of files) {
     const importedFiles = new Set()
     const scssResult = await renderScss({
@@ -78,7 +77,7 @@ async function compileCSS () {
     await writeFile(outfile, postcssResult.css)
     console.info(
       chalk.green('✓ Built Uppy CSS:'),
-      chalk.magenta(path.relative(cwd, outfile))
+      chalk.magenta(path.relative(cwd, outfile)),
     )
 
     const minifiedResult = await postcss([
@@ -90,10 +89,9 @@ async function compileCSS () {
     await writeFile(outfile.replace(/\.css$/, '.min.css'), minifiedResult.css)
     console.info(
       chalk.green('✓ Minified Bundle CSS:'),
-      chalk.magenta(path.relative(cwd, outfile).replace(/\.css$/, '.min.css'))
+      chalk.magenta(path.relative(cwd, outfile).replace(/\.css$/, '.min.css')),
     )
   }
-  /* eslint-enable no-await-in-loop */
 }
 
 compileCSS().then(() => {

+ 2 - 2
bin/build-lib.js

@@ -34,7 +34,7 @@ async function buildLib () {
   const metaMtime = Math.max(...metaMtimes)
 
   const files = await glob(SOURCE)
-  /* eslint-disable no-await-in-loop, no-continue */
+  /* eslint-disable no-continue */
   for (const file of files) {
     if (IGNORE.test(file)) {
       continue
@@ -60,7 +60,7 @@ async function buildLib () {
     ])
     console.log(chalk.green('Compiled lib:'), chalk.magenta(libFile))
   }
-  /* eslint-enable no-await-in-loop, no-continue */
+  /* eslint-enable no-continue */
 }
 
 console.log('Using Babel version:', require('@babel/core/package.json').version)

+ 1 - 1
bin/upload-to-cdn.js

@@ -85,7 +85,7 @@ async function getLocalDistFiles (packagePath) {
     files.map(async (f) => [
       f,
       await readFile(path.join(packagePath, 'dist', f)),
-    ])
+    ]),
   )
 
   return new Map(entries)

+ 1 - 1
examples/redux/main.js

@@ -25,7 +25,7 @@ const reducer = combineReducers({
 
 let enhancer = applyMiddleware(
   uppyReduxStore.middleware(),
-  logger
+  logger,
 )
 if (typeof __REDUX_DEVTOOLS_EXTENSION__ !== 'undefined') {
   // eslint-disable-next-line no-undef

+ 4 - 4
examples/transloadit-textarea/main.js

@@ -26,7 +26,7 @@ class MarkdownTextarea {
     this.uploadLine.classList.add('mdtxt-upload')
 
     this.uploadLine.appendChild(
-      document.createTextNode('Upload an attachment')
+      document.createTextNode('Upload an attachment'),
     )
   }
 
@@ -111,7 +111,7 @@ class MarkdownTextarea {
       // Was cancelled
       if (result == null) return
       this.insertAttachments(
-        this.matchFilesAndThumbs(result.results)
+        this.matchFilesAndThumbs(result.results),
       )
     }).catch((err) => {
       console.error(err)
@@ -130,7 +130,7 @@ class MarkdownTextarea {
       // Was cancelled
       if (result == null) return
       this.insertAttachments(
-        this.matchFilesAndThumbs(result.results)
+        this.matchFilesAndThumbs(result.results),
       )
     }).catch((err) => {
       console.error(err)
@@ -140,7 +140,7 @@ class MarkdownTextarea {
 }
 
 const textarea = new MarkdownTextarea(
-  document.querySelector('#new textarea')
+  document.querySelector('#new textarea'),
 )
 textarea.install()
 

+ 4 - 3
package.json

@@ -68,17 +68,18 @@
     "deep-freeze": "^0.0.1",
     "disc": "^1.3.3",
     "eslint": "^8.0.0",
-    "eslint-config-transloadit": "^1.2.0",
+    "eslint-config-transloadit": "^2.0.0",
     "eslint-plugin-compat": "^3.8.0",
-    "eslint-plugin-import": "^2.22.1",
+    "eslint-plugin-import": "^2.25.2",
     "eslint-plugin-jest": "^25.0.0",
     "eslint-plugin-jsdoc": "^36.0.0",
     "eslint-plugin-jsx-a11y": "^6.4.1",
     "eslint-plugin-markdown": "^2.2.0",
     "eslint-plugin-node": "^11.1.0",
     "eslint-plugin-prefer-import": "^0.0.1",
-    "eslint-plugin-promise": "^5.1.0",
+    "eslint-plugin-promise": "^4.3.1",
     "eslint-plugin-react": "^7.22.0",
+    "eslint-plugin-react-hooks": "^4.2.0",
     "events.once": "^2.0.2",
     "exorcist": "^2.0.0",
     "fakefile": "^1.0.0",

+ 1 - 1
packages/@uppy/aws-s3-multipart/src/MultipartUploader.js

@@ -254,7 +254,7 @@ class MultipartUploader {
 
     if (typeof result?.presignedUrls !== 'object') {
       throw new TypeError(
-        'AwsS3/Multipart: Got incorrect result from `prepareUploadParts()`, expected an object `{ presignedUrls }`.'
+        'AwsS3/Multipart: Got incorrect result from `prepareUploadParts()`, expected an object `{ presignedUrls }`.',
       )
     }
 

+ 1 - 1
packages/@uppy/aws-s3-multipart/src/index.js

@@ -294,7 +294,7 @@ module.exports = class AwsS3Multipart extends BasePlugin {
           protocol: 's3-multipart',
           size: file.data.size,
           metadata: file.meta,
-        }
+        },
       ).then((res) => {
         this.uppy.setFileState(file.id, { serverToken: res.token })
         file = this.uppy.getFile(file.id)

+ 4 - 4
packages/@uppy/aws-s3-multipart/src/index.test.js

@@ -28,7 +28,7 @@ describe('AwsS3Multipart', () => {
       const opts = {}
 
       expect(() => awsS3Multipart.opts.createMultipartUpload(file)).toThrow(
-        err
+        err,
       )
       expect(() => awsS3Multipart.opts.listParts(file, opts)).toThrow(err)
       expect(() => awsS3Multipart.opts.completeMultipartUpload(file, opts)).toThrow(err)
@@ -68,7 +68,7 @@ describe('AwsS3Multipart', () => {
 
     it('Calls the prepareUploadParts function totalChunks / limit times', async () => {
       const scope = nock(
-        'https://bucket.s3.us-east-2.amazonaws.com'
+        'https://bucket.s3.us-east-2.amazonaws.com',
       ).defaultReplyHeaders({
         'access-control-allow-method': 'PUT',
         'access-control-allow-origin': '*',
@@ -103,7 +103,7 @@ describe('AwsS3Multipart', () => {
       await core.upload()
 
       expect(
-        awsS3Multipart.opts.prepareUploadParts.mock.calls.length
+        awsS3Multipart.opts.prepareUploadParts.mock.calls.length,
       ).toEqual(1)
 
       scope.done()
@@ -111,7 +111,7 @@ describe('AwsS3Multipart', () => {
 
     it('Calls prepareUploadParts with a Math.ceil(limit / 2) minimum, instead of one at a time for the remaining chunks after the first limit batch', async () => {
       const scope = nock(
-        'https://bucket.s3.us-east-2.amazonaws.com'
+        'https://bucket.s3.us-east-2.amazonaws.com',
       ).defaultReplyHeaders({
         'access-control-allow-method': 'PUT',
         'access-control-allow-origin': '*',

+ 1 - 1
packages/@uppy/aws-s3/src/index.js

@@ -140,7 +140,7 @@ module.exports = class AwsS3 extends BasePlugin {
     const metadata = Object.fromEntries(
       this.opts.metaFields
         .filter(key => file.meta[key] != null)
-        .map(key => [`metadata[${key}]`, file.meta[key].toString()])
+        .map(key => [`metadata[${key}]`, file.meta[key].toString()]),
     )
 
     const query = new URLSearchParams({ filename, type, ...metadata })

+ 1 - 1
packages/@uppy/companion-client/src/Provider.js

@@ -29,7 +29,7 @@ module.exports = class Provider extends RequestClient {
 
         if (this.companionKeysParams) {
           authHeaders['uppy-credentials-params'] = btoa(
-            JSON.stringify({ params: this.companionKeysParams })
+            JSON.stringify({ params: this.companionKeysParams }),
           )
         }
         return { ...headers, ...authHeaders }

+ 1 - 1
packages/@uppy/companion-client/src/Socket.test.js

@@ -43,7 +43,7 @@ describe('Socket', () => {
     expect(
       new UppySocket({
         target: 'foo',
-      }) instanceof UppySocket
+      }) instanceof UppySocket,
     )
   })
 

+ 1 - 1
packages/@uppy/companion/src/companion.js

@@ -237,7 +237,7 @@ const validateConfig = (companionOptions) => {
     fs.accessSync(`${companionOptions.filePath}`, fs.R_OK | fs.W_OK) // eslint-disable-line no-bitwise
   } catch (err) {
     throw new Error(
-      `No access to "${companionOptions.filePath}". Please ensure the directory exists and with read/write permissions.`
+      `No access to "${companionOptions.filePath}". Please ensure the directory exists and with read/write permissions.`,
     )
   }
 

+ 1 - 1
packages/@uppy/companion/src/server/Uploader.js

@@ -403,7 +403,7 @@ class Uploader {
     logger.debug(
       `${combinedBytes} ${bytesTotal} ${formattedPercentage}%`,
       'uploader.total.progress',
-      this.shortToken
+      this.shortToken,
     )
 
     if (this._paused || this.uploadStopped) {

+ 1 - 1
packages/@uppy/companion/src/server/controllers/s3.js

@@ -248,7 +248,7 @@ module.exports = function s3 (config) {
           Body: '',
           Expires: config.expires,
         })
-      })
+      }),
     ).then((urls) => {
       const presignedUrls = Object.create(null)
       for (let index = 0; index < partNumbersArray.length; index++) {

+ 1 - 2
packages/@uppy/companion/src/server/header-blacklist.js

@@ -40,8 +40,7 @@ const forbiddenRegex = [/^proxy-.*$/, /^sec-.*$/]
  */
 const isForbiddenHeader = (header) => {
   const headerLower = header.toLowerCase()
-  const forbidden
-    = forbiddenNames.indexOf(headerLower) >= 0
+  const forbidden = forbiddenNames.indexOf(headerLower) >= 0
     || forbiddenRegex.findIndex((regex) => regex.test(headerLower)) >= 0
 
   if (forbidden) {

+ 1 - 1
packages/@uppy/companion/src/server/helpers/request.js

@@ -98,7 +98,7 @@ module.exports.getRedirectEvaluator = (rawRequestURL, blockPrivateIPs) => {
     const shouldRedirect = redirectURL.protocol === requestURL.protocol
     if (!shouldRedirect) {
       logger.info(
-        `blocking redirect from ${requestURL} to ${redirectURL}`, 'redirect.protection'
+        `blocking redirect from ${requestURL} to ${redirectURL}`, 'redirect.protection',
       )
     }
 

+ 1 - 1
packages/@uppy/companion/src/server/provider/drive/index.js

@@ -173,7 +173,7 @@ class Drive extends Provider {
       sharedDrives,
       directory,
       query,
-      isRoot && !query.cursor // we can only show it on the first page request, or else we will have duplicates of it
+      isRoot && !query.cursor, // we can only show it on the first page request, or else we will have duplicates of it
     )
   }
 

+ 1 - 2
packages/@uppy/companion/src/server/provider/unsplash/index.js

@@ -142,8 +142,7 @@ class Unsplash extends SearchProvider {
   error (err, resp) {
     if (resp) {
       const fallbackMessage = `request to Unsplash returned ${resp.statusCode}`
-      const msg
-        = resp.body && resp.body.errors ? `${resp.body.errors}` : fallbackMessage
+      const msg = resp.body && resp.body.errors ? `${resp.body.errors}` : fallbackMessage
       return new ProviderApiError(msg, resp.statusCode)
     }
 

+ 1 - 1
packages/@uppy/companion/src/server/s3-client.js

@@ -35,7 +35,7 @@ module.exports = (companionOptions) => {
       s3ClientOptions.credentials = new AWS.Credentials(
         s3ProviderOptions.key,
         s3ProviderOptions.secret,
-        s3ProviderOptions.sessionToken
+        s3ProviderOptions.sessionToken,
       )
     }
     s3Client = new S3(s3ClientOptions)

+ 1 - 1
packages/@uppy/companion/src/standalone/index.js

@@ -119,7 +119,7 @@ module.exports = function server (inputCompanionOptions = {}) {
   if (companionOptions.redisUrl) {
     const RedisStore = require('connect-redis')(session)
     const redisClient = redis.client(
-      merge({ url: companionOptions.redisUrl }, companionOptions.redisOptions)
+      merge({ url: companionOptions.redisUrl }, companionOptions.redisOptions),
     )
     sessionOptions.store = new RedisStore({ client: redisClient })
   }

+ 4 - 5
packages/@uppy/core/src/Uppy.js

@@ -419,7 +419,7 @@ class Uppy {
     const inProgressFiles = files.filter(({ progress }) => !progress.uploadComplete && progress.uploadStarted)
     const newFiles =  files.filter((file) => !file.progress.uploadStarted)
     const startedFiles = files.filter(
-      file => file.progress.uploadStarted || file.progress.preprocess || file.progress.postprocess
+      file => file.progress.uploadStarted || file.progress.preprocess || file.progress.postprocess,
     )
     const uploadStartedFiles = files.filter((file) => file.progress.uploadStarted)
     const pausedFiles = files.filter((file) => file.isPaused)
@@ -1305,10 +1305,9 @@ class Uppy {
   }
 
   updateOnlineStatus () {
-    const online
-      = typeof window.navigator.onLine !== 'undefined'
-        ? window.navigator.onLine
-        : true
+    const online = typeof window.navigator.onLine !== 'undefined'
+      ? window.navigator.onLine
+      : true
     if (!online) {
       this.emit('is-offline')
       this.info(this.i18n('noInternetConnection'), 'error', 0)

+ 11 - 11
packages/@uppy/core/src/Uppy.test.js

@@ -476,12 +476,12 @@ describe('src/Core', () => {
 
         expect(postprocessor1.mock.calls[0][0].length).toEqual(1)
         expect(postprocessor1.mock.calls[0][0][0].substring(0, 17)).toEqual(
-          fileId.substring(0, 17)
+          fileId.substring(0, 17),
         )
 
         expect(postprocessor2.mock.calls[0][0].length).toEqual(1)
         expect(postprocessor2.mock.calls[0][0][0].substring(0, 17)).toEqual(
-          fileId.substring(0, 17)
+          fileId.substring(0, 17),
         )
       })
     })
@@ -675,7 +675,7 @@ describe('src/Core', () => {
           },
         })
       }).toThrow(
-        "Cannot add the duplicate file 'foo.jpg', it already exists"
+        "Cannot add the duplicate file 'foo.jpg', it already exists",
       )
       expect(core.getFiles().length).toEqual(1)
     })
@@ -717,7 +717,7 @@ describe('src/Core', () => {
           data: new File([sampleImage], { type: 'image/jpeg' }),
         })
       }).toThrow(
-        'Cannot add the file because onBeforeFileAdded returned false.'
+        'Cannot add the file because onBeforeFileAdded returned false.',
       )
       expect(core.getFiles().length).toEqual(0)
     })
@@ -742,7 +742,7 @@ describe('src/Core', () => {
             data: new File([sampleImage], { type: 'image/jpeg' }),
           })
         }).toThrow(
-          /Cannot add more files/
+          /Cannot add more files/,
         )
       })
 
@@ -765,7 +765,7 @@ describe('src/Core', () => {
             data: new File([sampleImage], { type: 'image/jpeg' }),
           })
         }).toThrow(
-          /Cannot add more files/
+          /Cannot add more files/,
         )
       })
 
@@ -956,7 +956,7 @@ describe('src/Core', () => {
 
       await expect(core.upload()).resolves.toBeDefined()
       await expect(core.upload()).rejects.toThrow(
-        /Cannot create a new upload: already uploading\./
+        /Cannot create a new upload: already uploading\./,
       )
     })
 
@@ -1660,7 +1660,7 @@ describe('src/Core', () => {
           data: new File([sampleImage], { type: 'image/jpeg' }),
         })
       }).toThrowError(
-        new Error('foo1.jpg exceeds maximum allowed size of 33 KB')
+        new Error('foo1.jpg exceeds maximum allowed size of 33 KB'),
       )
     })
 
@@ -1696,13 +1696,13 @@ describe('src/Core', () => {
         {
           result: false,
           reason: 'This file is smaller than the allowed size of 293 KB',
-        }
+        },
       )
       expect(validateRestrictions2).toMatchObject(
         {
           result: false,
           reason: 'You can only upload: image/png',
-        }
+        },
       )
     })
 
@@ -1775,7 +1775,7 @@ describe('src/Core', () => {
         {
           value: status,
           writable: true,
-        }
+        },
       )
     }
 

+ 1 - 1
packages/@uppy/dashboard/src/components/FileList.js

@@ -22,7 +22,7 @@ module.exports = (props) => {
   const noFiles = props.totalFileCount === 0
   const dashboardFilesClass = classNames(
     'uppy-Dashboard-files',
-    { 'uppy-Dashboard-files--noFiles': noFiles }
+    { 'uppy-Dashboard-files--noFiles': noFiles },
   )
 
   // It's not great that this is hardcoded!

+ 1 - 1
packages/@uppy/dashboard/src/components/PickerPanelTopBar.js

@@ -50,7 +50,7 @@ function UploadStatus (props) {
     props.isAllErrored,
     props.isAllComplete,
     props.isAllPaused,
-    props.files
+    props.files,
   )
 
   switch (uploadingState) {

+ 2 - 2
packages/@uppy/dashboard/src/index.test.js

@@ -75,7 +75,7 @@ describe('Dashboard', () => {
     })
 
     expect(
-      core.getPlugin('Dashboard').opts.width
+      core.getPlugin('Dashboard').opts.width,
     ).toEqual(300)
   })
 
@@ -95,7 +95,7 @@ describe('Dashboard', () => {
     })
 
     expect(
-      core.getPlugin('Dashboard').i18n('myDevice')
+      core.getPlugin('Dashboard').i18n('myDevice'),
     ).toEqual('Май дивайс')
   })
 

+ 1 - 1
packages/@uppy/golden-retriever/src/index.js

@@ -44,7 +44,7 @@ module.exports = class GoldenRetriever extends BasePlugin {
     this.saveFilesStateToLocalStorage = throttle(
       this.saveFilesStateToLocalStorage.bind(this),
       500,
-      { leading: true, trailing: true }
+      { leading: true, trailing: true },
     )
     this.restoreState = this.restoreState.bind(this)
     this.loadFileBlobsFromServiceWorker = this.loadFileBlobsFromServiceWorker.bind(this)

+ 2 - 2
packages/@uppy/image-editor/src/Editor.js

@@ -15,7 +15,7 @@ module.exports = class Editor extends Component {
     const { opts, storeCropperInstance } = this.props
     this.cropper = new Cropper(
       this.imgElement,
-      opts.cropperOptions
+      opts.cropperOptions,
     )
     storeCropperInstance(this.cropper)
 
@@ -42,7 +42,7 @@ module.exports = class Editor extends Component {
       .toBlob(
         (blob) => save(blob),
         currentImage.type,
-        opts.quality
+        opts.quality,
       )
   }
 

+ 1 - 1
packages/@uppy/image-editor/src/index.js

@@ -103,7 +103,7 @@ module.exports = class ImageEditor extends UIPlugin {
     this.cropper.getCroppedCanvas().toBlob(
       saveBlobCallback,
       currentImage.type,
-      this.opts.quality
+      this.opts.quality,
     )
   }
 

+ 3 - 3
packages/@uppy/provider-views/src/Browser.js

@@ -39,14 +39,14 @@ function Browser (props) {
     <div
       className={classNames(
         'uppy-ProviderBrowser',
-        `uppy-ProviderBrowser-viewType--${viewType}`
+        `uppy-ProviderBrowser-viewType--${viewType}`,
       )}
     >
       <div className="uppy-ProviderBrowser-header">
         <div
           className={classNames(
             'uppy-ProviderBrowser-headerBar',
-            !showBreadcrumbs && 'uppy-ProviderBrowser-headerBar--simple'
+            !showBreadcrumbs && 'uppy-ProviderBrowser-headerBar--simple',
           )}
         >
           {headerComponent}
@@ -100,7 +100,7 @@ function Browser (props) {
               {files.map((file) => {
                 const validated = validateRestrictions(
                   remoteFileObjToLocal(file),
-                  [...uppyFiles, ...currentSelection]
+                  [...uppyFiles, ...currentSelection],
                 )
 
                 return Item({

+ 1 - 1
packages/@uppy/provider-views/src/Item/index.js

@@ -12,7 +12,7 @@ module.exports = (props) => {
     'uppy-ProviderBrowserItem',
     { 'uppy-ProviderBrowserItem--selected': props.isChecked },
     { 'uppy-ProviderBrowserItem--disabled': props.isDisabled },
-    { 'uppy-ProviderBrowserItem--noPreview': itemIconString === 'video' }
+    { 'uppy-ProviderBrowserItem--noPreview': itemIconString === 'video' },
   )
 
   const itemIconEl = <ItemIcon itemIconString={itemIconString} />

+ 1 - 1
packages/@uppy/provider-views/src/ProviderView/ProviderView.js

@@ -103,7 +103,7 @@ module.exports = class ProviderView extends View {
         this.#updateFilesAndFolders(res, files, folders)
         this.plugin.setPluginState({ directories: updatedDirectories })
       },
-      this.handleError
+      this.handleError,
     )
   }
 

+ 1 - 1
packages/@uppy/provider-views/src/SearchProviderView/SearchProviderView.js

@@ -77,7 +77,7 @@ module.exports = class SearchProviderView extends View {
       (res) => {
         this.#updateFilesAndInputMode(res, [])
       },
-      this.handleError
+      this.handleError,
     )
   }
 

+ 1 - 1
packages/@uppy/provider-views/src/SharedHandler.js

@@ -49,7 +49,7 @@ module.exports = class SharedHandler {
         const { uppy } = this.plugin
         const validatedRestrictions = uppy.validateRestrictions(
           remoteFileObjToLocal(item),
-          [...uppy.getFiles(), ...reducedCurrentSelection]
+          [...uppy.getFiles(), ...reducedCurrentSelection],
         )
         if (validatedRestrictions.result) {
           reducedCurrentSelection.push(item)

+ 1 - 1
packages/@uppy/react/src/getHTMLProps.js

@@ -257,7 +257,7 @@ const getHTMLProps = (props) => {
   // Gets all the React props
   return Object.fromEntries(
     Object.entries(props)
-      .filter(([key]) => validHTMLAttribute.test(key) || reactSupportedHtmlAttr.includes(key))
+      .filter(([key]) => validHTMLAttribute.test(key) || reactSupportedHtmlAttr.includes(key)),
   )
 }
 

+ 5 - 6
packages/@uppy/status-bar/src/Components.js

@@ -28,13 +28,12 @@ function UploadBtn (props) {
     {
       'uppy-c-btn-primary': uploadState === statusBarStates.STATE_WAITING,
     },
-    { 'uppy-StatusBar-actionBtn--disabled': isSomeGhost }
+    { 'uppy-StatusBar-actionBtn--disabled': isSomeGhost },
   )
 
-  const uploadBtnText
-    = newFiles && isUploadStarted && !recoveredState
-      ? i18n('uploadXNewFiles', { smart_count: newFiles })
-      : i18n('uploadXFiles', { smart_count: newFiles })
+  const uploadBtnText = newFiles && isUploadStarted && !recoveredState
+    ? i18n('uploadXNewFiles', { smart_count: newFiles })
+    : i18n('uploadXFiles', { smart_count: newFiles })
 
   return (
     <button
@@ -263,7 +262,7 @@ function UploadNewlyAddedFiles (props) {
     'uppy-u-reset',
     'uppy-c-btn',
     'uppy-StatusBar-actionBtn',
-    'uppy-StatusBar-actionBtn--uploadNewlyAdded'
+    'uppy-StatusBar-actionBtn--uploadNewlyAdded',
   )
 
   return (

+ 4 - 7
packages/@uppy/status-bar/src/StatusBar.js

@@ -124,21 +124,18 @@ function StatusBar (props) {
 
   const width = progressValue ?? 100
 
-  const showUploadBtn
-    = !error
+  const showUploadBtn = !error
     && newFiles
     && !isUploadInProgress
     && !isAllPaused
     && allowNewUpload
     && !hideUploadButton
 
-  const showCancelBtn
-    = !hideCancelButton
+  const showCancelBtn = !hideCancelButton
     && uploadState !== STATE_WAITING
     && uploadState !== STATE_COMPLETE
 
-  const showPauseResumeBtn
-    = resumableUploads
+  const showPauseResumeBtn = resumableUploads
     && !hidePauseResumeButton
     && uploadState === STATE_UPLOADING
 
@@ -154,7 +151,7 @@ function StatusBar (props) {
     { 'uppy-Root': isTargetDOMEl },
     'uppy-StatusBar',
     `is-${uploadState}`,
-    { 'has-ghosts': isSomeGhost }
+    { 'has-ghosts': isSomeGhost },
   )
 
   return (

+ 1 - 1
packages/@uppy/status-bar/src/index.js

@@ -134,7 +134,7 @@ module.exports = class StatusBar extends UIPlugin {
         isAllErrored,
         isAllComplete,
         recoveredState,
-        state.files || {}
+        state.files || {},
       ),
       allowNewUpload,
       totalProgress,

+ 1 - 1
packages/@uppy/store-default/src/index.js

@@ -27,7 +27,7 @@ class DefaultStore {
       // Remove the listener.
       this.callbacks.splice(
         this.callbacks.indexOf(listener),
-        1
+        1,
       )
     }
   }

+ 1 - 1
packages/@uppy/thumbnail-generator/src/index.test.js

@@ -227,7 +227,7 @@ describe('uploader/ThumbnailGeneratorPlugin', () => {
         expect(plugin.createThumbnail).toHaveBeenCalledWith(
           file,
           plugin.opts.thumbnailWidth,
-          plugin.opts.thumbnailHeight
+          plugin.opts.thumbnailHeight,
         )
       })
     })

+ 1 - 2
packages/@uppy/transloadit/src/Assembly.js

@@ -204,8 +204,7 @@ class TransloaditAssembly extends Emitter {
     // The below checks run in this order, that way even if we jump from
     // UPLOADING straight to FINISHED all the events are emitted as expected.
 
-    const nowExecuting
-      = isStatus(nextStatus, ASSEMBLY_EXECUTING)
+    const nowExecuting = isStatus(nextStatus, ASSEMBLY_EXECUTING)
       && !isStatus(prevStatus, ASSEMBLY_EXECUTING)
     if (nowExecuting) {
       // Without WebSockets, this is our only way to tell if uploading finished.

+ 2 - 2
packages/@uppy/transloadit/src/AssemblyOptions.js

@@ -67,7 +67,7 @@ class AssemblyOptions {
     const assemblyOptions = await options.getAssemblyOptions(file, options)
     if (Array.isArray(assemblyOptions.fields)) {
       assemblyOptions.fields = Object.fromEntries(
-        assemblyOptions.fields.map((fieldName) => [fieldName, file.meta[fieldName]])
+        assemblyOptions.fields.map((fieldName) => [fieldName, file.meta[fieldName]]),
       )
     } else if (assemblyOptions.fields == null) {
       assemblyOptions.fields = {}
@@ -92,7 +92,7 @@ class AssemblyOptions {
 
     if (this.files.length > 0) {
       return Promise.all(
-        this.files.map((file) => this.#getAssemblyOptions(file))
+        this.files.map((file) => this.#getAssemblyOptions(file)),
       ).then(dedupe)
     }
 

+ 1 - 1
packages/@uppy/transloadit/src/AssemblyOptions.test.js

@@ -14,7 +14,7 @@ describe('Transloadit/AssemblyOptions', () => {
     })
 
     await expect(options.build()).rejects.toThrow(
-      /The `params\.auth\.key` option is required/
+      /The `params\.auth\.key` option is required/,
     )
   })
 

+ 1 - 1
packages/@uppy/transloadit/src/index.js

@@ -496,7 +496,7 @@ module.exports = class Transloadit extends BasePlugin {
       return Promise.all(
         Object.keys(assemblies).map((id) => {
           return this.activeAssemblies[id].update()
-        })
+        }),
       )
     }
 

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

@@ -41,10 +41,10 @@ const validParams = {
   const uppy = new Uppy()
   // must be bools
   expectError(
-    uppy.use(Transloadit, { waitForEncoding: null, params: validParams })
+    uppy.use(Transloadit, { waitForEncoding: null, params: validParams }),
   )
   expectError(
-    uppy.use(Transloadit, { waitForMetadata: null, params: validParams })
+    uppy.use(Transloadit, { waitForMetadata: null, params: validParams }),
   )
 }
 
@@ -58,7 +58,7 @@ const validParams = {
       params: {
         auth: { key: null },
       },
-    })
+    }),
   )
   expectError(
     uppy.use(Transloadit, {
@@ -66,7 +66,7 @@ const validParams = {
         auth: { key: 'abc' },
         steps: 'test',
       },
-    })
+    }),
   )
   uppy.use(Transloadit, {
     params: {

+ 1 - 1
packages/@uppy/tus/src/index.js

@@ -668,7 +668,7 @@ module.exports = class Tus extends BasePlugin {
     if (this.opts.limit === 0) {
       this.uppy.log(
         '[Tus] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/tus/#limit-0',
-        'warning'
+        'warning',
       )
     }
 

+ 9 - 9
packages/@uppy/utils/src/Translator.test.js

@@ -78,14 +78,14 @@ describe('Translator', () => {
     it('should prioritize language pack strings from Core over default', () => {
       const translator = new Translator([defaultStrings, launguagePackLoadedInCore])
       expect(
-        translator.translate('youHaveChosen', { fileName: 'img.jpg' })
+        translator.translate('youHaveChosen', { fileName: 'img.jpg' }),
       ).toEqual('You have chosen: img.jpg')
     })
 
     it('should prioritize user-supplied strings over language pack from Core', () => {
       const translator = new Translator([defaultStrings, launguagePackLoadedInCore, userSuppliedStrings])
       expect(
-        translator.translate('youHaveChosen', { fileName: 'img.jpg' })
+        translator.translate('youHaveChosen', { fileName: 'img.jpg' }),
       ).toEqual('Beep boop: img.jpg')
     })
   })
@@ -94,7 +94,7 @@ describe('Translator', () => {
     it('should interpolate a string', () => {
       const translator = new Translator(english)
       expect(
-        translator.translate('youHaveChosen', { fileName: 'img.jpg' })
+        translator.translate('youHaveChosen', { fileName: 'img.jpg' }),
       ).toEqual('You have chosen: img.jpg')
     })
   })
@@ -103,15 +103,15 @@ describe('Translator', () => {
     it('should translate a string', () => {
       const translator = new Translator(russian)
       expect(
-        translator.translate('filesChosen', { smart_count: 18 })
+        translator.translate('filesChosen', { smart_count: 18 }),
       ).toEqual('Выбрано 18 файлов')
 
       expect(
-        translator.translate('filesChosen', { smart_count: 1 })
+        translator.translate('filesChosen', { smart_count: 1 }),
       ).toEqual('Выбран 1 файл')
 
       expect(
-        translator.translate('filesChosen', { smart_count: 0 })
+        translator.translate('filesChosen', { smart_count: 0 }),
       ).toEqual('Выбрано 0 файлов')
     })
 
@@ -124,13 +124,13 @@ describe('Translator', () => {
       })
 
       expect(
-        translator.translate('theAmount', { smart_count: 0 })
+        translator.translate('theAmount', { smart_count: 0 }),
       ).toEqual('het aantal is 0')
       expect(
-        translator.translate('theAmount', { smart_count: 1 })
+        translator.translate('theAmount', { smart_count: 1 }),
       ).toEqual('het aantal is 1')
       expect(
-        translator.translate('theAmount', { smart_count: 1202530 })
+        translator.translate('theAmount', { smart_count: 1202530 }),
       ).toEqual('het aantal is 1202530')
     })
 

+ 3 - 3
packages/@uppy/utils/src/generateFileID.test.js

@@ -12,7 +12,7 @@ describe('generateFileID', () => {
     }
 
     expect(generateFileID(fileObj)).toEqual(
-      'uppy-foo0fi////jpg-20-53-14-1e-image/jpeg-2271173-1498510508000'
+      'uppy-foo0fi////jpg-20-53-14-1e-image/jpeg-2271173-1498510508000',
     )
 
     expect(generateFileID({
@@ -23,7 +23,7 @@ describe('generateFileID', () => {
         size: 2271173,
       },
     })).toEqual(
-      'uppy-/////////p/////////jpg-11k-11m-123-11s-11r-11g-1d-11k-11m-123-11s-11r-11g-122-11l-121-122-1e-image/jpeg-2271173-1498510508000'
+      'uppy-/////////p/////////jpg-11k-11m-123-11s-11r-11g-1d-11k-11m-123-11s-11r-11g-122-11l-121-122-1e-image/jpeg-2271173-1498510508000',
     )
 
     expect(generateFileID({
@@ -37,7 +37,7 @@ describe('generateFileID', () => {
         relativePath: 'folder/a',
       },
     })).toEqual(
-      'uppy-hello/jpg-1e-image/jpeg-folder/a-1f-2271173-1498510508000'
+      'uppy-hello/jpg-1e-image/jpeg-folder/a-1f-2271173-1498510508000',
     )
   })
 })

+ 1 - 1
packages/@uppy/utils/src/getDroppedFiles/utils/webkitGetAsEntryApi/getFilesAndDirectoriesFromDirectory.js

@@ -25,6 +25,6 @@ module.exports = function getFilesAndDirectoriesFromDirectory (directoryReader,
     (error) => {
       logDropError(error)
       onSuccess(oldEntries)
-    }
+    },
   )
 }

+ 2 - 2
packages/@uppy/utils/src/getDroppedFiles/utils/webkitGetAsEntryApi/index.js

@@ -28,14 +28,14 @@ module.exports = function webkitGetAsEntryApi (dataTransfer, logDropError) {
         (error) => {
           logDropError(error)
           resolve()
-        }
+        },
       )
       // This is a recursive call
     } else if (entry.isDirectory) {
       const directoryReader = entry.createReader()
       getFilesAndDirectoriesFromDirectory(directoryReader, [], logDropError, {
         onSuccess: (entries) => resolve(Promise.all(
-          entries.map(createPromiseToAddFileOrParseDirectory)
+          entries.map(createPromiseToAddFileOrParseDirectory),
         )),
       })
     }

+ 4 - 4
packages/@uppy/utils/src/getSocketHost.test.js

@@ -3,19 +3,19 @@ const getSocketHost = require('./getSocketHost')
 describe('getSocketHost', () => {
   it('should get the host from the specified url', () => {
     expect(
-      getSocketHost('https://foo.bar/a/b/cd?e=fghi&l=k&m=n')
+      getSocketHost('https://foo.bar/a/b/cd?e=fghi&l=k&m=n'),
     ).toEqual('wss://foo.bar/a/b/cd?e=fghi&l=k&m=n')
 
     expect(
-      getSocketHost('Https://foo.bar/a/b/cd?e=fghi&l=k&m=n')
+      getSocketHost('Https://foo.bar/a/b/cd?e=fghi&l=k&m=n'),
     ).toEqual('wss://foo.bar/a/b/cd?e=fghi&l=k&m=n')
 
     expect(
-      getSocketHost('foo.bar/a/b/cd?e=fghi&l=k&m=n')
+      getSocketHost('foo.bar/a/b/cd?e=fghi&l=k&m=n'),
     ).toEqual('wss://foo.bar/a/b/cd?e=fghi&l=k&m=n')
 
     expect(
-      getSocketHost('http://foo.bar/a/b/cd?e=fghi&l=k&m=n')
+      getSocketHost('http://foo.bar/a/b/cd?e=fghi&l=k&m=n'),
     ).toEqual('ws://foo.bar/a/b/cd?e=fghi&l=k&m=n')
   })
 })

+ 1 - 1
packages/@uppy/utils/src/settle.js

@@ -9,7 +9,7 @@ module.exports = function settle (promises) {
   }
 
   const wait = Promise.all(
-    promises.map((promise) => promise.then(resolved, rejected))
+    promises.map((promise) => promise.then(resolved, rejected)),
   )
 
   return wait.then(() => {

+ 2 - 2
packages/@uppy/utils/src/settle.test.js

@@ -6,7 +6,7 @@ describe('settle', () => {
       settle([
         Promise.reject(new Error('oops')),
         Promise.reject(new Error('this went wrong')),
-      ])
+      ]),
     ).resolves.toMatchObject({
       successful: [],
       failed: [new Error('oops'), new Error('this went wrong')],
@@ -19,7 +19,7 @@ describe('settle', () => {
         Promise.reject(new Error('rejected')),
         Promise.resolve('resolved'),
         Promise.resolve('also-resolved'),
-      ])
+      ]),
     ).resolves.toMatchObject({
       successful: ['resolved', 'also-resolved'],
       failed: [new Error('rejected')],

+ 1 - 1
packages/@uppy/webcam/src/formatSeconds.js

@@ -7,6 +7,6 @@
  */
 module.exports = function formatSeconds (seconds) {
   return `${Math.floor(
-    seconds / 60
+    seconds / 60,
   )}:${String(seconds % 60).padStart(2, 0)}`
 }

+ 7 - 7
packages/@uppy/webcam/src/index.test.js

@@ -10,7 +10,7 @@ describe('Webcam', () => {
 
       const uppy = new Uppy().use(Webcam)
       expect(
-        uppy.getPlugin('Webcam').getMediaRecorderOptions().mimeType
+        uppy.getPlugin('Webcam').getMediaRecorderOptions().mimeType,
       ).not.toBeDefined()
     })
 
@@ -21,7 +21,7 @@ describe('Webcam', () => {
 
       const uppy = new Uppy().use(Webcam, { preferredVideoMimeType: 'video/webm' })
       expect(
-        uppy.getPlugin('Webcam').getMediaRecorderOptions().mimeType
+        uppy.getPlugin('Webcam').getMediaRecorderOptions().mimeType,
       ).toEqual('video/webm')
     })
 
@@ -32,7 +32,7 @@ describe('Webcam', () => {
 
       const uppy = new Uppy().use(Webcam, { preferredVideoMimeType: 'video/mp4' })
       expect(
-        uppy.getPlugin('Webcam').getMediaRecorderOptions().mimeType
+        uppy.getPlugin('Webcam').getMediaRecorderOptions().mimeType,
       ).not.toBeDefined()
     })
 
@@ -45,7 +45,7 @@ describe('Webcam', () => {
         restrictions: { allowedFileTypes: ['video/mp4', 'video/webm'] },
       }).use(Webcam)
       expect(
-        uppy.getPlugin('Webcam').getMediaRecorderOptions().mimeType
+        uppy.getPlugin('Webcam').getMediaRecorderOptions().mimeType,
       ).toEqual('video/mp4')
     })
 
@@ -58,7 +58,7 @@ describe('Webcam', () => {
         restrictions: { allowedFileTypes: ['video/mp4', 'video/webm'] },
       }).use(Webcam)
       expect(
-        uppy.getPlugin('Webcam').getMediaRecorderOptions().mimeType
+        uppy.getPlugin('Webcam').getMediaRecorderOptions().mimeType,
       ).toEqual('video/webm')
     })
 
@@ -72,7 +72,7 @@ describe('Webcam', () => {
       })
         .use(Webcam, { preferredVideoMimeType: 'video/webm' })
       expect(
-        uppy.getPlugin('Webcam').getMediaRecorderOptions().mimeType
+        uppy.getPlugin('Webcam').getMediaRecorderOptions().mimeType,
       ).toEqual('video/webm')
     })
 
@@ -85,7 +85,7 @@ describe('Webcam', () => {
         restrictions: { allowedFileTypes: ['video/mp4', 'video/webm'] },
       }).use(Webcam)
       expect(
-        uppy.getPlugin('Webcam').getMediaRecorderOptions().mimeType
+        uppy.getPlugin('Webcam').getMediaRecorderOptions().mimeType,
       ).toEqual(undefined)
     })
   })

+ 1 - 1
packages/@uppy/xhr-upload/src/index.js

@@ -610,7 +610,7 @@ module.exports = class XHRUpload extends BasePlugin {
     if (this.opts.limit === 0 && !this.opts[internalRateLimitedQueue]) {
       this.uppy.log(
         '[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0',
-        'warning'
+        'warning',
       )
     }
 

+ 2 - 2
test/endtoend/providers/helper.js

@@ -13,7 +13,7 @@ exports.finishUploadTest = async (browser) => {
 
 exports.startUploadTest = async (browser, providerName, tabMatch) => {
   const providerButton = await browser.$(
-    `.uppy-DashboardTab-btn[aria-controls=uppy-DashboardContent-panel--${providerName}]`
+    `.uppy-DashboardTab-btn[aria-controls=uppy-DashboardContent-panel--${providerName}]`,
   )
   await providerButton.click()
   await browser.pause(2000)
@@ -29,7 +29,7 @@ exports.uploadWithRetry = async (browser, providerName, testURL) => {
   await browser.url(`${testURL}?socketerr=true`)
 
   const providerButton = await browser.$(
-    `.uppy-DashboardTab-btn[aria-controls=uppy-DashboardContent-panel--${providerName}]`
+    `.uppy-DashboardTab-btn[aria-controls=uppy-DashboardContent-panel--${providerName}]`,
   )
   await providerButton.click()
   await browser.pause(2000)

+ 1 - 1
test/endtoend/providers/main.js

@@ -28,7 +28,7 @@ if (window.location.search === '?socketerr=true') {
   const emitError = (file, data) => {
     // trigger fake socket error
     data.uploader.uploaderSockets[file.id].emit(
-      'error', { error: { message: 'nobody likes me, thats ok' } }
+      'error', { error: { message: 'nobody likes me, thats ok' } },
     )
     window.uppy.off('upload-progress', emitError)
   }

+ 1 - 1
test/endtoend/providers/provider.instagram.test.js

@@ -52,7 +52,7 @@ describe('File upload with Instagram Provider', () => {
         await securityCodeInput.waitUntil(
           () => securityCodeInput.getValue(),
           30_000,
-          'expected security code to be manually entered'
+          'expected security code to be manually entered',
         )
       }
 

+ 2 - 2
test/endtoend/thumbnails/test.js

@@ -50,7 +50,7 @@ describe('ThumbnailGenerator', () => {
           'uppyThumbnails',
           path.basename(img), // name
           `image/${path.extname(img).slice(1)}`, // type
-          fs.readFileSync(img, 'base64') // b64
+          fs.readFileSync(img, 'base64'), // b64
         )
       }
       for (const { type, file } of notImages) {
@@ -59,7 +59,7 @@ describe('ThumbnailGenerator', () => {
           'uppyThumbnails',
           path.basename(file), // name
           type, // type
-          fs.readFileSync(file, 'base64') // b64
+          fs.readFileSync(file, 'base64'), // b64
         )
       }
     }

+ 1 - 1
test/endtoend/transloadit-assembly-options/test.js

@@ -41,7 +41,7 @@ describe('Transloadit getAssemblyOptions', () => {
         'uppyTransloadit',
         path.basename(img), // name
         'image/jpeg', // type
-        fs.readFileSync(img, 'base64') // b64
+        fs.readFileSync(img, 'base64'), // b64
       )
     }
     await result.waitForExist({ timeout: 25000 })

+ 1 - 1
test/endtoend/transloadit/test.js

@@ -41,7 +41,7 @@ describe('Transloadit file processing', () => {
         'uppyTransloadit',
         path.basename(img), // name
         'image/jpeg', // type
-        fs.readFileSync(img, 'base64') // b64
+        fs.readFileSync(img, 'base64'), // b64
       )
     }
     await result.waitForExist({ timeout: 25000 })

+ 1 - 1
test/resources/DeepFrozenStore.js

@@ -29,7 +29,7 @@ class DeepFrozenStore {
       // Remove the listener.
       this.callbacks.splice(
         this.callbacks.indexOf(listener),
-        1
+        1,
       )
     }
   }

+ 3 - 3
website/inject.js

@@ -115,14 +115,14 @@ async function injectSizes (config) {
         // ✓ @uppy/pkgname:     10.0 kB min  / 2.0 kB gz
         `  ✓ ${pkg}: ${' '.repeat(padTarget - pkg.length)}${
           `${prettierBytes(result.minified)} min`.padEnd(10)
-        } / ${prettierBytes(result.gzipped)} gz`
+        } / ${prettierBytes(result.gzipped)} gz`,
       ))
       return [pkg, {
         ...result,
         prettyMinified: prettierBytes(result.minified),
         prettyGzipped: prettierBytes(result.gzipped),
       }]
-    })
+    }),
   ).then(Object.fromEntries)
 
   config.uppy_bundle_kb_sizes = await sizesPromise
@@ -273,7 +273,7 @@ async function inject () {
   } catch (error) {
     console.error(
       chalk.red('x failed to inject: '),
-      chalk.grey(`uppy bundle into site, because: ${error}`)
+      chalk.grey(`uppy bundle into site, because: ${error}`),
     )
     process.exit(1)
   }

+ 3 - 4
website/themes/uppy/source/js/common.js

@@ -83,10 +83,9 @@
       h.id = h.id
         .replace(/\(.*\)$/, '')
         .replace(/\$/, '')
-      link.innerHTML
-        = `<a class="section-link" data-scroll href="#${h.id}">${
-          text
-        }</a>`
+      link.innerHTML = `<a class="section-link" data-scroll href="#${h.id}">${
+        text
+      }</a>`
       return link
     }
 

+ 21 - 13
yarn.lock

@@ -18951,9 +18951,9 @@ __metadata:
   languageName: node
   linkType: hard
 
-"eslint-config-transloadit@npm:^1.2.0":
-  version: 1.2.1
-  resolution: "eslint-config-transloadit@npm:1.2.1"
+"eslint-config-transloadit@npm:^2.0.0":
+  version: 2.0.0
+  resolution: "eslint-config-transloadit@npm:2.0.0"
   dependencies:
     eslint-config-airbnb: ^18.2.1
   peerDependencies:
@@ -18968,7 +18968,7 @@ __metadata:
     eslint-plugin-promise: ^4.3.1
     eslint-plugin-react: ^7.22.0
     eslint-plugin-react-hooks: ^4.2.0
-  checksum: c09edfcf19cc8ac8da8e7ee08a75699edea5a1e34b87b3590b63646824cf34211e6084125ae843f9f01768ae54a23744f3946c910ec0c49d8c4ecda70fd81425
+  checksum: b03b5b91a45311cc0d7fbc8b3a3149abc9298a92a24d016c1c962f93d3b728024c11e9e9b42c92d1a85f4312c44cf51da8da89d2c38e7816769a1775156964d7
   languageName: node
   linkType: hard
 
@@ -19049,7 +19049,7 @@ __metadata:
   languageName: node
   linkType: hard
 
-"eslint-plugin-import@npm:^2.22.1":
+"eslint-plugin-import@npm:^2.22.1, eslint-plugin-import@npm:^2.25.2":
   version: 2.25.2
   resolution: "eslint-plugin-import@npm:2.25.2"
   dependencies:
@@ -19170,12 +19170,19 @@ __metadata:
   languageName: node
   linkType: hard
 
-"eslint-plugin-promise@npm:^5.1.0":
-  version: 5.1.0
-  resolution: "eslint-plugin-promise@npm:5.1.0"
+"eslint-plugin-promise@npm:^4.3.1":
+  version: 4.3.1
+  resolution: "eslint-plugin-promise@npm:4.3.1"
+  checksum: 3a6f4180008bb3b7106371ed49060c9bca06ba5cffa82fb249f83d2c4fcf94bbefd468a837bff1164dd52066fe1be7ff2d126b212aaa8fe13e681916e78b1618
+  languageName: node
+  linkType: hard
+
+"eslint-plugin-react-hooks@npm:^4.2.0":
+  version: 4.2.0
+  resolution: "eslint-plugin-react-hooks@npm:4.2.0"
   peerDependencies:
-    eslint: ^7.0.0
-  checksum: e62947aaea6882951a1a9f5fe3e3c7925b8dcc222338f7979bd1495ba0f0dc701820116b108be1e801f6e5156eb9a928142f29c659fd21a5d65a4be495bb327d
+    eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0
+  checksum: ead5c5be3ded82a0cf295b064376adb1998a43e2262b605eecc0efc88283dec4e159ca39307fafb3d8e661dd08e5a4c8cdfed97eea78f923954f72bad6e20397
   languageName: node
   linkType: hard
 
@@ -42765,17 +42772,18 @@ typescript@4.3.4:
     deep-freeze: ^0.0.1
     disc: ^1.3.3
     eslint: ^8.0.0
-    eslint-config-transloadit: ^1.2.0
+    eslint-config-transloadit: ^2.0.0
     eslint-plugin-compat: ^3.8.0
-    eslint-plugin-import: ^2.22.1
+    eslint-plugin-import: ^2.25.2
     eslint-plugin-jest: ^25.0.0
     eslint-plugin-jsdoc: ^36.0.0
     eslint-plugin-jsx-a11y: ^6.4.1
     eslint-plugin-markdown: ^2.2.0
     eslint-plugin-node: ^11.1.0
     eslint-plugin-prefer-import: ^0.0.1
-    eslint-plugin-promise: ^5.1.0
+    eslint-plugin-promise: ^4.3.1
     eslint-plugin-react: ^7.22.0
+    eslint-plugin-react-hooks: ^4.2.0
     events.once: ^2.0.2
     exorcist: ^2.0.0
     fakefile: ^1.0.0