diff --git a/.eslintignore b/.eslintignore index 3700f6c4fe..553289d70d 100644 --- a/.eslintignore +++ b/.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 diff --git a/.eslintrc.js b/.eslintrc.js index 260e6aa748..6ec6360d8f 100644 --- a/.eslintrc.js +++ b/.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'], diff --git a/bin/after-version-bump.js b/bin/after-version-bump.js index 206d4eebfe..e3cbac6d00 100755 --- a/bin/after-version-bump.js +++ b/bin/after-version-bump.js @@ -43,7 +43,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) } } diff --git a/bin/build-bundle.js b/bin/build-bundle.js index 558bd8a39a..bb1183b7cf 100644 --- a/bin/build-bundle.js +++ b/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(() => { diff --git a/bin/build-css.js b/bin/build-css.js index b656af0780..0cf01b6117 100644 --- a/bin/build-css.js +++ b/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(() => { diff --git a/bin/build-lib.js b/bin/build-lib.js index 08db0a7b5f..c2e617e516 100644 --- a/bin/build-lib.js +++ b/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) diff --git a/bin/upload-to-cdn.js b/bin/upload-to-cdn.js index 610dee8869..8ec9baff6b 100644 --- a/bin/upload-to-cdn.js +++ b/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) diff --git a/examples/redux/main.js b/examples/redux/main.js index 0cb6f96acf..8c3aa8e706 100644 --- a/examples/redux/main.js +++ b/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 diff --git a/examples/transloadit-textarea/main.js b/examples/transloadit-textarea/main.js index b3390a931d..4fa11f356c 100644 --- a/examples/transloadit-textarea/main.js +++ b/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() diff --git a/package.json b/package.json index 04ad44fdf3..24f41f738c 100644 --- a/package.json +++ b/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", diff --git a/packages/@uppy/aws-s3-multipart/src/MultipartUploader.js b/packages/@uppy/aws-s3-multipart/src/MultipartUploader.js index a62d42e4c3..a5cbd1274e 100644 --- a/packages/@uppy/aws-s3-multipart/src/MultipartUploader.js +++ b/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 }`.', ) } diff --git a/packages/@uppy/aws-s3-multipart/src/index.js b/packages/@uppy/aws-s3-multipart/src/index.js index 7826c9874d..e15689dfc4 100644 --- a/packages/@uppy/aws-s3-multipart/src/index.js +++ b/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) diff --git a/packages/@uppy/aws-s3-multipart/src/index.test.js b/packages/@uppy/aws-s3-multipart/src/index.test.js index b250b1e5f4..1117ae71bd 100644 --- a/packages/@uppy/aws-s3-multipart/src/index.test.js +++ b/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': '*', diff --git a/packages/@uppy/aws-s3/src/index.js b/packages/@uppy/aws-s3/src/index.js index 701a327db1..054dc717fc 100644 --- a/packages/@uppy/aws-s3/src/index.js +++ b/packages/@uppy/aws-s3/src/index.js @@ -141,7 +141,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 }) diff --git a/packages/@uppy/companion-client/src/Provider.js b/packages/@uppy/companion-client/src/Provider.js index 1cf9f9f2c8..36cf7c3230 100644 --- a/packages/@uppy/companion-client/src/Provider.js +++ b/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 } diff --git a/packages/@uppy/companion-client/src/Socket.test.js b/packages/@uppy/companion-client/src/Socket.test.js index 255cb14a07..b4e92599aa 100644 --- a/packages/@uppy/companion-client/src/Socket.test.js +++ b/packages/@uppy/companion-client/src/Socket.test.js @@ -43,7 +43,7 @@ describe('Socket', () => { expect( new UppySocket({ target: 'foo', - }) instanceof UppySocket + }) instanceof UppySocket, ) }) diff --git a/packages/@uppy/companion/src/companion.js b/packages/@uppy/companion/src/companion.js index 302b453116..6dc790cfa4 100644 --- a/packages/@uppy/companion/src/companion.js +++ b/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.`, ) } diff --git a/packages/@uppy/companion/src/server/Uploader.js b/packages/@uppy/companion/src/server/Uploader.js index a5266dc446..259b752dad 100644 --- a/packages/@uppy/companion/src/server/Uploader.js +++ b/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) { diff --git a/packages/@uppy/companion/src/server/controllers/s3.js b/packages/@uppy/companion/src/server/controllers/s3.js index f7bc8723fe..7dd5849c83 100644 --- a/packages/@uppy/companion/src/server/controllers/s3.js +++ b/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++) { diff --git a/packages/@uppy/companion/src/server/header-blacklist.js b/packages/@uppy/companion/src/server/header-blacklist.js index 1c7ac5a7aa..08e0e4b817 100644 --- a/packages/@uppy/companion/src/server/header-blacklist.js +++ b/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) { diff --git a/packages/@uppy/companion/src/server/helpers/request.js b/packages/@uppy/companion/src/server/helpers/request.js index aa0b83565c..bdd5bb4a23 100644 --- a/packages/@uppy/companion/src/server/helpers/request.js +++ b/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', ) } diff --git a/packages/@uppy/companion/src/server/provider/drive/index.js b/packages/@uppy/companion/src/server/provider/drive/index.js index fc412d36da..f2673d2742 100644 --- a/packages/@uppy/companion/src/server/provider/drive/index.js +++ b/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 ) } diff --git a/packages/@uppy/companion/src/server/provider/unsplash/index.js b/packages/@uppy/companion/src/server/provider/unsplash/index.js index 424f85e0ca..d3b14648af 100644 --- a/packages/@uppy/companion/src/server/provider/unsplash/index.js +++ b/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) } diff --git a/packages/@uppy/companion/src/server/s3-client.js b/packages/@uppy/companion/src/server/s3-client.js index 015f93ac52..b7d09a79c2 100644 --- a/packages/@uppy/companion/src/server/s3-client.js +++ b/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) diff --git a/packages/@uppy/companion/src/standalone/index.js b/packages/@uppy/companion/src/standalone/index.js index 2d36b5256e..4d0349905f 100644 --- a/packages/@uppy/companion/src/standalone/index.js +++ b/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 }) } diff --git a/packages/@uppy/core/src/Uppy.js b/packages/@uppy/core/src/Uppy.js index 2a687a61d3..cf4f65e35e 100644 --- a/packages/@uppy/core/src/Uppy.js +++ b/packages/@uppy/core/src/Uppy.js @@ -418,7 +418,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) @@ -1286,10 +1286,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) diff --git a/packages/@uppy/core/src/Uppy.test.js b/packages/@uppy/core/src/Uppy.test.js index cb494523de..5124b99aae 100644 --- a/packages/@uppy/core/src/Uppy.test.js +++ b/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, - } + }, ) } diff --git a/packages/@uppy/dashboard/src/components/FileList.js b/packages/@uppy/dashboard/src/components/FileList.js index 4284b4d7bd..01babc17bc 100644 --- a/packages/@uppy/dashboard/src/components/FileList.js +++ b/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! diff --git a/packages/@uppy/dashboard/src/components/PickerPanelTopBar.js b/packages/@uppy/dashboard/src/components/PickerPanelTopBar.js index cbc7791e45..8fdd9cad81 100644 --- a/packages/@uppy/dashboard/src/components/PickerPanelTopBar.js +++ b/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) { diff --git a/packages/@uppy/dashboard/src/index.test.js b/packages/@uppy/dashboard/src/index.test.js index 03e695b7ba..9016bf47d9 100644 --- a/packages/@uppy/dashboard/src/index.test.js +++ b/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('Май дивайс') }) diff --git a/packages/@uppy/golden-retriever/src/index.js b/packages/@uppy/golden-retriever/src/index.js index 5a5e0cad34..8a1c71a78a 100644 --- a/packages/@uppy/golden-retriever/src/index.js +++ b/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) diff --git a/packages/@uppy/image-editor/src/Editor.js b/packages/@uppy/image-editor/src/Editor.js index 5abc1fd76a..22e56e3b19 100644 --- a/packages/@uppy/image-editor/src/Editor.js +++ b/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, ) } diff --git a/packages/@uppy/image-editor/src/index.js b/packages/@uppy/image-editor/src/index.js index 2c66faca72..c94eee605c 100644 --- a/packages/@uppy/image-editor/src/index.js +++ b/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, ) } diff --git a/packages/@uppy/provider-views/src/Browser.js b/packages/@uppy/provider-views/src/Browser.js index ce305a4024..660e995133 100644 --- a/packages/@uppy/provider-views/src/Browser.js +++ b/packages/@uppy/provider-views/src/Browser.js @@ -39,14 +39,14 @@ function Browser (props) {
{headerComponent} @@ -100,7 +100,7 @@ function Browser (props) { {files.map((file) => { const validated = validateRestrictions( remoteFileObjToLocal(file), - [...uppyFiles, ...currentSelection] + [...uppyFiles, ...currentSelection], ) return Item({ diff --git a/packages/@uppy/provider-views/src/Item/index.js b/packages/@uppy/provider-views/src/Item/index.js index ab15420a16..93fa4fd28a 100644 --- a/packages/@uppy/provider-views/src/Item/index.js +++ b/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 = diff --git a/packages/@uppy/provider-views/src/ProviderView/ProviderView.js b/packages/@uppy/provider-views/src/ProviderView/ProviderView.js index 1046feb779..462b9c5325 100644 --- a/packages/@uppy/provider-views/src/ProviderView/ProviderView.js +++ b/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, ) } diff --git a/packages/@uppy/provider-views/src/SearchProviderView/SearchProviderView.js b/packages/@uppy/provider-views/src/SearchProviderView/SearchProviderView.js index 76a4bcf70b..aa71a0bbba 100644 --- a/packages/@uppy/provider-views/src/SearchProviderView/SearchProviderView.js +++ b/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, ) } diff --git a/packages/@uppy/provider-views/src/SharedHandler.js b/packages/@uppy/provider-views/src/SharedHandler.js index 11e8049a24..ca8accaac1 100644 --- a/packages/@uppy/provider-views/src/SharedHandler.js +++ b/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) diff --git a/packages/@uppy/react/src/getHTMLProps.js b/packages/@uppy/react/src/getHTMLProps.js index 2436aa3baf..b6ce49ec02 100644 --- a/packages/@uppy/react/src/getHTMLProps.js +++ b/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)), ) } diff --git a/packages/@uppy/status-bar/src/Components.js b/packages/@uppy/status-bar/src/Components.js index 083a432567..8eb5765a3c 100644 --- a/packages/@uppy/status-bar/src/Components.js +++ b/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 (