Skip to content

Commit 4414e57

Browse files
committed
chore(web): update eslint deps to latest version
Which has implied, * Drop eslint-plugin-import in favor of eslint-plugin-import-x Since the eslint-plugin-import support for ESLint 9 is kind of a blocker for such an update at this moment. See import-js/eslint-plugin-import#2948 * Update eslint-plugin-react-hooks to an RC version For moving this update on without waiting until the support reach the @latest version. See facebook/react#30932 (comment) As commented at import-js/eslint-plugin-import#2948 (comment), > the ESLint plugin ecosystem is getting harder and harder to maintain, > and things get worse during major version upgrades.
1 parent d455bd4 commit 4414e57

File tree

5 files changed

+332
-630
lines changed

5 files changed

+332
-630
lines changed

web/.eslintignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

web/.eslintrc.json

Lines changed: 0 additions & 82 deletions
This file was deleted.

web/eslint.config.js

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
module.export = [
2+
{
3+
root: true,
4+
env: {
5+
browser: true,
6+
es6: true,
7+
jest: true,
8+
},
9+
extends: [
10+
"eslint:recommended",
11+
"standard",
12+
"standard-jsx",
13+
"standard-react",
14+
"plugin:@typescript-eslint/recommended",
15+
"prettier",
16+
],
17+
parser: "@typescript-eslint/parser",
18+
parserOptions: {
19+
ecmaVersion: 7,
20+
ecmaFeatures: {
21+
jsx: true,
22+
},
23+
sourceType: "module",
24+
},
25+
plugins: ["agama-i18n", "flowtype", "i18next", "react", "react-hooks", "@typescript-eslint"],
26+
rules: {
27+
"agama-i18n/string-literals": "error",
28+
"i18next/no-literal-string": "error",
29+
"no-var": "error",
30+
"no-multi-str": "off",
31+
"no-use-before-define": "off",
32+
"@typescript-eslint/no-unused-vars": "off",
33+
"@typescript-eslint/no-use-before-define": "warn",
34+
"@typescript-eslint/ban-ts-comment": "off",
35+
"lines-between-class-members": [
36+
"error",
37+
"always",
38+
{
39+
exceptAfterSingleLine: true,
40+
},
41+
],
42+
"prefer-promise-reject-errors": [
43+
"error",
44+
{
45+
allowEmptyReject: true,
46+
},
47+
],
48+
"react-hooks/rules-of-hooks": "error",
49+
"react-hooks/exhaustive-deps": "error",
50+
camelcase: "off",
51+
"comma-dangle": "off",
52+
curly: "off",
53+
"jsx-quotes": "off",
54+
"key-spacing": "off",
55+
"no-console": "off",
56+
quotes: "off",
57+
"react/jsx-curly-spacing": "off",
58+
"react/jsx-indent-props": "off",
59+
"react/prop-types": "off",
60+
"space-before-function-paren": "off",
61+
"n/no-callback-literal": "off",
62+
},
63+
overrides: [
64+
{
65+
// do not check translations in the testing or development files
66+
files: ["*.test.*", "test-utils.js"],
67+
rules: {
68+
"i18next/no-literal-string": "off",
69+
},
70+
},
71+
{
72+
// do not check translation arguments in the test, it checks some internals by passing variables
73+
files: ["i18n.test.js"],
74+
rules: {
75+
"agama-i18n/string-literals": "off",
76+
},
77+
},
78+
],
79+
globals: {
80+
require: false,
81+
module: false,
82+
},
83+
ignores: ["node_modules/*", "src/lib/*", "src/**/test-data/*"],
84+
},
85+
];

0 commit comments

Comments
 (0)