Forráskód Böngészése

deps: upgrade ESLint to v7 (#2460)

Renée Kooi 4 éve
szülő
commit
335079d222

+ 2 - 2
.eslintrc.json

@@ -1,5 +1,5 @@
 {
-  "parser": "babel-eslint",
+  "parser": "@babel/eslint-parser",
   "extends": ["standard", "standard-jsx"],
   "env": {
     "browser": true,
@@ -10,7 +10,7 @@
     "window": true,
     "hexo": true
   },
-  "plugins": ["jest", "compat", "jsdoc"],
+  "plugins": ["jest", "compat", "jsdoc", "@babel/eslint-plugin"],
   "rules": {
     "jsx-quotes": ["error", "prefer-double"],
     "compat/compat": ["error"],

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 364 - 320
package-lock.json


+ 10 - 9
package.json

@@ -81,6 +81,8 @@
   "devDependencies": {
     "@babel/cli": "7.10.5",
     "@babel/core": "7.11.1",
+    "@babel/eslint-parser": "7.11.3",
+    "@babel/eslint-plugin": "7.11.3",
     "@babel/plugin-proposal-class-properties": "7.10.4",
     "@babel/plugin-transform-object-assign": "7.10.4",
     "@babel/plugin-transform-react-jsx": "7.10.4",
@@ -116,7 +118,6 @@
     "aliasify": "2.1.0",
     "autoprefixer": "9.7.4",
     "aws-sdk": "^2.715.0",
-    "babel-eslint": "10.0.3",
     "babel-jest": "25.5.1",
     "babel-plugin-inline-package-json": "2.0.0",
     "babelify": "10.0.0",
@@ -133,16 +134,16 @@
     "enzyme": "3.11.0",
     "enzyme-adapter-react-16": "1.15.2",
     "es6-promise": "4.2.8",
-    "eslint": "6.8.0",
-    "eslint-config-standard": "14.1.0",
+    "eslint": "7.6.0",
+    "eslint-config-standard": "14.1.1",
     "eslint-config-standard-jsx": "8.1.0",
-    "eslint-plugin-compat": "3.5.1",
-    "eslint-plugin-import": "2.20.1",
-    "eslint-plugin-jest": "22.21.0",
-    "eslint-plugin-jsdoc": "15.12.2",
-    "eslint-plugin-node": "10.0.0",
+    "eslint-plugin-compat": "3.8.0",
+    "eslint-plugin-import": "2.22.0",
+    "eslint-plugin-jest": "23.20.0",
+    "eslint-plugin-jsdoc": "30.2.2",
+    "eslint-plugin-node": "11.1.0",
     "eslint-plugin-promise": "4.2.1",
-    "eslint-plugin-react": "7.18.3",
+    "eslint-plugin-react": "7.20.6",
     "eslint-plugin-standard": "4.0.1",
     "events.once": "2.0.2",
     "execa": "4.0.0",

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

@@ -24,6 +24,7 @@ module.exports = class Editor extends Component {
 
   render () {
     const { currentImage, i18n } = this.props
+    // eslint-disable-next-line compat/compat
     const imageURL = URL.createObjectURL(currentImage.data)
 
     return (

+ 2 - 0
packages/@uppy/screen-capture/src/index.js

@@ -238,6 +238,7 @@ module.exports = class ScreenCapture extends Plugin {
         this.outputStream = new MediaStream(tracks)
 
         // initialize mediarecorder
+        // eslint-disable-next-line compat/compat
         this.recorder = new MediaRecorder(this.outputStream, options)
 
         // push data to buffer when data available
@@ -304,6 +305,7 @@ module.exports = class ScreenCapture extends Plugin {
 
       // create object url for capture result preview
       this.setPluginState({
+        // eslint-disable-next-line compat/compat
         recordedVideo: URL.createObjectURL(file.data)
       })
     }).then(() => {

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

@@ -64,16 +64,22 @@ module.exports = class ThumbnailGenerator extends Plugin {
    * @returns {Promise}
    */
   createThumbnail (file, targetWidth, targetHeight) {
+    // bug in the compatibility data
+    // eslint-disable-next-line compat/compat
     const originalUrl = URL.createObjectURL(file.data)
 
     const onload = new Promise((resolve, reject) => {
       const image = new Image()
       image.src = originalUrl
       image.addEventListener('load', () => {
+        // bug in the compatibility data
+        // eslint-disable-next-line compat/compat
         URL.revokeObjectURL(originalUrl)
         resolve(image)
       })
       image.addEventListener('error', (event) => {
+        // bug in the compatibility data
+        // eslint-disable-next-line compat/compat
         URL.revokeObjectURL(originalUrl)
         reject(event.error || new Error('Could not create thumbnail'))
       })
@@ -89,6 +95,8 @@ module.exports = class ThumbnailGenerator extends Plugin {
         return this.canvasToBlob(resizedImage, 'image/jpeg', 80)
       })
       .then(blob => {
+        // bug in the compatibility data
+        // eslint-disable-next-line compat/compat
         return URL.createObjectURL(blob)
       })
   }

+ 2 - 0
packages/@uppy/webcam/src/index.js

@@ -240,6 +240,8 @@ module.exports = class Webcam extends Plugin {
   }
 
   _startRecording () {
+    // only used if supportsMediaRecorder() returned true
+    // eslint-disable-next-line compat/compat
     this.recorder = new MediaRecorder(this.stream, this._getMediaRecorderOptions())
     this.recordingChunks = []
     let stoppingBecauseOfMaxSize = false

+ 2 - 0
packages/@uppy/webcam/src/supportsMediaRecorder.js

@@ -1,4 +1,6 @@
 module.exports = function supportsMediaRecorder () {
+  /* eslint-disable compat/compat */
   return typeof MediaRecorder === 'function' && !!MediaRecorder.prototype &&
     typeof MediaRecorder.prototype.start === 'function'
+  /* eslint-enable compat/compat */
 }

+ 4 - 1
test/endtoend/chaos-monkey/main.js

@@ -22,7 +22,10 @@ window.setup = function (options) {
   })
   uppy.on('file-added', (file) => {
     randomColorImage().then(function (blob) {
-      uppy.setFileState(file.id, { preview: URL.createObjectURL(blob) })
+      uppy.setFileState(file.id, {
+        // eslint-disable-next-line compat/compat
+        preview: URL.createObjectURL(blob)
+      })
     })
   })
 

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott