diff --git a/.eslintrc.json b/.eslintrc.json index 05bf33b..4572422 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 051cbd8..e4945eb 100644 --- a/package.json +++ b/package.json @@ -13,9 +13,9 @@ }, "devDependencies": { "@babel/core": "^7.5.4", + "@babel/eslint-parser": "^7.13.14", "@babel/preset-env": "^7.5.4", "@babel/preset-react": "^7.0.0", - "babel-eslint": "^10.0.3", "babel-loader": "^8.0.6", "chrome-remote-interface": "^0.28.0", "compression-webpack-plugin": "^6.0.0", @@ -24,7 +24,6 @@ "eslint": "^7.10.0", "eslint-config-standard": "^14.1.1", "eslint-config-standard-react": "^9.2.0", - "eslint-loader": "^4.0.2", "eslint-plugin-flowtype": "^5.2.0", "eslint-plugin-import": "^2.22.1", "eslint-plugin-node": "^11.1.0", @@ -32,6 +31,7 @@ "eslint-plugin-react": "^7.21.2", "eslint-plugin-react-hooks": "^4.1.2", "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.11.0", diff --git a/webpack.config.js b/webpack.config.js index 00295cb..6f556bc 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -6,6 +6,7 @@ const extract = require("mini-css-extract-plugin"); const TerserJSPlugin = require('terser-webpack-plugin'); const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin'); const CompressionPlugin = require("compression-webpack-plugin"); +const ESLintPlugin = require('eslint-webpack-plugin'); const CockpitPoPlugin = require("./src/lib/cockpit-po-plugin"); const webpack = require("webpack"); @@ -24,6 +25,7 @@ const copy_files = [ const plugins = [ new copy({ patterns: copy_files }), new extract({filename: "[name].css"}), + new ESLintPlugin({ extensions: ["js", "jsx"] }), new CockpitPoPlugin(), ]; @@ -73,12 +75,6 @@ module.exports = { module: { rules: [ - { - enforce: 'pre', - exclude: /node_modules/, - loader: 'eslint-loader', - test: /\.(js|jsx)$/ - }, { exclude: /node_modules/, use: "babel-loader",