diff --git a/.eslintrc.json b/.eslintrc.json index efdbe59..f734125 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -5,7 +5,7 @@ "es6": true }, "extends": ["eslint:recommended", "standard", "standard-react"], - "parser": "babel-eslint", + "parser": "@babel/eslint-parser", "parserOptions": { "ecmaVersion": "7", "ecmaFeatures": { diff --git a/package.json b/package.json index 18a6b0a..e538e94 100644 --- a/package.json +++ b/package.json @@ -14,25 +14,25 @@ }, "devDependencies": { "@babel/core": "^7.5.4", + "@babel/eslint-parser": "^7.16.0", "@babel/preset-env": "^7.5.4", "@babel/preset-react": "^7.0.0", - "babel-eslint": "^10.0.3", "babel-loader": "^8.0.0", "chrome-remote-interface": "^0.28.0", "compression-webpack-plugin": "^1.1.11", "copy-webpack-plugin": "^4.5.2", "css-loader": "^3.0.0", - "eslint": "^6.3.0", + "eslint": "^7.10.0", "eslint-config-standard": "^14.1.0", "eslint-config-standard-react": "^9.2.0", - "eslint-loader": "^3.0.0", "eslint-plugin-flowtype": "^4.3.0", "eslint-plugin-import": "^2.18.2", "eslint-plugin-node": "^10.0.0", "eslint-plugin-promise": "^4.2.1", "eslint-plugin-react": "^7.14.3", - "eslint-plugin-react-hooks": "^2.1.2", + "eslint-plugin-react-hooks": "^4.2.0", "eslint-plugin-standard": "^4.0.1", + "eslint-webpack-plugin": "^2.5.3", "htmlparser": "^1.7.7", "jed": "^1.1.1", "mini-css-extract-plugin": "^0.9.0", diff --git a/webpack.config.js b/webpack.config.js index c5a1f53..8ae4f76 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -4,6 +4,7 @@ const extract = require("mini-css-extract-plugin"); const fs = require("fs"); const webpack = require("webpack"); const CompressionPlugin = require("compression-webpack-plugin"); +const ESLintPlugin = require('eslint-webpack-plugin'); var externals = { cockpit: "cockpit", @@ -76,7 +77,10 @@ info.files.forEach(function (value) { }); info.files = files; -var plugins = [new copy(info.files), new extract({ filename: "[name].css" })]; +var plugins = [ + new copy(info.files), new extract({ filename: "[name].css" }), + new ESLintPlugin({ extensions: ["js", "jsx"], exclude: ["spec", "node_modules", "src/lib"] }), +]; /* Only minimize when in production mode */ if (production) { @@ -125,12 +129,6 @@ module.exports = { devtool: "source-map", module: { rules: [ - { - enforce: "pre", - exclude: /node_modules/, - loader: "eslint-loader", - test: /\.(js|jsx)$/, - }, { exclude: /node_modules/, use: babel_loader,