Skip to content

Commit

Permalink
Use current babel/eslint integration
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
martinpitt authored and KKoukiou committed Apr 12, 2021
1 parent f5e709c commit c84c3db
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down
10 changes: 4 additions & 6 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down Expand Up @@ -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));

Expand Down Expand Up @@ -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
{
Expand Down

0 comments on commit c84c3db

Please sign in to comment.