소스 검색

Update eslint to v6 (#1777)

* Update eslint

* Do eslint --fix

* Do not access Object.prototype method 'hasOwnProperty' from target object

* utils: add hasProperty

* eslint --fix

* Disable quote-props for locale files

* add back quotes in locale files

* revert locale files to state on master

* Update react-scripts
Renée Kooi 5 년 전
부모
커밋
c62ec3665d
58개의 변경된 파일763개의 추가작업 그리고 628개의 파일을 삭제
  1. 2 1
      .eslintrc.json
  2. 1 1
      babel.config.js
  3. 1 1
      bin/build-css.js
  4. 12 12
      bin/locale-packs.js
  5. 214 107
      package-lock.json
  6. 12 12
      package.json
  7. 3 3
      packages/@uppy/aws-s3-multipart/src/index.js
  8. 2 2
      packages/@uppy/aws-s3/src/index.js
  9. 1 1
      packages/@uppy/companion-client/src/RequestClient.js
  10. 4 0
      packages/@uppy/companion-client/src/Socket.test.js
  11. 1 2
      packages/@uppy/companion/src/server/emitter/redis-emitter.js
  12. 1 1
      packages/@uppy/companion/src/server/provider/drive/index.js
  13. 1 0
      packages/@uppy/companion/src/server/provider/index.js
  14. 1 1
      packages/@uppy/companion/src/server/provider/instagram/adapter.js
  15. 7 7
      packages/@uppy/core/src/Plugin.js
  16. 28 28
      packages/@uppy/core/src/index.js
  17. 7 7
      packages/@uppy/dashboard/src/components/PickerPanelTopBar.js
  18. 2 2
      packages/@uppy/dashboard/src/index.js
  19. 1 1
      packages/@uppy/drag-drop/src/index.js
  20. 1 1
      packages/@uppy/file-input/src/index.js
  21. 6 6
      packages/@uppy/golden-retriever/src/index.js
  22. 19 19
      packages/@uppy/provider-views/src/index.js
  23. 3 2
      packages/@uppy/robodog/src/addDashboardPlugin.js
  24. 5 4
      packages/@uppy/robodog/src/addProviders.js
  25. 2 1
      packages/@uppy/robodog/src/addTransloaditPlugin.js
  26. 2 1
      packages/@uppy/robodog/src/createUppy.js
  27. 3 2
      packages/@uppy/robodog/src/form.js
  28. 6 6
      packages/@uppy/status-bar/src/StatusBarStates.js
  29. 1 1
      packages/@uppy/status-bar/src/index.js
  30. 1 1
      packages/@uppy/store-default/src/index.test.js
  31. 1 1
      packages/@uppy/store-redux/src/index.js
  32. 2 2
      packages/@uppy/store-redux/src/index.test.js
  33. 1 0
      packages/@uppy/thumbnail-generator/src/index.js
  34. 5 6
      packages/@uppy/transloadit/src/Assembly.js
  35. 4 4
      packages/@uppy/transloadit/src/Client.js
  36. 5 5
      packages/@uppy/transloadit/src/index.js
  37. 3 3
      packages/@uppy/tus/src/index.js
  38. 1 1
      packages/@uppy/url/src/index.js
  39. 1 1
      packages/@uppy/url/src/utils/forEachDroppedOrPastedUrl.js
  40. 8 6
      packages/@uppy/utils/src/Translator.js
  41. 2 2
      packages/@uppy/utils/src/Translator.test.js
  42. 1 1
      packages/@uppy/utils/src/generateFileID.js
  43. 5 5
      packages/@uppy/utils/src/getFileNameAndExtension.js
  44. 2 2
      packages/@uppy/utils/src/getTimeStamp.js
  45. 3 0
      packages/@uppy/utils/src/hasProperty.js
  46. 41 41
      packages/@uppy/utils/src/mimeTypes.js
  47. 1 1
      packages/@uppy/utils/src/settle.test.js
  48. 1 1
      packages/@uppy/utils/src/toArray.js
  49. 5 5
      packages/@uppy/utils/src/toArray.test.js
  50. 3 3
      packages/@uppy/webcam/src/index.js
  51. 4 4
      packages/@uppy/xhr-upload/src/index.js
  52. 297 284
      test/endtoend/create-react-app/package-lock.json
  53. 1 1
      test/endtoend/create-react-app/package.json
  54. 1 1
      test/endtoend/i18n-drag-drop/test.js
  55. 1 1
      test/endtoend/transloadit/main.js
  56. 1 1
      test/endtoend/wdio.base.conf.js
  57. 1 1
      website/build-examples.js
  58. 12 12
      website/inject.js

+ 2 - 1
.eslintrc.json

@@ -53,7 +53,8 @@
       "packages/@uppy/locales/template.js"
     ],
     "rules": {
-      "camelcase": "off"
+      "camelcase": "off",
+      "quote-props": "off"
     }
   }]
 }

+ 1 - 1
babel.config.js

@@ -1,5 +1,5 @@
 module.exports = (api) => {
-  let targets = {}
+  const targets = {}
   if (api.env('test')) {
     targets.node = 'current'
   }

+ 1 - 1
bin/build-css.js

@@ -44,7 +44,7 @@ async function compileCSS () {
       }
     })
 
