Use current babel/eslint integration

Fixes these `npm install` warnings:

> deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
> deprecated eslint-loader@4.0.2: This loader has been deprecated. Please use eslint-webpack-plugin

Cherry-picked from starter-kit commit 0e608d562a.
This commit is contained in:
Martin Pitt 2021-04-12 07:13:08 +02:00 committed by Katerina Koukiou
parent f5e709ca60
commit c84c3dbfb6
3 changed files with 7 additions and 9 deletions

View File

@ -5,7 +5,7 @@
"es6": true
},
"extends": ["eslint:recommended", "standard", "standard-jsx", "standard-react", "plugin:jsx-a11y/recommended"],
"parser": "babel-eslint",
"parser": "@babel/eslint-parser",
"parserOptions": {
"ecmaVersion": "7",
"ecmaFeatures": {

View File

@ -31,10 +31,10 @@
},
"devDependencies": {
"@babel/core": "^7.9.0",
"@babel/eslint-parser": "^7.13.14",
"@babel/preset-env": "^7.9.0",
"@babel/preset-react": "^7.9.4",
"axe-core": "^3.5.2",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.1.0",
"chrome-remote-interface": "^0.28.1",
"copy-webpack-plugin": "^5.1.1",
@ -43,7 +43,6 @@
"eslint-config-standard": "^14.1.1",
"eslint-config-standard-jsx": "^10.0.0",
"eslint-config-standard-react": "^11.0.0",
"eslint-loader": "^4.0.2",
"eslint-plugin-cockpit": "file:eslint-plugin-cockpit",
"eslint-plugin-flowtype": "^5.2.0",
"eslint-plugin-import": "^2.22.1",
@ -53,6 +52,7 @@
"eslint-plugin-react": "^7.21.0",
"eslint-plugin-react-hooks": "^4.1.2",
"eslint-plugin-standard": "^4.0.1",
"eslint-webpack-plugin": "^2.5.3",
"expose-loader": "^1.0.1",
"html-webpack-plugin": "^4.0.1",
"htmlparser": "^1.7.7",

View File

@ -249,6 +249,7 @@ const copy = require("copy-webpack-plugin");
const html = require('html-webpack-plugin');
const miniCssExtractPlugin = require('mini-css-extract-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const ESLintPlugin = require('eslint-webpack-plugin');
const CockpitPoPlugin = require("./pkg/lib/cockpit-po-plugin");
const IncludedModulesPlugin = require("./pkg/lib/included-modules-plugin");
@ -357,6 +358,9 @@ const plugins = [
}),
];
if (eslint)
plugins.push(new ESLintPlugin({ extensions: ["js", "jsx"] }));
if (section.startsWith('base1'))
plugins.push(new copy(base1_fonts));
@ -431,12 +435,6 @@ module.exports = {
module: {
rules: [
{
enforce: 'pre',
test: eslint ? /\.(js|jsx)$/ : /dont.match.me/,
exclude: /\/node_modules\/.*\//, // exclude external dependencies
loader: "eslint-loader"
},
// bootstrap UI requires jQuery to be in the global namespace
// only expose that to pages which need it, as we want to port to React and get rid of jQuery
{