Skip to content

Commit 78170ff

Browse files
committed
Upgrade Eslint to 9.5.0"
This reverts commit 9a6d576.
1 parent b064699 commit 78170ff

File tree

6 files changed

+1195
-532
lines changed

6 files changed

+1195
-532
lines changed

.eslintignore

-1
This file was deleted.

.eslintrc.js

-65
This file was deleted.

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ repos:
44
hooks:
55
- id: shellcheck
66
- repo: https://github.com/pre-commit/mirrors-prettier
7-
rev: v2.2.1
7+
rev: v2.5.0
88
hooks:
99
- id: prettier
1010
- repo: https://github.com/igorshubovych/markdownlint-cli

eslint.config.mjs

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import globals from 'globals';
2+
import babelParser from '@babel/eslint-parser';
3+
import path from 'node:path';
4+
import { fileURLToPath } from 'node:url';
5+
import js from '@eslint/js';
6+
import { FlatCompat } from '@eslint/eslintrc';
7+
8+
const __filename = fileURLToPath(import.meta.url);
9+
const __dirname = path.dirname(__filename);
10+
const compat = new FlatCompat({
11+
baseDirectory: __dirname,
12+
recommendedConfig: js.configs.recommended,
13+
allConfig: js.configs.all,
14+
});
15+
16+
export default [
17+
{
18+
ignores: ['ui/glean/generated/*.js'],
19+
},
20+
...compat.extends(
21+
'plugin:prettier/recommended',
22+
'prettier',
23+
'plugin:jest/recommended',
24+
'plugin:jest/style',
25+
),
26+
{
27+
files: ['**/*.js', '**.*.jsx'],
28+
languageOptions: {
29+
globals: {
30+
page: true,
31+
browser: true,
32+
jestPuppeteer: true,
33+
},
34+
parser: babelParser,
35+
},
36+
37+
settings: {
38+
react: {
39+
version: '18.3',
40+
},
41+
},
42+
43+
ignores: ['ui/glean/generated/*.js'],
44+
45+
rules: {
46+
'class-methods-use-this': 'off',
47+
'consistent-return': 'off',
48+
'default-case': 'off',
49+
'default-param-last': 'off',
50+
'jsx-a11y/click-events-have-key-events': 'off',
51+
'no-alert': 'off',
52+
'no-continue': 'off',
53+
'no-param-reassign': 'off',
54+
'no-plusplus': 'off',
55+
'no-restricted-syntax': 'off',
56+
'no-shadow': 'off',
57+
'no-underscore-dangle': 'off',
58+
'prefer-promise-reject-errors': 'off',
59+
'react/destructuring-assignment': 'off',
60+
'react/function-component-definition': 'off',
61+
'react/jsx-fragments': 'off',
62+
'react/jsx-no-constructed-context-values': 'off',
63+
'react/jsx-no-script-url': 'off',
64+
'react/jsx-no-useless-fragment': 'off',
65+
'react/jsx-props-no-spreading': 'off',
66+
'react/no-arrow-function-lifecycle': 'off',
67+
'react/no-invalid-html-attribute': 'off',
68+
'react/no-namespace': 'off',
69+
'react/no-unstable-nested-components': 'off',
70+
'react/no-unused-class-component-methods': 'off',
71+
'react/prefer-exact-props': 'off',
72+
'react/prop-types': 'off',
73+
'react/sort-comp': [0, {}],
74+
},
75+
},
76+
];

package.json

+10-12
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
"victory": "36.6.12"
7676
},
7777
"devDependencies": {
78-
"@babel/eslint-parser": "7.22.15",
78+
"@babel/eslint-parser": "7.24.7",
7979
"@babel/plugin-proposal-class-properties": "7.17.12",
8080
"@babel/plugin-syntax-dynamic-import": "7.8.3",
8181
"@babel/preset-env": "7.17.12",
@@ -91,14 +91,12 @@
9191
"clean-webpack-plugin": "4.0.0",
9292
"copy-webpack-plugin": "12.0.2",
9393
"css-loader": "7.1.2",
94-
"eslint": "8.21.0",
95-
"eslint-config-airbnb": "19.0.4",
96-
"eslint-config-prettier": "9.0.0",
97-
"eslint-plugin-import": "2.26.0",
98-
"eslint-plugin-jest": "27.1.7",
99-
"eslint-plugin-jsx-a11y": "6.2.3",
100-
"eslint-plugin-prettier": "4.2.1",
101-
"eslint-plugin-react": "7.16.0",
94+
"eslint": "9.5.0",
95+
"eslint-config-prettier": "9.1.0",
96+
"eslint-plugin-jest": "28.6.0",
97+
"eslint-plugin-jsx-a11y": "6.9.0",
98+
"eslint-plugin-prettier": "5.1.3",
99+
"eslint-plugin-react": "7.34.3",
102100
"fetch-mock": "9.4.0",
103101
"html-loader": "4.2.0",
104102
"html-webpack-plugin": "5.5.4",
@@ -108,7 +106,7 @@
108106
"markdownlint-cli": "0.32.2",
109107
"mini-css-extract-plugin": "2.6.1",
110108
"path": "0.12.7",
111-
"prettier": "2.0.5",
109+
"prettier": "3.0.0",
112110
"puppeteer": "21.10.0",
113111
"setup-polly-jest": "0.9.1",
114112
"style-loader": "3.3.4",
@@ -123,8 +121,8 @@
123121
"build:glean": "node ./node_modules/@mozilla/glean/dist/cli/cli.js translate ui/glean/metrics.yaml ui/glean/pings.yaml -f javascript -o ui/glean/generated",
124122
"format": "node ./node_modules/prettier/bin-prettier.js --write \"**/*.{css,html,js,jsx,json,md,yaml,yml}\"",
125123
"format:check": "node ./node_modules/prettier/bin-prettier.js --check \"**/*.{css,html,js,jsx,json,md,yaml,yml}\"",
126-
"lint": "node ./node_modules/eslint/bin/eslint.js --report-unused-disable-directives --max-warnings 0 --format codeframe --ext js,jsx \".*.js\" \"*.js\" ui/ tests/ui/",
127-
"lint-with-cache": "node ./node_modules/eslint/bin/eslint.js --cache --report-unused-disable-directives --max-warnings 0 --format codeframe --ext js,jsx \".*.js\" \"*.js\" ui/ tests/ui/",
124+
"lint": "node ./node_modules/eslint/bin/eslint.js --report-unused-disable-directives --max-warnings 0 --format codeframe ui/ tests/ui/",
125+
"lint-with-cache": "node ./node_modules/eslint/bin/eslint.js --cache --report-unused-disable-directives --max-warnings 0 --format codeframe ui/ tests/ui/",
128126
"lint:glean": "node ./node_modules/@mozilla/glean/dist/cli/cli.js glinter ui/glean/metrics.yaml ui/glean/pings.yaml",
129127
"markdownlint": "node ./node_modules/markdownlint-cli/markdownlint.js -c .markdownlint.json -p .markdownlintignore .",
130128
"prettier": "npx prettier --check .",

0 commit comments

Comments
 (0)