-    const postcssResult = await postcss([ autoprefixer ])
+    const postcssResult = await postcss([autoprefixer])
       .process(scssResult.css, { from: file })
     postcssResult.warnings().forEach(function (warn) {
       console.warn(warn.toString())

+ 12 - 12
bin/locale-packs.js

@@ -24,7 +24,7 @@ if (mode === 'build') {
 function getSources (pluginName) {
   const dependencies = {
     // because 'provider-views' doesn't have its own locale, it uses Core's defaultLocale
-    'core': ['provider-views']
+    core: ['provider-views']
   }
 
   const globPath = path.join(__dirname, '..', 'packages', '@uppy', pluginName, 'lib', '**', '*.js')
@@ -50,7 +50,7 @@ function buildPluginsList () {
   const files = glob.sync(packagesGlobPath)
 
   console.log(`--> Checked plugins could be instantiated and have defaultLocale in them:\n`)
-  for (let file of files) {
+  for (const file of files) {
     const dirName = path.dirname(file)
     const pluginName = path.basename(dirName)
     if (pluginName === 'locales' || pluginName === 'react-native') {
@@ -123,7 +123,7 @@ function buildPluginsList () {
 function addLocaleToPack (plugin, pluginName) {
   const localeStrings = plugin.defaultLocale.strings
 
-  for (let key in localeStrings) {
+  for (const key in localeStrings) {
     const valueInPlugin = JSON.stringify(localeStrings[key])
     const valueInPack = JSON.stringify(localePack[key])
 
@@ -138,9 +138,9 @@ function addLocaleToPack (plugin, pluginName) {
 }
 
 function checkForUnused (fileContents, pluginName, localePack) {
-  let buff = fileContents.join('\n')
-  for (let key in localePack) {
-    let regPat = new RegExp(`(i18n|i18nArray)\\([^\\)]*['\`"]${key}['\`"]`, 'g')
+  const buff = fileContents.join('\n')
+  for (const key in localePack) {
+    const regPat = new RegExp(`(i18n|i18nArray)\\([^\\)]*['\`"]${key}['\`"]`, 'g')
     if (!buff.match(regPat)) {
       console.error(`⚠ defaultLocale key: ${chalk.magenta(key)} not used in plugin: ${chalk.cyan(pluginName)}`)
     }
@@ -157,13 +157,13 @@ function sortObjectAlphabetically (obj, sortFunc) {
 function build () {
   const { plugins, sources } = buildPluginsList()
 
-  for (let pluginName in plugins) {
+  for (const pluginName in plugins) {
     addLocaleToPack(plugins[pluginName], pluginName)
   }
 
   localePack = sortObjectAlphabetically(localePack)
 
-  for (let pluginName in sources) {
+  for (const pluginName in sources) {
     checkForUnused(sources[pluginName], pluginName, sortObjectAlphabetically(plugins[pluginName].defaultLocale.strings))
   }
 
@@ -204,10 +204,10 @@ function test () {
   // Compare all follower Locales (RU, DE, etc) with our leader en_US
   const warnings = []
   const fatals = []
-  for (let followerName in followerLocales) {
-    let followerLocale = followerLocales[followerName]
-    let missing = leadingLocale.filter((key) => !followerLocale.includes(key))
-    let excess = followerLocale.filter((key) => !leadingLocale.includes(key))
+  for (const followerName in followerLocales) {
+    const followerLocale = followerLocales[followerName]
+    const missing = leadingLocale.filter((key) => !followerLocale.includes(key))
+    const excess = followerLocale.filter((key) => !leadingLocale.includes(key))
 
     missing.forEach((key) => {
       // Items missing are a non-fatal warning because we don't want CI to bum out over all languages

+ 214 - 107
package-lock.json

@@ -8844,9 +8844,9 @@
       }
     },
     "babel-eslint": {
-      "version": "10.0.1",
-      "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.0.1.tgz",
-      "integrity": "sha512-z7OT1iNV+TjOwHNLLyJk+HN+YVWX+CLE6fPD2SymJZOZQBs+QIexFjhm4keGTm8MW9xr4EC9Q0PbaLB24V5GoQ==",
+      "version": "10.0.2",
+      "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.0.2.tgz",
+      "integrity": "sha512-UdsurWPtgiPgpJ06ryUnuaSXC2s0WoSZnQmEpbAH65XZSdwowgN5MvyP7e88nW07FYXv72erVtpBkxyDVKhH1Q==",
       "dev": true,
       "requires": {
         "@babel/code-frame": "^7.0.0",
@@ -11491,9 +11491,9 @@
       "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ=="
     },
     "comment-parser": {
-      "version": "0.5.5",
-      "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-0.5.5.tgz",
-      "integrity": "sha512-oB3TinFT+PV3p8UwDQt71+HkG03+zwPwikDlKU6ZDmql6QX2zFlQ+G0GGSDqyJhdZi4PSlzFBm+YJ+ebOX3Vgw==",
+      "version": "0.6.1",
+      "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-0.6.1.tgz",
+      "integrity": "sha512-Putzd7Ilyvknmb1KxGf5el9uw0sPx9gEVnDrm8tlvXGN1i8Uaa2VBxB32hUhfzTlrEhhxNQ+pKq4ZNe8wNxjmw==",
       "dev": true
     },
     "common-shakeify": {
@@ -14046,49 +14046,59 @@
       }
     },
     "eslint": {
-      "version": "5.16.0",
-      "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz",
-      "integrity": "sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg==",
+      "version": "6.1.0",
+      "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.1.0.tgz",
+      "integrity": "sha512-QhrbdRD7ofuV09IuE2ySWBz0FyXCq0rriLTZXZqaWSI79CVtHVRdkFuFTViiqzZhkCgfOh9USpriuGN2gIpZDQ==",
       "dev": true,
       "requires": {
         "@babel/code-frame": "^7.0.0",
-        "ajv": "^6.9.1",
+        "ajv": "^6.10.0",
         "chalk": "^2.1.0",
         "cross-spawn": "^6.0.5",
         "debug": "^4.0.1",
         "doctrine": "^3.0.0",
-        "eslint-scope": "^4.0.3",
+        "eslint-scope": "^5.0.0",
         "eslint-utils": "^1.3.1",
         "eslint-visitor-keys": "^1.0.0",
-        "espree": "^5.0.1",
+        "espree": "^6.0.0",
         "esquery": "^1.0.1",
         "esutils": "^2.0.2",
         "file-entry-cache": "^5.0.1",
         "functional-red-black-tree": "^1.0.1",
-        "glob": "^7.1.2",
+        "glob-parent": "^5.0.0",
         "globals": "^11.7.0",
         "ignore": "^4.0.6",
         "import-fresh": "^3.0.0",
         "imurmurhash": "^0.1.4",
-        "inquirer": "^6.2.2",
-        "js-yaml": "^3.13.0",
+        "inquirer": "^6.4.1",
+        "is-glob": "^4.0.0",
+        "js-yaml": "^3.13.1",
         "json-stable-stringify-without-jsonify": "^1.0.1",
         "levn": "^0.3.0",
-        "lodash": "^4.17.11",
+        "lodash": "^4.17.14",
         "minimatch": "^3.0.4",
         "mkdirp": "^0.5.1",
         "natural-compare": "^1.4.0",
         "optionator": "^0.8.2",
-        "path-is-inside": "^1.0.2",
         "progress": "^2.0.0",
         "regexpp": "^2.0.1",
-        "semver": "^5.5.1",
-        "strip-ansi": "^4.0.0",
-        "strip-json-comments": "^2.0.1",
+        "semver": "^6.1.2",
+        "strip-ansi": "^5.2.0",
+        "strip-json-comments": "^3.0.1",
         "table": "^5.2.3",
-        "text-table": "^0.2.0"
+        "text-table": "^0.2.0",
+        "v8-compile-cache": "^2.0.3"
       },
       "dependencies": {
+        "ansi-escapes": {
+          "version": "4.2.1",
+          "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.2.1.tgz",
+          "integrity": "sha512-Cg3ymMAdN10wOk/VYfLV7KCQyv7EDirJ64500sU7n9UlmioEtDuU5Gd+hj73hXSU/ex7tHJSssmyftDdkMLO8Q==",
+          "dev": true,
+          "requires": {
+            "type-fest": "^0.5.2"
+          }
+        },
         "ansi-regex": {
           "version": "4.1.0",
           "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
@@ -14101,10 +14111,25 @@
           "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==",
           "dev": true
         },
+        "cli-cursor": {
+          "version": "3.1.0",
+          "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz",
+          "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==",
+          "dev": true,
+          "requires": {
+            "restore-cursor": "^3.1.0"
+          }
+        },
+        "emoji-regex": {
+          "version": "8.0.0",
+          "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+          "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
+          "dev": true
+        },
         "eslint-scope": {
-          "version": "4.0.3",
-          "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz",
-          "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==",
+          "version": "5.0.0",
+          "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz",
+          "integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==",
           "dev": true,
           "requires": {
             "esrecurse": "^4.1.0",
@@ -14122,6 +14147,24 @@
             "tmp": "^0.0.33"
           }
         },
+        "figures": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/figures/-/figures-3.0.0.tgz",
+          "integrity": "sha512-HKri+WoWoUgr83pehn/SIgLOMZ9nAWC6dcGj26RY2R4F50u4+RTUz0RCrUlOV3nKRAICW1UGzyb+kcX2qK1S/g==",
+          "dev": true,
+          "requires": {
+            "escape-string-regexp": "^1.0.5"
+          }
+        },
+        "glob-parent": {
+          "version": "5.0.0",
+          "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.0.0.tgz",
+          "integrity": "sha512-Z2RwiujPRGluePM6j699ktJYxmPpJKCfpGA13jz2hmFZC7gKetzrWvg5KN3+OsIFmydGyZ1AVwERCq1w/ZZwRg==",
+          "dev": true,
+          "requires": {
+            "is-glob": "^4.0.1"
+          }
+        },
         "import-fresh": {
           "version": "3.1.0",
           "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.1.0.tgz",
@@ -14133,43 +14176,77 @@
           }
         },
         "inquirer": {
-          "version": "6.5.0",
-          "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.0.tgz",
-          "integrity": "sha512-scfHejeG/lVZSpvCXpsB4j/wQNPM5JC8kiElOI0OUTwmc1RTpXr4H32/HOlQHcZiYl2z2VElwuCVDRG8vFmbnA==",
+          "version": "6.5.1",
+          "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.1.tgz",
+          "integrity": "sha512-uxNHBeQhRXIoHWTSNYUFhQVrHYFThIt6IVo2fFmSe8aBwdR3/w6b58hJpiL/fMukFkvGzjg+hSxFtwvVmKZmXw==",
           "dev": true,
           "requires": {
-            "ansi-escapes": "^3.2.0",
+            "ansi-escapes": "^4.2.1",
             "chalk": "^2.4.2",
-            "cli-cursor": "^2.1.0",
+            "cli-cursor": "^3.1.0",
             "cli-width": "^2.0.0",
             "external-editor": "^3.0.3",
-            "figures": "^2.0.0",
-            "lodash": "^4.17.12",
-            "mute-stream": "0.0.7",
+            "figures": "^3.0.0",
+            "lodash": "^4.17.15",
+            "mute-stream": "0.0.8",
             "run-async": "^2.2.0",
             "rxjs": "^6.4.0",
-            "string-width": "^2.1.0",
+            "string-width": "^4.1.0",
             "strip-ansi": "^5.1.0",
             "through": "^2.3.6"
           },
           "dependencies": {
-            "strip-ansi": {
-              "version": "5.2.0",
-              "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
-              "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
-              "dev": true,
-              "requires": {
-                "ansi-regex": "^4.1.0"
-              }
+            "lodash": {
+              "version": "4.17.15",
+              "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
+              "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
+              "dev": true
             }
           }
         },
+        "is-fullwidth-code-point": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+          "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
+          "dev": true
+        },
+        "mimic-fn": {
+          "version": "2.1.0",
+          "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
+          "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
+          "dev": true
+        },
+        "mute-stream": {
+          "version": "0.0.8",
+          "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz",
+          "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==",
+          "dev": true
+        },
+        "onetime": {
+          "version": "5.1.0",
+          "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz",
+          "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==",
+          "dev": true,
+          "requires": {
+            "mimic-fn": "^2.1.0"
+          }
+        },
         "resolve-from": {
           "version": "4.0.0",
           "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
           "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
           "dev": true
         },
+        "restore-cursor": {
+          "version": "3.1.0",
+          "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz",
+          "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==",
+          "dev": true,
+          "requires": {
+            "onetime": "^5.1.0",
+            "signal-exit": "^3.0.2"
+          }
+        },
         "rxjs": {
           "version": "6.5.2",
           "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.2.tgz",
@@ -14179,41 +14256,50 @@
             "tslib": "^1.9.0"
           }
         },
+        "semver": {
+          "version": "6.3.0",
+          "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
+          "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
+          "dev": true
+        },
+        "string-width": {
+          "version": "4.1.0",
+          "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.1.0.tgz",
+          "integrity": "sha512-NrX+1dVVh+6Y9dnQ19pR0pP4FiEIlUvdTGn8pw6CKTNq5sgib2nIhmUNT5TAmhWmvKr3WcxBcP3E8nWezuipuQ==",
+          "dev": true,
+          "requires": {
+            "emoji-regex": "^8.0.0",
+            "is-fullwidth-code-point": "^3.0.0",
+            "strip-ansi": "^5.2.0"
+          }
+        },
         "strip-ansi": {
-          "version": "4.0.0",
-          "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
-          "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
+          "version": "5.2.0",
+          "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
+          "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
           "dev": true,
           "requires": {
-            "ansi-regex": "^3.0.0"
-          },
-          "dependencies": {
-            "ansi-regex": {
-              "version": "3.0.0",
-              "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
-              "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
-              "dev": true
-            }
+            "ansi-regex": "^4.1.0"
           }
         },
-        "strip-json-comments": {
-          "version": "2.0.1",
-          "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
-          "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=",
+        "type-fest": {
+          "version": "0.5.2",
+          "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.5.2.tgz",
+          "integrity": "sha512-DWkS49EQKVX//Tbupb9TFa19c7+MK1XmzkrZUR8TAktmE/DizXoaoJV6TZ/tSIPXipqNiRI6CyAe7x69Jb6RSw==",
           "dev": true
         }
       }
     },
     "eslint-config-standard": {
-      "version": "12.0.0",
-      "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-12.0.0.tgz",
-      "integrity": "sha512-COUz8FnXhqFitYj4DTqHzidjIL/t4mumGZto5c7DrBpvWoie+Sn3P4sLEzUGeYhRElWuFEf8K1S1EfvD1vixCQ==",
+      "version": "13.0.1",
+      "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-13.0.1.tgz",
+      "integrity": "sha512-zLKp4QOgq6JFgRm1dDCVv1Iu0P5uZ4v5Wa4DTOkg2RFMxdCX/9Qf7lz9ezRj2dBRa955cWQF/O/LWEiYWAHbTw==",
       "dev": true
     },
     "eslint-config-standard-jsx": {
-      "version": "6.0.2",
-      "resolved": "https://registry.npmjs.org/eslint-config-standard-jsx/-/eslint-config-standard-jsx-6.0.2.tgz",
-      "integrity": "sha512-D+YWAoXw+2GIdbMBRAzWwr1ZtvnSf4n4yL0gKGg7ShUOGXkSOLerI17K4F6LdQMJPNMoWYqepzQD/fKY+tXNSg==",
+      "version": "7.0.0",
+      "resolved": "https://registry.npmjs.org/eslint-config-standard-jsx/-/eslint-config-standard-jsx-7.0.0.tgz",
+      "integrity": "sha512-OiKOF3MFVmWOCVfsi8GHlVorOEiBsPzAnUhM3c6HML94O2krbdQ/eMABySHgHHOIBYRls9sR9I3lo6O0vXhVEg==",
       "dev": true
     },
     "eslint-import-resolver-node": {
@@ -14334,9 +14420,9 @@
       }
     },
     "eslint-plugin-import": {
-      "version": "2.18.0",
-      "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.18.0.tgz",
-      "integrity": "sha512-PZpAEC4gj/6DEMMoU2Df01C5c50r7zdGIN52Yfi7CvvWaYssG7Jt5R9nFG5gmqodxNOz9vQS87xk6Izdtpdrig==",
+      "version": "2.18.1",
+      "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.18.1.tgz",
+      "integrity": "sha512-YEESFKOcMIXJTosb5YaepqVhQHGMb8dxkgov560GqMDP/658U5vk6FeVSR7xXLeYkPc7xPYy+uAoiYE/bKMphA==",
       "dev": true,
       "requires": {
         "array-includes": "^3.0.3",
@@ -14346,8 +14432,8 @@
         "eslint-import-resolver-node": "^0.3.2",
         "eslint-module-utils": "^2.4.0",
         "has": "^1.0.3",
-        "lodash": "^4.17.11",
         "minimatch": "^3.0.4",
+        "object.values": "^1.1.0",
         "read-pkg-up": "^2.0.0",
         "resolve": "^1.11.0"
       },
@@ -14386,34 +14472,37 @@
       }
     },
     "eslint-plugin-jest": {
-      "version": "22.10.0",
-      "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-22.10.0.tgz",
-      "integrity": "sha512-iBEWJn60Z5bctcjacymUnOQ3xN3gdvGOy3tDHpalAa99r4+jwH0CvICsIIHBNXNlJxuklkbx+wxr49tXk6M0tg==",
+      "version": "22.11.1",
+      "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-22.11.1.tgz",
+      "integrity": "sha512-kPF1Nmr5xMLz6DT7qEttz0TTeyx1x6SozIkNO9y4F2yxuWjHMp/e70fo742pR3y0MewgXQQMIIXeSKLB66iO7Q==",
       "dev": true
     },
     "eslint-plugin-jsdoc": {
-      "version": "5.0.2",
-      "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-5.0.2.tgz",
-      "integrity": "sha512-ACSu4NEEG5KZK7liCZz9jm5f5hFHcCL29zsN0RTixIZe1kuZOVO3oVbvnpe6o/U/3h9dMLJ42Yhe6umBS6aO7A==",
+      "version": "15.5.3",
+      "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-15.5.3.tgz",
+      "integrity": "sha512-lw8wYa1UFV53JLoqKOQR8YBkKlE/aguR+HGyytL9VKsVvm83DK8ReYnNNDRKik3MF661cGuaUuGfIEcdqg9l4A==",
       "dev": true,
       "requires": {
-        "comment-parser": "^0.5.4",
-        "jsdoctypeparser": "3.1.0",
-        "lodash": "^4.17.11"
+        "comment-parser": "^0.6.0",
+        "debug": "^4.1.1",
+        "flat-map-polyfill": "^0.3.8",
+        "jsdoctypeparser": "5.0.1",
+        "lodash": "^4.17.14",
+        "regextras": "^0.6.1"
       }
     },
     "eslint-plugin-node": {
-      "version": "8.0.1",
-      "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-8.0.1.tgz",
-      "integrity": "sha512-ZjOjbjEi6jd82rIpFSgagv4CHWzG9xsQAVp1ZPlhRnnYxcTgENUVBvhYmkQ7GvT1QFijUSo69RaiOJKhMu6i8w==",
+      "version": "9.1.0",
+      "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-9.1.0.tgz",
+      "integrity": "sha512-ZwQYGm6EoV2cfLpE1wxJWsfnKUIXfM/KM09/TlorkukgCAwmkgajEJnPCmyzoFPQQkmvo5DrW/nyKutNIw36Mw==",
       "dev": true,
       "requires": {
-        "eslint-plugin-es": "^1.3.1",
+        "eslint-plugin-es": "^1.4.0",
         "eslint-utils": "^1.3.1",
-        "ignore": "^5.0.2",
+        "ignore": "^5.1.1",
         "minimatch": "^3.0.4",
-        "resolve": "^1.8.1",
-        "semver": "^5.5.0"
+        "resolve": "^1.10.1",
+        "semver": "^6.1.0"
       },
       "dependencies": {
         "ignore": {
@@ -14421,6 +14510,12 @@
           "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.2.tgz",
           "integrity": "sha512-vdqWBp7MyzdmHkkRWV5nY+PfGRbYbahfuvsBCh277tq+w9zyNi7h5CYJCK0kmzti9kU+O/cB7sE8HvKv6aXAKQ==",
           "dev": true
+        },
+        "semver": {
+          "version": "6.2.0",
+          "resolved": "https://registry.npmjs.org/semver/-/semver-6.2.0.tgz",
+          "integrity": "sha512-jdFC1VdUGT/2Scgbimf7FSx9iJLXoqfglSF+gJeuNWVpiE37OIbc1jywR/GJyFdz3mnkz2/id0L0J/cr0izR5A==",
+          "dev": true
         }
       }
     },
@@ -14490,9 +14585,9 @@
       "dev": true
     },
     "espree": {
-      "version": "5.0.1",
-      "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz",
-      "integrity": "sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==",
+      "version": "6.0.0",
+      "resolved": "https://registry.npmjs.org/espree/-/espree-6.0.0.tgz",
+      "integrity": "sha512-lJvCS6YbCn3ImT3yKkPe0+tJ+mH6ljhGNjHQH9mRtiO6gjhVAOhVXW1yjnwqGwTkK3bGbye+hb00nFNmu0l/1Q==",
       "dev": true,
       "requires": {
         "acorn": "^6.0.7",
@@ -14501,9 +14596,9 @@
       },
       "dependencies": {
         "acorn": {
-          "version": "6.2.0",
-          "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.2.0.tgz",
-          "integrity": "sha512-8oe72N3WPMjA+2zVG71Ia0nXZ8DpQH+QyyHO+p06jT8eg8FGG3FbcUIi8KziHlAfheJQZeoqbvq1mQSQHXKYLw==",
+          "version": "6.3.0",
+          "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.3.0.tgz",
+          "integrity": "sha512-/czfa8BwS88b9gWQVhc8eknunSA2DoJpJyTQkhheIf5E48u1N0R4q/YxxsAeqRrmK9TQ/uYfgLDfZo91UlANIA==",
           "dev": true
         }
       }
@@ -15829,6 +15924,12 @@
         "write": "1.0.3"
       }
     },
+    "flat-map-polyfill": {
+      "version": "0.3.8",
+      "resolved": "https://registry.npmjs.org/flat-map-polyfill/-/flat-map-polyfill-0.3.8.tgz",
+      "integrity": "sha512-ZfmD5MnU7GglUEhiky9C7yEPaNq1/wh36RDohe+Xr3nJVdccwHbdTkFIYvetcdsoAckUKT51fuf44g7Ni5Doyg==",
+      "dev": true
+    },
     "flatted": {
       "version": "2.0.1",
       "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.1.tgz",
@@ -19388,13 +19489,13 @@
       }
     },
     "jest": {
-      "version": "24.7.1",
-      "resolved": "https://registry.npmjs.org/jest/-/jest-24.7.1.tgz",
-      "integrity": "sha512-AbvRar5r++izmqo5gdbAjTeA6uNRGoNRuj5vHB0OnDXo2DXWZJVuaObiGgtlvhKb+cWy2oYbQSfxv7Q7GjnAtA==",
+      "version": "24.8.0",
+      "resolved": "https://registry.npmjs.org/jest/-/jest-24.8.0.tgz",
+      "integrity": "sha512-o0HM90RKFRNWmAWvlyV8i5jGZ97pFwkeVoGvPW1EtLTgJc2+jcuqcbbqcSZLE/3f2S5pt0y2ZBETuhpWNl1Reg==",
       "dev": true,
       "requires": {
         "import-local": "^2.0.0",
-        "jest-cli": "^24.7.1"
+        "jest-cli": "^24.8.0"
       },
       "dependencies": {
         "ansi-regex": {
@@ -20798,9 +20899,9 @@
       "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM="
     },
     "jsdoctypeparser": {
-      "version": "3.1.0",
-      "resolved": "https://registry.npmjs.org/jsdoctypeparser/-/jsdoctypeparser-3.1.0.tgz",
-      "integrity": "sha512-JNbkKpDFqbYjg+IU3FNo7qjX7Opy7CwjHywT32zgAcz/d4lX6Umn5jOHVETUdnNNgGrMk0nEx1gvP0F4M0hzlQ==",
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/jsdoctypeparser/-/jsdoctypeparser-5.0.1.tgz",
+      "integrity": "sha512-dYwcK6TKzvq+ZKtbp4sbQSW9JMo6s+4YFfUs5D/K7bZsn3s1NhEhZ+jmIPzby0HbkbECBe+hNPEa6a+E21o94w==",
       "dev": true
     },
     "jsdom": {
@@ -26524,13 +26625,13 @@
       }
     },
     "prompts": {
-      "version": "2.1.0",
-      "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.1.0.tgz",
-      "integrity": "sha512-+x5TozgqYdOwWsQFZizE/Tra3fKvAoy037kOyU6cgz84n8f6zxngLOV4O32kTwt9FcLCxAqw0P/c8rOr9y+Gfg==",
+      "version": "2.2.1",
+      "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.2.1.tgz",
+      "integrity": "sha512-VObPvJiWPhpZI6C5m60XOzTfnYg/xc/an+r9VYymj9WJW3B/DIH+REzjpAACPf8brwPeP+7vz3bIim3S+AaMjw==",
       "dev": true,
       "requires": {
-        "kleur": "^3.0.2",
-        "sisteransi": "^1.0.0"
+        "kleur": "^3.0.3",
+        "sisteransi": "^1.0.3"
       }
     },
     "promzard": {
@@ -27479,6 +27580,12 @@
         "unicode-match-property-value-ecmascript": "^1.1.0"
       }
     },
+    "regextras": {
+      "version": "0.6.1",
+      "resolved": "https://registry.npmjs.org/regextras/-/regextras-0.6.1.tgz",
+      "integrity": "sha512-EzIHww9xV2Kpqx+corS/I7OBmf2rZ0pKKJPsw5Dc+l6Zq1TslDmtRIP9maVn3UH+72MIXmn8zzDgP07ihQogUA==",
+      "dev": true
+    },
     "registry-auth-token": {
       "version": "3.4.0",
       "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.4.0.tgz",
@@ -28726,9 +28833,9 @@
       }
     },
     "sisteransi": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.2.tgz",
-      "integrity": "sha512-ZcYcZcT69nSLAR2oLN2JwNmLkJEKGooFMCdvOkFrToUt/WfcRWqhIg4P4KwY4dmLbuyXIx4o4YmPsvMRJYJd/w==",
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.3.tgz",
+      "integrity": "sha512-SbEG75TzH8G7eVXFSN5f9EExILKfly7SUvVY5DhhYLvfhKqhDFY0OzevWa/zwak0RLRfWS5AvfMWpd9gJvr5Yg==",
       "dev": true
     },
     "slash": {
@@ -29960,9 +30067,9 @@
       }
     },
     "table": {
-      "version": "5.4.4",
-      "resolved": "https://registry.npmjs.org/table/-/table-5.4.4.tgz",
-      "integrity": "sha512-IIfEAUx5QlODLblLrGTTLJA7Tk0iLSGBvgY8essPRVNGHAzThujww1YqHLs6h3HfTg55h++RzLHH5Xw/rfv+mg==",
+      "version": "5.4.5",
+      "resolved": "https://registry.npmjs.org/table/-/table-5.4.5.tgz",
+      "integrity": "sha512-oGa2Hl7CQjfoaogtrOHEJroOcYILTx7BZWLGsJIlzoWmB2zmguhNfPJZsWPKYek/MgCxfco54gEi31d1uN2hFA==",
       "dev": true,
       "requires": {
         "ajv": "^6.10.2",

+ 12 - 12
package.json

@@ -95,7 +95,7 @@
     "@wdio/sauce-service": "^5.0.0",
     "aliasify": "^2.1.0",
     "autoprefixer": "^9.5.1",
-    "babel-eslint": "10.0.1",
+    "babel-eslint": "10.0.2",
     "babel-jest": "^24.8.0",
     "babel-plugin-inline-package-json": "^2.0.0",
     "babelify": "^10.0.0",
@@ -110,16 +110,16 @@
     "enzyme": "^3.9.0",
     "enzyme-adapter-react-16": "^1.11.2",
     "es6-promise": "4.2.5",
-    "eslint": "^5.16.0",
-    "eslint-config-standard": "^12.0.0",
-    "eslint-config-standard-jsx": "^6.0.2",
-    "eslint-plugin-compat": "^3.1.1",
-    "eslint-plugin-import": "^2.17.2",
-    "eslint-plugin-jest": "^22.5.1",
-    "eslint-plugin-jsdoc": "^5.0.2",
-    "eslint-plugin-node": "^8.0.1",
-    "eslint-plugin-promise": "^4.1.1",
-    "eslint-plugin-react": "^7.12.4",
+    "eslint": "^6.1.0",
+    "eslint-config-standard": "^13.0.1",
+    "eslint-config-standard-jsx": "^7.0.0",
+    "eslint-plugin-compat": "^3.3.0",
+    "eslint-plugin-import": "^2.18.1",
+    "eslint-plugin-jest": "^22.11.1",
+    "eslint-plugin-jsdoc": "^15.5.3",
+    "eslint-plugin-node": "^9.1.0",
+    "eslint-plugin-promise": "^4.2.1",
+    "eslint-plugin-react": "^7.14.2",
     "eslint-plugin-standard": "^4.0.0",
     "events.once": "^2.0.2",
     "exorcist": "^1.0.1",
@@ -131,7 +131,7 @@
     "globby": "^9.2.0",
     "gzip-size": "^5.0.0",
     "isomorphic-fetch": "2.2.1",
-    "jest": "24.7.1",
+    "jest": "24.8.0",
     "json3": "^3.3.2",
     "last-commit-message": "^1.0.0",
     "lerna": "^3.14.1",

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

@@ -13,11 +13,11 @@ function createEventTracker (emitter) {
   const events = []
   return {
     on (event, fn) {
-      events.push([ event, fn ])
+      events.push([event, fn])
       return emitter.on(event, fn)
     },
     remove () {
-      events.forEach(([ event, fn ]) => {
+      events.forEach(([event, fn]) => {
         emitter.off(event, fn)
       })
     }
@@ -96,7 +96,7 @@ module.exports = class AwsS3Multipart extends Plugin {
   createMultipartUpload (file) {
     this.assertHost()
 
-    let metadata = {}
+    const metadata = {}
 
     Object.keys(file.meta).map(key => {
       if (file.meta[key] != null) {

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

@@ -51,7 +51,7 @@ module.exports = class AwsS3 extends Plugin {
     this.opts = { ...defaultOptions, ...opts }
 
     // i18n
-    this.translator = new Translator([ this.defaultLocale, this.uppy.locale, this.opts.locale ])
+    this.translator = new Translator([this.defaultLocale, this.uppy.locale, this.opts.locale])
     this.i18n = this.translator.translate.bind(this.translator)
     this.i18nArray = this.translator.translateArray.bind(this.translator)
 
@@ -171,7 +171,7 @@ module.exports = class AwsS3 extends Plugin {
     this.uppy.addPreProcessor(this.prepareUpload)
 
     let warnedSuccessActionStatus = false
-    let xhrUploadOpts = {
+    const xhrUploadOpts = {
       fieldName: 'file',
       responseUrlFieldName: 'location',
       timeout: this.opts.timeout,

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

@@ -26,7 +26,7 @@ module.exports = class RequestClient {
 
   get defaultHeaders () {
     return {
-      'Accept': 'application/json',
+      Accept: 'application/json',
       'Content-Type': 'application/json',
       'Uppy-Versions': `@uppy/companion-client=${RequestClient.VERSION}`
     }

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

@@ -14,15 +14,19 @@ describe('Socket', () => {
       constructor (target) {
         webSocketConstructorSpy(target)
       }
+
       close (args) {
         webSocketCloseSpy(args)
       }
+
       send (json) {
         webSocketSendSpy(json)
       }
+
       triggerOpen () {
         this.onopen()
       }
+
       triggerClose () {
         this.onclose()
       }

+ 1 - 2
packages/@uppy/companion/src/server/emitter/redis-emitter.js

@@ -22,8 +22,7 @@ class RedisEmitter extends NRP {
    * @param {function} handler the handler of the event
    */
   once (eventName, handler) {
-    let removeListener
-    removeListener = this.on(eventName, (message) => {
+    const removeListener = this.on(eventName, (message) => {
       handler(message)
       removeListener()
     })

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

@@ -45,7 +45,7 @@ class Drive {
       })
     }
 
-    let where = {
+    const where = {
       fields: DRIVE_FILES_FIELDS,
       pageToken: query.cursor,
       q: `'${directory}' in parents and trashed=false`,

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

@@ -22,6 +22,7 @@ class Provider {
   constructor (options) {
     return this
   }
+
   /**
    *
    * @param {object} options

+ 1 - 1
packages/@uppy/companion/src/server/provider/instagram/adapter.js

@@ -32,7 +32,7 @@ exports.getItemSubList = (item) => {
 exports.getItemName = (item) => {
   if (item && item['created_time']) {
     const ext = item.type === 'video' ? 'mp4' : 'jpeg'
-    let date = new Date(item['created_time'] * 1000)
+    const date = new Date(item['created_time'] * 1000)
     const name = date.toLocaleDateString([], {
       year: 'numeric',
       month: 'short',

+ 7 - 7
packages/@uppy/core/src/Plugin.js

@@ -30,7 +30,7 @@ function debounce (fn) {
  *
  * @param {object} main Uppy core object
  * @param {object} object with plugin options
- * @return {array | string} files or success/fail message
+ * @returns {Array|string} files or success/fail message
  */
 module.exports = class Plugin {
   constructor (uppy, opts) {
@@ -78,11 +78,11 @@ module.exports = class Plugin {
   }
 
   /**
-  * Called when plugin is mounted, whether in DOM or into another plugin.
-  * Needed because sometimes plugins are mounted separately/after `install`,
-  * so this.el and this.parent might not be available in `install`.
-  * This is the case with @uppy/react plugins, for example.
-  */
+   * Called when plugin is mounted, whether in DOM or into another plugin.
+   * Needed because sometimes plugins are mounted separately/after `install`,
+   * so this.el and this.parent might not be available in `install`.
+   * This is the case with @uppy/react plugins, for example.
+   */
   onMount () {
 
   }
@@ -92,7 +92,7 @@ module.exports = class Plugin {
    * If it’s an object — target is a plugin, and we search `plugins`
    * for a plugin with same name and return its target.
    *
-   * @param {string|Object} target
+   * @param {string|object} target
    *
    */
   mount (target, plugin) {

+ 28 - 28
packages/@uppy/core/src/index.js

@@ -30,7 +30,7 @@ class Uppy {
   /**
    * Instantiate Uppy
    *
-   * @param {Object} opts — Uppy options
+   * @param {object} opts — Uppy options
    */
   constructor (opts) {
     this.defaultLocale = {
@@ -120,7 +120,7 @@ class Uppy {
     }
 
     // i18n
-    this.translator = new Translator([ this.defaultLocale, this.opts.locale ])
+    this.translator = new Translator([this.defaultLocale, this.opts.locale])
     this.locale = this.translator.locale
     this.i18n = this.translator.translate.bind(this.translator)
     this.i18nArray = this.translator.translateArray.bind(this.translator)
@@ -223,7 +223,7 @@ class Uppy {
   /**
    * Updates state with a patch
    *
-   * @param {Object} patch {foo: 'bar'}
+   * @param {object} patch {foo: 'bar'}
    */
   setState (patch) {
     this.store.setState(patch)
@@ -232,22 +232,22 @@ class Uppy {
   /**
    * Returns current state.
    *
-   * @returns {Object}
+   * @returns {object}
    */
   getState () {
     return this.store.getState()
   }
 
   /**
-  * Back compat for when uppy.state is used instead of uppy.getState().
-  */
+   * Back compat for when uppy.state is used instead of uppy.getState().
+   */
   get state () {
     return this.getState()
   }
 
   /**
-  * Shorthand to set state for a specific file.
-  */
+   * Shorthand to set state for a specific file.
+   */
   setFileState (fileID, state) {
     if (!this.getState().files[fileID]) {
       throw new Error(`Can’t set state for ${fileID} (the file could have been removed)`)
@@ -382,7 +382,7 @@ class Uppy {
    * Check if file passes a set of restrictions set in options: maxFileSize,
    * maxNumberOfFiles and allowedFileTypes.
    *
-   * @param {Object} file object to check
+   * @param {object} file object to check
    * @private
    */
   _checkRestrictions (file) {
@@ -428,7 +428,7 @@ class Uppy {
    * try to guess file type in a clever way, check file against restrictions,
    * and start an upload if `autoProceed === true`.
    *
-   * @param {Object} file object to add
+   * @param {object} file object to add
    * @returns {string} id for the added file
    */
   addFile (file) {
@@ -671,7 +671,7 @@ class Uppy {
 
     this.emit('upload-retry', fileID)
 
-    const uploadID = this._createUpload([ fileID ])
+    const uploadID = this._createUpload([fileID])
     return this._runUpload(uploadID)
   }
 
@@ -914,13 +914,13 @@ class Uppy {
   /**
    * Registers a plugin with Core.
    *
-   * @param {Object} Plugin object
-   * @param {Object} [opts] object with options to be passed to Plugin
-   * @returns {Object} self for chaining
+   * @param {object} Plugin object
+   * @param {object} [opts] object with options to be passed to Plugin
+   * @returns {object} self for chaining
    */
   use (Plugin, opts) {
     if (typeof Plugin !== 'function') {
-      let msg = `Expected a plugin class, but got ${Plugin === null ? 'null' : typeof Plugin}.` +
+      const msg = `Expected a plugin class, but got ${Plugin === null ? 'null' : typeof Plugin}.` +
         ' Please verify that the plugin was imported and spelled correctly.'
       throw new TypeError(msg)
     }
@@ -938,9 +938,9 @@ class Uppy {
       throw new Error('Your plugin must have a type')
     }
 
-    let existsPluginAlready = this.getPlugin(pluginId)
+    const existsPluginAlready = this.getPlugin(pluginId)
     if (existsPluginAlready) {
-      let msg = `Already found a plugin named '${existsPluginAlready.id}'. ` +
+      const msg = `Already found a plugin named '${existsPluginAlready.id}'. ` +
         `Tried to use: '${pluginId}'.\n` +
         `Uppy plugins must have unique 'id' options. See https://uppy.io/docs/plugins/#id.`
       throw new Error(msg)
@@ -960,7 +960,7 @@ class Uppy {
    * Find one Plugin by name.
    *
    * @param {string} id plugin id
-   * @returns {Object|boolean}
+   * @returns {object|boolean}
    */
   getPlugin (id) {
     let foundPlugin = null
@@ -987,7 +987,7 @@ class Uppy {
   /**
    * Uninstall and remove a plugin.
    *
-   * @param {Object} instance The plugin instance to remove.
+   * @param {object} instance The plugin instance to remove.
    */
   removePlugin (instance) {
     this.log(`Removing plugin ${instance.id}`)
@@ -1025,13 +1025,13 @@ class Uppy {
   }
 
   /**
-  * Set info message in `state.info`, so that UI plugins like `Informer`
-  * can display the message.
-  *
-  * @param {string | object} message Message to be displayed by the informer
-  * @param {string} [type]
-  * @param {number} [duration]
-  */
+   * Set info message in `state.info`, so that UI plugins like `Informer`
+   * can display the message.
+   *
+   * @param {string | object} message Message to be displayed by the informer
+   * @param {string} [type]
+   * @param {number} [duration]
+   */
 
   info (message, type = 'info', duration = 3000) {
     const isComplexMessage = typeof message === 'object'
@@ -1071,7 +1071,7 @@ class Uppy {
    * Passes messages to a function, provided in `opts.logger`.
    * If `opts.logger: Uppy.debugLogger` or `opts.debug: true`, logs to the browser console.
    *
-   * @param {string|Object} message to log
+   * @param {string|object} message to log
    * @param {string} [type] optional `error` or `warning`
    */
   log (message, type) {
@@ -1150,7 +1150,7 @@ class Uppy {
    * Add data to an upload's result object.
    *
    * @param {string} uploadID The ID of the upload.
-   * @param {Object} data Data properties to add to the result object.
+   * @param {object} data Data properties to add to the result object.
    */
   addResultData (uploadID, data) {
     if (!this._getUpload(uploadID)) {

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

@@ -2,13 +2,13 @@ const { h } = require('preact')
 const { iconPlus } = require('./icons')
 
 const uploadStates = {
-  'STATE_ERROR': 'error',
-  'STATE_WAITING': 'waiting',
-  'STATE_PREPROCESSING': 'preprocessing',
-  'STATE_UPLOADING': 'uploading',
-  'STATE_POSTPROCESSING': 'postprocessing',
-  'STATE_COMPLETE': 'complete',
-  'STATE_PAUSED': 'paused'
+  STATE_ERROR: 'error',
+  STATE_WAITING: 'waiting',
+  STATE_PREPROCESSING: 'preprocessing',
+  STATE_UPLOADING: 'uploading',
+  STATE_POSTPROCESSING: 'postprocessing',
+  STATE_COMPLETE: 'complete',
+  STATE_PAUSED: 'paused'
 }
 
 function getUploadingState (isAllErrored, isAllComplete, isAllPaused, files = {}) {

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

@@ -126,7 +126,7 @@ module.exports = class Dashboard extends Plugin {
     this.opts = { ...defaultOptions, ...opts }
 
     // i18n
-    this.translator = new Translator([ this.defaultLocale, this.uppy.locale, this.opts.locale ])
+    this.translator = new Translator([this.defaultLocale, this.uppy.locale, this.opts.locale])
     this.i18n = this.translator.translate.bind(this.translator)
     this.i18nArray = this.translator.translateArray.bind(this.translator)
 
@@ -187,7 +187,7 @@ module.exports = class Dashboard extends Plugin {
     if (callerPluginType !== 'acquirer' &&
         callerPluginType !== 'progressindicator' &&
         callerPluginType !== 'presenter') {
-      let msg = 'Dashboard: Modal can only be used by plugins of types: acquirer, progressindicator, presenter'
+      const msg = 'Dashboard: Modal can only be used by plugins of types: acquirer, progressindicator, presenter'
       this.uppy.log(msg)
       return
     }

+ 1 - 1
packages/@uppy/drag-drop/src/index.js

@@ -42,7 +42,7 @@ module.exports = class DragDrop extends Plugin {
     this.removeDragOverClassTimeout = null
 
     // i18n
-    this.translator = new Translator([ this.defaultLocale, this.uppy.locale, this.opts.locale ])
+    this.translator = new Translator([this.defaultLocale, this.uppy.locale, this.opts.locale])
     this.i18n = this.translator.translate.bind(this.translator)
     this.i18nArray = this.translator.translateArray.bind(this.translator)
 

+ 1 - 1
packages/@uppy/file-input/src/index.js

@@ -32,7 +32,7 @@ module.exports = class FileInput extends Plugin {
     this.opts = Object.assign({}, defaultOptions, opts)
 
     // i18n
-    this.translator = new Translator([ this.defaultLocale, this.uppy.locale, this.opts.locale ])
+    this.translator = new Translator([this.defaultLocale, this.uppy.locale, this.opts.locale])
     this.i18n = this.translator.translate.bind(this.translator)
     this.i18nArray = this.translator.translateArray.bind(this.translator)
 

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

@@ -4,12 +4,12 @@ const IndexedDBStore = require('./IndexedDBStore')
 const MetaDataStore = require('./MetaDataStore')
 
 /**
-* The GoldenRetriever plugin — restores selected files and resumes uploads
-* after a closed tab or a browser crash!
-*
-* Uses localStorage, IndexedDB and ServiceWorker to do its magic, read more:
-* https://uppy.io/blog/2017/07/golden-retriever/
-*/
+ * The GoldenRetriever plugin — restores selected files and resumes uploads
+ * after a closed tab or a browser crash!
+ *
+ * Uses localStorage, IndexedDB and ServiceWorker to do its magic, read more:
+ * https://uppy.io/blog/2017/07/golden-retriever/
+ */
 module.exports = class GoldenRetriever extends Plugin {
   static VERSION = require('../package.json').version
 

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

@@ -41,7 +41,7 @@ module.exports = class ProviderView {
   static VERSION = require('../package.json').version
 
   /**
-   * @param {Object} instance of the plugin
+   * @param {object} instance of the plugin
    */
   constructor (plugin, opts) {
     this.plugin = plugin
@@ -121,8 +121,8 @@ module.exports = class ProviderView {
     return this._loaderWrapper(
       this.provider.list(id),
       (res) => {
-        let folders = []
-        let files = []
+        const folders = []
+        const files = []
         let updatedDirectories
 
         const state = this.plugin.getPluginState()
@@ -144,7 +144,7 @@ module.exports = class ProviderView {
   /**
    * Fetches new folder
    *
-   * @param  {Object} Folder
+   * @param  {object} Folder
    * @param  {string} title Folder title
    */
   getNextFolder (folder) {
@@ -243,14 +243,14 @@ module.exports = class ProviderView {
     const state = Object.assign({}, this.plugin.getPluginState())
     const { files, folders, sorting } = state
 
-    let sortedFiles = files.sort((fileA, fileB) => {
+    const sortedFiles = files.sort((fileA, fileB) => {
       if (sorting === 'titleDescending') {
         return fileB.name.localeCompare(fileA.name)
       }
       return fileA.name.localeCompare(fileB.name)
     })
 
-    let sortedFolders = folders.sort((folderA, folderB) => {
+    const sortedFolders = folders.sort((folderA, folderB) => {
       if (sorting === 'titleDescending') {
         return folderB.name.localeCompare(folderA.name)
       }
@@ -268,9 +268,9 @@ module.exports = class ProviderView {
     const state = Object.assign({}, this.plugin.getPluginState())
     const { files, folders, sorting } = state
 
-    let sortedFiles = files.sort((fileA, fileB) => {
-      let a = new Date(fileA.modifiedDate)
-      let b = new Date(fileB.modifiedDate)
+    const sortedFiles = files.sort((fileA, fileB) => {
+      const a = new Date(fileA.modifiedDate)
+      const b = new Date(fileB.modifiedDate)
 
       if (sorting === 'dateDescending') {
         return a > b ? -1 : a < b ? 1 : 0
@@ -278,9 +278,9 @@ module.exports = class ProviderView {
       return a > b ? 1 : a < b ? -1 : 0
     })
 
-    let sortedFolders = folders.sort((folderA, folderB) => {
-      let a = new Date(folderA.modifiedDate)
-      let b = new Date(folderB.modifiedDate)
+    const sortedFolders = folders.sort((folderA, folderB) => {
+      const a = new Date(folderA.modifiedDate)
+      const b = new Date(folderB.modifiedDate)
 
       if (sorting === 'dateDescending') {
         return a > b ? -1 : a < b ? 1 : 0
@@ -305,9 +305,9 @@ module.exports = class ProviderView {
       return
     }
 
-    let sortedFiles = files.sort((fileA, fileB) => {
-      let a = fileA.size
-      let b = fileB.size
+    const sortedFiles = files.sort((fileA, fileB) => {
+      const a = fileA.size
+      const b = fileB.size
 
       if (sorting === 'sizeDescending') {
         return a > b ? -1 : a < b ? 1 : 0
@@ -341,14 +341,14 @@ module.exports = class ProviderView {
   addFolder (folder) {
     const folderId = this.providerFileToId(folder)
     let state = this.plugin.getPluginState()
-    let folders = state.selectedFolders || {}
+    const folders = state.selectedFolders || {}
     if (folderId in folders && folders[folderId].loading) {
       return
     }
     folders[folderId] = { loading: true, files: [] }
     this.plugin.setPluginState({ selectedFolders: folders })
     return this.provider.list(folder.requestPath).then((res) => {
-      let files = []
+      const files = []
       res.items.forEach((item) => {
         if (!item.isFolder) {
           this.addFile(item)
@@ -387,8 +387,8 @@ module.exports = class ProviderView {
     e.stopPropagation()
     e.preventDefault()
     e.currentTarget.focus()
-    let { folders, files } = this.plugin.getPluginState()
-    let items = this.filterItems(folders.concat(files))
+    const { folders, files } = this.plugin.getPluginState()
+    const items = this.filterItems(folders.concat(files))
 
     // Shift-clicking selects a single consecutive list of items
     // starting at the previous click and deselects everything else.

+ 3 - 2
packages/@uppy/robodog/src/addDashboardPlugin.js

@@ -1,4 +1,5 @@
 const Dashboard = require('@uppy/dashboard')
+const has = require('@uppy/utils/lib/hasProperty')
 
 const dashboardOptionNames = [
   'metaFields',
@@ -30,7 +31,7 @@ const modalDashboardOptionNames = [
 function addDashboardPlugin (uppy, opts, overrideOpts) {
   const dashboardOpts = {}
   dashboardOptionNames.forEach((key) => {
-    if (opts.hasOwnProperty(key)) {
+    if (has(opts, key)) {
       dashboardOpts[key] = opts[key]
     }
   })
@@ -38,7 +39,7 @@ function addDashboardPlugin (uppy, opts, overrideOpts) {
   const inline = overrideOpts.inline == null ? dashboardOpts.inline : overrideOpts.inline
   if (!inline) {
     modalDashboardOptionNames.forEach((key) => {
-      if (opts.hasOwnProperty(key)) {
+      if (has(opts, key)) {
         dashboardOpts[key] = opts[key]
       }
     })

+ 5 - 4
packages/@uppy/robodog/src/addProviders.js

@@ -1,4 +1,5 @@
 const Transloadit = require('@uppy/transloadit')
+const has = require('@uppy/utils/lib/hasProperty')
 
 const remoteProviders = {
   dropbox: require('@uppy/dropbox'),
@@ -32,7 +33,7 @@ function addRemoteProvider (uppy, name, opts) {
   }
 
   remoteProviderOptionNames.forEach((name) => {
-    if (opts.hasOwnProperty(name)) providerOptions[name] = opts[name]
+    if (has(opts, name)) providerOptions[name] = opts[name]
   })
   // Apply overrides for a specific provider plugin.
   if (typeof opts[name] === 'object') {
@@ -47,7 +48,7 @@ function addLocalProvider (uppy, name, opts) {
   const providerOptions = {}
 
   localProviderOptionNames.forEach((name) => {
-    if (opts.hasOwnProperty(name)) providerOptions[name] = opts[name]
+    if (has(opts, name)) providerOptions[name] = opts[name]
   })
   // Apply overrides for a specific provider plugin.
   if (typeof opts[name] === 'object') {
@@ -59,9 +60,9 @@ function addLocalProvider (uppy, name, opts) {
 
 function addProviders (uppy, names, opts = {}) {
   names.forEach((name) => {
-    if (remoteProviders.hasOwnProperty(name)) {
+    if (has(remoteProviders, name)) {
       addRemoteProvider(uppy, name, opts)
-    } else if (localProviders.hasOwnProperty(name)) {
+    } else if (has(localProviders, name)) {
       addLocalProvider(uppy, name, opts)
     } else {
       const validNames = [

+ 2 - 1
packages/@uppy/robodog/src/addTransloaditPlugin.js

@@ -1,4 +1,5 @@
 const Transloadit = require('@uppy/transloadit')
+const has = require('@uppy/utils/lib/hasProperty')
 const TransloaditResults = require('./TransloaditResultsPlugin')
 
 const transloaditOptionNames = [
@@ -16,7 +17,7 @@ const transloaditOptionNames = [
 function addTransloaditPlugin (uppy, opts) {
   const transloaditOptions = {}
   transloaditOptionNames.forEach((name) => {
-    if (opts.hasOwnProperty(name)) transloaditOptions[name] = opts[name]
+    if (has(opts, name)) transloaditOptions[name] = opts[name]
   })
   uppy.use(Transloadit, transloaditOptions)
 

+ 2 - 1
packages/@uppy/robodog/src/createUppy.js

@@ -1,4 +1,5 @@
 const Uppy = require('@uppy/core')
+const has = require('@uppy/utils/lib/hasProperty')
 
 const eventNames = {
   // File management events
@@ -36,7 +37,7 @@ const uppyOptionNames = [
 function createUppy (opts, overrides = {}) {
   const uppyOptions = {}
   uppyOptionNames.forEach((name) => {
-    if (opts.hasOwnProperty(name)) uppyOptions[name] = opts[name]
+    if (has(opts, name)) uppyOptions[name] = opts[name]
   })
   Object.assign(uppyOptions, overrides)
 

+ 3 - 2
packages/@uppy/robodog/src/form.js

@@ -2,6 +2,7 @@ const Uppy = require('@uppy/core')
 const Form = require('@uppy/form')
 const StatusBar = require('@uppy/status-bar')
 const findDOMElement = require('@uppy/utils/lib/findDOMElement')
+const has = require('@uppy/utils/lib/hasProperty')
 const AttachFileInputs = require('./AttachFileInputs')
 const TransloaditFormResult = require('./TransloaditFormResult')
 const addDashboardPlugin = require('./addDashboardPlugin')
@@ -38,7 +39,7 @@ function form (target, opts) {
   })
 
   let submitOnSuccess = true
-  if (opts.hasOwnProperty('submitOnSuccess')) {
+  if (has(opts, 'submitOnSuccess')) {
     submitOnSuccess = !!opts.submitOnSuccess
   }
 
@@ -48,7 +49,7 @@ function form (target, opts) {
     submitOnSuccess,
     addResultToForm: false // using custom implementation instead
   }
-  if (opts.hasOwnProperty('triggerUploadOnSubmit')) {
+  if (has(opts, 'triggerUploadOnSubmit')) {
     formOptions.triggerUploadOnSubmit = opts.triggerUploadOnSubmit
   }
 

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

@@ -1,8 +1,8 @@
 module.exports = {
-  'STATE_ERROR': 'error',
-  'STATE_WAITING': 'waiting',
-  'STATE_PREPROCESSING': 'preprocessing',
-  'STATE_UPLOADING': 'uploading',
-  'STATE_POSTPROCESSING': 'postprocessing',
-  'STATE_COMPLETE': 'complete'
+  STATE_ERROR: 'error',
+  STATE_WAITING: 'waiting',
+  STATE_PREPROCESSING: 'preprocessing',
+  STATE_UPLOADING: 'uploading',
+  STATE_POSTPROCESSING: 'postprocessing',
+  STATE_COMPLETE: 'complete'
 }

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

@@ -68,7 +68,7 @@ module.exports = class StatusBar extends Plugin {
     // merge default options with the ones set by user
     this.opts = Object.assign({}, defaultOptions, opts)
 
-    this.translator = new Translator([ this.defaultLocale, this.uppy.locale, this.opts.locale ])
+    this.translator = new Translator([this.defaultLocale, this.uppy.locale, this.opts.locale])
     this.i18n = this.translator.translate.bind(this.translator)
 
     this.render = this.render.bind(this)

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

@@ -27,7 +27,7 @@ describe('DefaultStore', () => {
     let calls = 0
     function listener (prevState, nextState, patch) {
       calls++
-      expect([ prevState, nextState, patch ]).toEqual(expected)
+      expect([prevState, nextState, patch]).toEqual(expected)
     }
 
     const store = DefaultStore()

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

@@ -12,7 +12,7 @@ const defaultSelector = (id) => (state) => state.uppy[id]
  * @param {object} opts.store - The Redux store to use.
  * @param {string} opts.id - This store instance's ID. Defaults to a random string.
  *    If you need to access Uppy state through Redux, eg. to render custom UI, set this to something constant.
- * @param {function} opts.selector - Function, `(state) => uppyState`, to pluck state from the Redux store.
+ * @param {Function} opts.selector - Function, `(state) => uppyState`, to pluck state from the Redux store.
  *    Defaults to retrieving `state.uppy[opts.id]`. Override if you placed Uppy state elsewhere in the Redux store.
  */
 class ReduxStore {

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

@@ -37,7 +37,7 @@ describe('ReduxStore', () => {
     let calls = 0
     function listener (prevState, nextState, patch) {
       calls++
-      expect([ prevState, nextState, patch ]).toEqual(expected)
+      expect([prevState, nextState, patch]).toEqual(expected)
     }
 
     const r = createStore()
@@ -69,7 +69,7 @@ describe('ReduxStore', () => {
     let calls = 0
     function listener (prevState, nextState, patch) {
       calls++
-      expect([ prevState, nextState, patch ]).toEqual(expected)
+      expect([prevState, nextState, patch]).toEqual(expected)
     }
 
     const store = ReduxStore({ store: r })

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

@@ -320,6 +320,7 @@ module.exports = class ThumbnailGenerator extends Plugin {
     this.uppy.on('file-removed', this.onFileRemoved)
     this.uppy.on('restored', this.onRestored)
   }
+
   uninstall () {
     this.uppy.off('file-added', this.onFileAdded)
     this.uppy.off('file-removed', this.onFileRemoved)

+ 5 - 6
packages/@uppy/transloadit/src/Assembly.js

@@ -1,5 +1,6 @@
 const io = requireSocketIo
 const Emitter = require('component-emitter')
+const has = require('@uppy/utils/lib/hasProperty')
 const parseUrl = require('./parseUrl')
 
 // Lazy load socket.io to avoid a console error
@@ -165,7 +166,7 @@ class TransloaditAssembly extends Emitter {
    * Update this assembly's status with a full new object. Events will be
    * emitted for status changes, new files, and new results.
    *
-   * @param {Object} next The new assembly status object.
+   * @param {object} next The new assembly status object.
    */
   updateStatus (next) {
     this._diffStatus(this.status, next)
@@ -176,8 +177,8 @@ class TransloaditAssembly extends Emitter {
    * Diff two assembly statuses, and emit the events necessary to go from `prev`
    * to `next`.
    *
-   * @param {Object} prev The previous assembly status.
-   * @param {Object} next The new assembly status.
+   * @param {object} prev The previous assembly status.
+   * @param {object} next The new assembly status.
    */
   _diffStatus (prev, next) {
     const prevStatus = prev.ok
@@ -209,9 +210,7 @@ class TransloaditAssembly extends Emitter {
 
     // Find new uploaded files.
     Object.keys(next.uploads)
-      .filter((upload) => (
-        !prev.uploads.hasOwnProperty(upload)
-      ))
+      .filter((upload) => !has(prev.uploads, upload))
       .map((upload) => next.uploads[upload])
       .forEach((upload) => {
         this.emit('upload', upload)

+ 4 - 4
packages/@uppy/transloadit/src/Client.js

@@ -11,7 +11,7 @@ module.exports = class Client {
   /**
    * Create a new assembly.
    *
-   * @param {Object} options
+   * @param {object} options
    */
   createAssembly ({
     templateId,
@@ -52,7 +52,7 @@ module.exports = class Client {
   /**
    * Reserve resources for a file in an Assembly. Then addFile can be used later.
    *
-   * @param {Object} assembly
+   * @param {object} assembly
    * @param {UppyFile} file
    */
   reserveFile (assembly, file) {
@@ -66,7 +66,7 @@ module.exports = class Client {
   /**
    * Import a remote file to an Assembly.
    *
-   * @param {Object} assembly
+   * @param {object} assembly
    * @param {UppyFile} file
    */
   addFile (assembly, file) {
@@ -88,7 +88,7 @@ module.exports = class Client {
   /**
    * Cancel a running Assembly.
    *
-   * @param {Object} assembly
+   * @param {object} assembly
    */
   cancelAssembly (assembly) {
     const url = assembly.assembly_ssl_url

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

@@ -60,7 +60,7 @@ module.exports = class Transloadit extends Plugin {
     }
 
     // i18n
-    this.translator = new Translator([ this.defaultLocale, this.uppy.locale, this.opts.locale ])
+    this.translator = new Translator([this.defaultLocale, this.uppy.locale, this.opts.locale])
     this.i18n = this.translator.translate.bind(this.translator)
     this.i18nArray = this.translator.translateArray.bind(this.translator)
 
@@ -96,8 +96,8 @@ module.exports = class Transloadit extends Plugin {
    *
    * See: https://github.com/tus/tusd/wiki/Uploading-to-Transloadit-using-tus#uploading-using-tus
    *
-   * @param {Object} file
-   * @param {Object} status
+   * @param {object} file
+   * @param {object} status
    */
   _attachAssemblyMetadata (file, status) {
     // Add the metadata parameters Transloadit needs.
@@ -293,7 +293,7 @@ module.exports = class Transloadit extends Plugin {
    *
    * @param {string} assemblyId
    * @param {string} stepName
-   * @param {Object} result
+   * @param {object} result
    */
   _onResult (assemblyId, stepName, result) {
     const state = this.getPluginState()
@@ -318,7 +318,7 @@ module.exports = class Transloadit extends Plugin {
    * When an Assembly has finished processing, get the final state
    * and emit it.
    *
-   * @param {Object} status
+   * @param {object} status
    */
   _onAssemblyFinished (status) {
     const url = status.assembly_ssl_url

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

@@ -32,11 +32,11 @@ function createEventTracker (emitter) {
   const events = []
   return {
     on (event, fn) {
-      events.push([ event, fn ])
+      events.push([event, fn])
       return emitter.on(event, fn)
     },
     remove () {
-      events.forEach(([ event, fn ]) => {
+      events.forEach(([event, fn]) => {
         emitter.off(event, fn)
       })
     }
@@ -119,7 +119,7 @@ module.exports = class Tus extends Plugin {
   /**
    * Create a new Tus upload
    *
-   * @param {Object} file for use with upload
+   * @param {object} file for use with upload
    * @param {integer} current file in a queue
    * @param {integer} total number of files in a queue
    * @returns {Promise}

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

@@ -36,7 +36,7 @@ module.exports = class Url extends Plugin {
     this.opts = Object.assign({}, defaultOptions, opts)
 
     // i18n
-    this.translator = new Translator([ this.defaultLocale, this.uppy.locale, this.opts.locale ])
+    this.translator = new Translator([this.defaultLocale, this.uppy.locale, this.opts.locale])
     this.i18n = this.translator.translate.bind(this.translator)
     this.i18nArray = this.translator.translateArray.bind(this.translator)
 

+ 1 - 1
packages/@uppy/url/src/utils/forEachDroppedOrPastedUrl.js

@@ -52,7 +52,7 @@ const toArray = require('@uppy/utils/lib/toArray')
 /**
  * Finds all links dropped/pasted from one browser window to another.
  *
- * @param {Object} dataTransfer - DataTransfer instance, e.g. e.clipboardData, or e.dataTransfer
+ * @param {object} dataTransfer - DataTransfer instance, e.g. e.clipboardData, or e.dataTransfer
  * @param {string} isDropOrPaste - either 'drop' or 'paste'
  * @param {Function} callback - (urlString) => {}
  */

+ 8 - 6
packages/@uppy/utils/src/Translator.js

@@ -1,3 +1,5 @@
+const has = require('./hasProperty')
+
 /**
  * Translates strings with interpolation & pluralization support.
  * Extensible with custom dictionaries and pluralization functions.
@@ -11,7 +13,7 @@
  */
 module.exports = class Translator {
   /**
-   * @param {Object|Array<Object>} locales - locale or list of locales.
+   * @param {object|Array<object>} locales - locale or list of locales.
    */
   constructor (locales) {
     this.locale = {
@@ -51,7 +53,7 @@ module.exports = class Translator {
    * taken from https://github.com/airbnb/polyglot.js/blob/master/lib/polyglot.js#L299
    *
    * @param {string} phrase that needs interpolation, with placeholders
-   * @param {Object} options with values that will be used to replace placeholders
+   * @param {object} options with values that will be used to replace placeholders
    * @returns {string} interpolated
    */
   interpolate (phrase, options) {
@@ -60,8 +62,8 @@ module.exports = class Translator {
     const dollarBillsYall = '$$$$'
     let interpolated = [phrase]
 
-    for (let arg in options) {
-      if (arg !== '_' && options.hasOwnProperty(arg)) {
+    for (const arg in options) {
+      if (arg !== '_' && has(options, arg)) {
         // Ensure replacement value is escaped to prevent special $-prefixed
         // regex replace tokens. the "$$$$" is needed because each "$" needs to
         // be escaped with "$" itself, and we need two in the resulting output.
@@ -100,7 +102,7 @@ module.exports = class Translator {
    * Public translate method
    *
    * @param {string} key
-   * @param {Object} options with values that will be used later to replace placeholders in string
+   * @param {object} options with values that will be used later to replace placeholders in string
    * @returns {string} translated (and interpolated)
    */
   translate (key, options) {
@@ -111,7 +113,7 @@ module.exports = class Translator {
    * Get a translation and return the translated and interpolated parts as an array.
    *
    * @param {string} key
-   * @param {Object} options with values that will be used to replace placeholders
+   * @param {object} options with values that will be used to replace placeholders
    * @returns {Array} The translated and interpolated parts, in order.
    */
   translateArray (key, options) {

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

@@ -76,14 +76,14 @@ describe('Translator', () => {
     }
 
     it('should prioritize language pack strings from Core over default', () => {
-      const translator = new Translator([ defaultStrings, launguagePackLoadedInCore ])
+      const translator = new Translator([defaultStrings, launguagePackLoadedInCore])
       expect(
         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 ])
+      const translator = new Translator([defaultStrings, launguagePackLoadedInCore, userSuppliedStrings])
       expect(
         translator.translate('youHaveChosen', { fileName: 'img.jpg' })
       ).toEqual('Beep boop: img.jpg')

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

@@ -2,7 +2,7 @@
  * Takes a file object and turns it into fileID, by converting file.name to lowercase,
  * removing extra characters and adding type, size and lastModified
  *
- * @param {Object} file
+ * @param {object} file
  * @returns {string} the fileID
  *
  */

+ 5 - 5
packages/@uppy/utils/src/getFileNameAndExtension.js

@@ -1,9 +1,9 @@
 /**
-* Takes a full filename string and returns an object {name, extension}
-*
-* @param {string} fullFileName
-* @returns {Object} {name, extension}
-*/
+ * Takes a full filename string and returns an object {name, extension}
+ *
+ * @param {string} fullFileName
+ * @returns {object} {name, extension}
+ */
 module.exports = function getFileNameAndExtension (fullFileName) {
   var re = /(?:\.([^.]+))?$/
   var fileExt = re.exec(fullFileName)[1]

+ 2 - 2
packages/@uppy/utils/src/getTimeStamp.js

@@ -1,6 +1,6 @@
 /**
  * Returns a timestamp in the format of `hours:minutes:seconds`
-*/
+ */
 module.exports = function getTimeStamp () {
   var date = new Date()
   var hours = pad(date.getHours().toString())
@@ -11,7 +11,7 @@ module.exports = function getTimeStamp () {
 
 /**
  * Adds zero to strings shorter than two characters
-*/
+ */
 function pad (str) {
   return str.length !== 2 ? 0 + str : str
 }

+ 3 - 0
packages/@uppy/utils/src/hasProperty.js

@@ -0,0 +1,3 @@
+module.exports = function has (object, key) {
+  return Object.prototype.hasOwnProperty.call(object, key)
+}

+ 41 - 41
packages/@uppy/utils/src/mimeTypes.js

@@ -4,45 +4,45 @@
 //    https://github.com/jshttp/mime-db/blob/master/db.json
 
 module.exports = {
-  'md': 'text/markdown',
-  'markdown': 'text/markdown',
-  'mp4': 'video/mp4',
-  'mp3': 'audio/mp3',
-  'svg': 'image/svg+xml',
-  'jpg': 'image/jpeg',
-  'png': 'image/png',
-  'gif': 'image/gif',
-  'heic': 'image/heic',
-  'heif': 'image/heif',
-  'yaml': 'text/yaml',
-  'yml': 'text/yaml',
-  'csv': 'text/csv',
-  'avi': 'video/x-msvideo',
-  'mks': 'video/x-matroska',
-  'mkv': 'video/x-matroska',
-  'mov': 'video/quicktime',
-  'doc': 'application/msword',
-  'docm': 'application/vnd.ms-word.document.macroenabled.12',
-  'docx': 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
-  'dot': 'application/msword',
-  'dotm': 'application/vnd.ms-word.template.macroenabled.12',
-  'dotx': 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
-  'xla': 'application/vnd.ms-excel',
-  'xlam': 'application/vnd.ms-excel.addin.macroenabled.12',
-  'xlc': 'application/vnd.ms-excel',
-  'xlf': 'application/x-xliff+xml',
-  'xlm': 'application/vnd.ms-excel',
-  'xls': 'application/vnd.ms-excel',
-  'xlsb': 'application/vnd.ms-excel.sheet.binary.macroenabled.12',
-  'xlsm': 'application/vnd.ms-excel.sheet.macroenabled.12',
-  'xlsx': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
-  'xlt': 'application/vnd.ms-excel',
-  'xltm': 'application/vnd.ms-excel.template.macroenabled.12',
-  'xltx': 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
-  'xlw': 'application/vnd.ms-excel',
-  'txt': 'text/plain',
-  'text': 'text/plain',
-  'conf': 'text/plain',
-  'log': 'text/plain',
-  'pdf': 'application/pdf'
+  md: 'text/markdown',
+  markdown: 'text/markdown',
+  mp4: 'video/mp4',
+  mp3: 'audio/mp3',
+  svg: 'image/svg+xml',
+  jpg: 'image/jpeg',
+  png: 'image/png',
+  gif: 'image/gif',
+  heic: 'image/heic',
+  heif: 'image/heif',
+  yaml: 'text/yaml',
+  yml: 'text/yaml',
+  csv: 'text/csv',
+  avi: 'video/x-msvideo',
+  mks: 'video/x-matroska',
+  mkv: 'video/x-matroska',
+  mov: 'video/quicktime',
+  doc: 'application/msword',
+  docm: 'application/vnd.ms-word.document.macroenabled.12',
+  docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
+  dot: 'application/msword',
+  dotm: 'application/vnd.ms-word.template.macroenabled.12',
+  dotx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
+  xla: 'application/vnd.ms-excel',
+  xlam: 'application/vnd.ms-excel.addin.macroenabled.12',
+  xlc: 'application/vnd.ms-excel',
+  xlf: 'application/x-xliff+xml',
+  xlm: 'application/vnd.ms-excel',
+  xls: 'application/vnd.ms-excel',
+  xlsb: 'application/vnd.ms-excel.sheet.binary.macroenabled.12',
+  xlsm: 'application/vnd.ms-excel.sheet.macroenabled.12',
+  xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+  xlt: 'application/vnd.ms-excel',
+  xltm: 'application/vnd.ms-excel.template.macroenabled.12',
+  xltx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
+  xlw: 'application/vnd.ms-excel',
+  txt: 'text/plain',
+  text: 'text/plain',
+  conf: 'text/plain',
+  log: 'text/plain',
+  pdf: 'application/pdf'
 }

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

@@ -9,7 +9,7 @@ describe('settle', () => {
       ])
     ).resolves.toMatchObject({
       successful: [],
-      failed: [ new Error('oops'), new Error('this went wrong') ]
+      failed: [new Error('oops'), new Error('this went wrong')]
     })
   })
 

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

@@ -1,6 +1,6 @@
 /**
  * Converts list into array
-*/
+ */
 module.exports = function toArray (list) {
   return Array.prototype.slice.call(list || [], 0)
 }

+ 5 - 5
packages/@uppy/utils/src/toArray.test.js

@@ -3,11 +3,11 @@ const toArray = require('./toArray')
 describe('toArray', () => {
   it('should convert a array-like object into an array', () => {
     const obj = {
-      '0': 'zero',
-      '1': 'one',
-      '2': 'two',
-      '3': 'three',
-      '4': 'four',
+      0: 'zero',
+      1: 'one',
+      2: 'two',
+      3: 'three',
+      4: 'four',
       length: 5
     }
 

+ 3 - 3
packages/@uppy/webcam/src/index.js

@@ -77,7 +77,7 @@ module.exports = class Webcam extends Plugin {
     this.opts = Object.assign({}, defaultOptions, opts)
 
     // i18n
-    this.translator = new Translator([ this.defaultLocale, this.uppy.locale, this.opts.locale ])
+    this.translator = new Translator([this.defaultLocale, this.uppy.locale, this.opts.locale])
     this.i18n = this.translator.translate.bind(this.translator)
     this.i18nArray = this.translator.translateArray.bind(this.translator)
 
@@ -145,7 +145,7 @@ module.exports = class Webcam extends Plugin {
   }
 
   startRecording () {
-    let options = {}
+    const options = {}
     const preferredVideoMimeType = this.opts.preferredVideoMimeType
 
     // Attempt to use the passed preferredVideoMimeType (if any) during recording.
@@ -223,7 +223,7 @@ module.exports = class Webcam extends Plugin {
     return new Promise((resolve, reject) => {
       let count = this.opts.countdown
 
-      let countDown = setInterval(() => {
+      const countDown = setInterval(() => {
         if (!this.webcamActive) {
           clearInterval(countDown)
           this.captureInProgress = false

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

@@ -26,8 +26,8 @@ function buildResponseError (xhr, error) {
  * because we might have detected a more accurate file type in Uppy
  * https://stackoverflow.com/a/50875615
  *
- * @param {Object} file File object with `data`, `size` and `meta` properties
- * @returns {Object} blob updated with the new `type` set from `file.meta.type`
+ * @param {object} file File object with `data`, `size` and `meta` properties
+ * @returns {object} blob updated with the new `type` set from `file.meta.type`
  */
 function setTypeInBlob (file) {
   const dataWithUpdatedType = file.data.slice(0, file.data.size, file.meta.type)
@@ -67,7 +67,7 @@ module.exports = class XHRUpload extends Plugin {
        * @property {string} responseText
        * @property {number} status
        * @property {string} statusText
-       * @property {Object.<string, string>} headers
+       * @property {object.<string, string>} headers
        *
        * @param {string} responseText the response body string
        * @param {XMLHttpRequest | respObj} response the response object (XHR or similar)
@@ -104,7 +104,7 @@ module.exports = class XHRUpload extends Plugin {
     this.opts = Object.assign({}, defaultOptions, opts)
 
     // i18n
-    this.translator = new Translator([ this.defaultLocale, this.uppy.locale, this.opts.locale ])
+    this.translator = new Translator([this.defaultLocale, this.uppy.locale, this.opts.locale])
     this.i18n = this.translator.translate.bind(this.translator)
     this.i18nArray = this.translator.translateArray.bind(this.translator)
 

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 297 - 284
test/endtoend/create-react-app/package-lock.json


+ 1 - 1
test/endtoend/create-react-app/package.json

@@ -7,7 +7,7 @@
     "es6-shim": "^0.35.3",
     "react": "^16.8.6",
     "react-dom": "^16.8.6",
-    "react-scripts": "3.0.1"
+    "react-scripts": "3.1.0"
   },
   "scripts": {
     "start": "react-scripts start",

+ 1 - 1
test/endtoend/i18n-drag-drop/test.js

@@ -13,7 +13,7 @@ describe('File upload with DragDrop + XHRUpload, i18n translated string', functi
   })
 
   it('should upload a file with XHRUpload and set progressbar to 100%', async () => {
-    let testImage = path.join(__dirname, '../../resources/image.jpg')
+    const testImage = path.join(__dirname, '../../resources/image.jpg')
     if (supportsChooseFile(capabilities)) {
       const input = await browser.$('#uppyi18n .uppy-DragDrop-input')
       await input.setValue(testImage)

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

@@ -21,7 +21,7 @@ function initUppyTransloadit (transloaditKey) {
       params: {
         auth: { key: transloaditKey },
         steps: {
-          'crop_thumbed': {
+          crop_thumbed: {
             use: [':original'],
             robot: '/image/resize',
             height: 100,

+ 1 - 1
test/endtoend/wdio.base.conf.js

@@ -123,7 +123,7 @@ exports.config = {
    * Gets executed before test execution begins. At this point you can access to all global
    * variables like `browser`. It is the perfect place to define custom commands.
    *
-   * @param {Array.<Object>} capabilities list of capabilities details
+   * @param {Array.<object>} capabilities list of capabilities details
    * @param {Array<string>} specs List of spec file paths that are to be run
    */
   before: function (capabilities, specs) {

+ 1 - 1
website/build-examples.js

@@ -146,7 +146,7 @@ glob(srcPattern, (err, files) => {
  * Logs to console and shows desktop notification on error.
  * Calls `this.emit(end)` to stop bundling.
  *
- * @param  {Object} err Error object
+ * @param  {object} err Error object
  */
 function onError (err) {
   console.error(chalk.red('✗ error:'), chalk.red(err.message))

+ 12 - 12
website/inject.js

@@ -139,31 +139,31 @@ async function injectGhStars () {
   const Octokit = require('@octokit/rest')
   const octokit = new Octokit(opts)
 
-  let { headers, data } = await octokit.repos.get({
+  const { headers, data } = await octokit.repos.get({
     owner: 'transloadit',
     repo: 'uppy'
   })
 
   console.log(`${headers['x-ratelimit-remaining']} requests remaining until we hit GitHub ratelimiter`)
 
-  let dstpath = path.join(webRoot, 'themes', 'uppy', 'layout', 'partials', 'generated_stargazers.ejs')
+  const dstpath = path.join(webRoot, 'themes', 'uppy', 'layout', 'partials', 'generated_stargazers.ejs')
   fs.writeFileSync(dstpath, data.stargazers_count, 'utf-8')
 
   console.log(`${data.stargazers_count} stargazers written to '${dstpath}'`)
 }
 
 async function injectMarkdown () {
-  let sources = {
+  const sources = {
     '.github/ISSUE_TEMPLATE/integration_help.md': `src/_template/integration_help.md`,
     '.github/CONTRIBUTING.md': `src/_template/contributing.md`
   }
 
-  for (let src in sources) {
-    let dst = sources[src]
+  for (const src in sources) {
+    const dst = sources[src]
     // strip yaml frontmatter:
-    let srcpath = path.join(uppyRoot, `/../../${src}`)
-    let dstpath = path.join(webRoot, dst)
-    let parts = fs.readFileSync(srcpath, 'utf-8').split(/---\s*\n/)
+    const srcpath = path.join(uppyRoot, `/../../${src}`)
+    const dstpath = path.join(webRoot, dst)
+    const parts = fs.readFileSync(srcpath, 'utf-8').split(/---\s*\n/)
     if (parts.length >= 3) {
       parts.shift()
       parts.shift()
@@ -185,7 +185,7 @@ function injectLocaleList () {
   const mdRows = []
 
   const localePackagePath = path.join(localesRoot, 'src', '*.js')
-  let localePackageVersion = require(path.join(localesRoot, 'package.json')).version
+  const localePackageVersion = require(path.join(localesRoot, 'package.json')).version
 
   glob.sync(localePackagePath).forEach((localePath) => {
     const localeName = path.basename(localePath, '.js')
@@ -194,8 +194,8 @@ function injectLocaleList () {
     const parts = localeNameWithDash.split('-')
     let variant = ''
     if (parts.length > 2) {
-      let lang = parts.shift()
-      let country = parts.shift()
+      const lang = parts.shift()
+      const country = parts.shift()
       variant = parts.join(', ')
       localeNameWithDash = `${lang}-${country}`
     }
@@ -211,7 +211,7 @@ function injectLocaleList () {
 
   const resultingMdTable = mdTable.concat(mdRows.sort()).join('\n').replace('%count%', mdRows.length)
 
-  let dstpath = path.join(webRoot, 'src', '_template', 'list_of_locale_packs.md')
+  const dstpath = path.join(webRoot, 'src', '_template', 'list_of_locale_packs.md')
   fs.writeFileSync(dstpath, resultingMdTable, 'utf-8')
   console.info(chalk.green(`✓ injected: `), chalk.grey(dstpath))
 }

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.