Skip to content

Commit 401b6a4

Browse files
committed
Update eslint
1 parent 6047456 commit 401b6a4

9 files changed

Lines changed: 543 additions & 438 deletions

File tree

.eslintignore

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

.eslintrc

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

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ jobs:
1010
steps:
1111
- uses: actions/checkout@v4
1212
- name: Install modules
13-
run: yarn
13+
run: pnpm i
1414
- name: Run ESLint
15-
run: yarn eslint
15+
run: pnpm eslint

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,21 @@ This website is built using [Docusaurus](https://docusaurus.io/), a modern stati
2929
### Installation
3030

3131
```
32-
$ yarn
32+
$ pnpm i
3333
```
3434

3535
### Local Development
3636

3737
```
38-
$ yarn start
38+
$ pnpm run start
3939
```
4040

4141
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
4242

4343
### Build
4444

4545
```
46-
$ yarn build
46+
$ pnpm run build
4747
```
4848

4949
This command generates static content into the `build` directory and can be served using any static contents hosting service.

eslint.config.mjs

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
// @ts-check
2+
3+
import * as globals from "globals";
4+
5+
import eslint from "@eslint/js";
6+
import tseslint from "typescript-eslint";
7+
import { flatConfigs as importPlugin } from "eslint-plugin-import";
8+
import reactPlugin from "eslint-plugin-react";
9+
import reactHooksPlugin from "eslint-plugin-react-hooks";
10+
import jsxA11yPugin from "eslint-plugin-jsx-a11y";
11+
import prettierPlugin from "eslint-plugin-prettier/recommended";
12+
13+
export default tseslint.config(
14+
{
15+
ignores: [
16+
"**/.idea/",
17+
"**/.vscode/",
18+
"**/.docusaurus/",
19+
"**/node_modules/",
20+
"build/",
21+
],
22+
},
23+
{
24+
extends: [
25+
eslint.configs.recommended,
26+
...tseslint.configs.recommendedTypeChecked,
27+
importPlugin.recommended,
28+
reactPlugin.configs.flat?.recommended,
29+
reactPlugin.configs.flat?.["jsx-runtime"],
30+
{
31+
plugins: { "react-hooks": reactHooksPlugin },
32+
rules: { ...reactHooksPlugin.configs.recommended.rules },
33+
},
34+
jsxA11yPugin.flatConfigs.recommended,
35+
prettierPlugin,
36+
],
37+
38+
languageOptions: {
39+
...reactPlugin.configs.flat?.recommended.languageOptions,
40+
41+
globals: {
42+
...globals.browser,
43+
...globals.node,
44+
window: true,
45+
},
46+
47+
ecmaVersion: 5,
48+
sourceType: "commonjs",
49+
50+
parserOptions: {
51+
// projectService: true,
52+
projectService: {
53+
// allowDefaultProject: ["eslint.config.mjs"],
54+
defaultProject: "tsconfig.json",
55+
},
56+
tsconfigRootDir: import.meta.dirname,
57+
},
58+
},
59+
60+
settings: {
61+
react: {
62+
version: "detect",
63+
},
64+
65+
"import/extensions": [".ts", ".tsx"],
66+
67+
"import/resolver": {
68+
node: {
69+
paths: ["front"],
70+
},
71+
},
72+
},
73+
74+
rules: {
75+
"react/jsx-uses-react": 2,
76+
"@typescript-eslint/no-unused-vars": 2,
77+
78+
// TODO Need to fix the errors in project and delete all the rows below
79+
// basic
80+
"no-async-promise-executor": 0,
81+
"import/no-unresolved": 0,
82+
83+
// react
84+
"react/prop-types": 0,
85+
"react/no-find-dom-node": 0,
86+
"react/no-unescaped-entities": 0,
87+
"react-hooks/exhaustive-deps": 0,
88+
89+
// ts
90+
"@typescript-eslint/no-unsafe-member-access": 0,
91+
"@typescript-eslint/no-unsafe-assignment": 0,
92+
"@typescript-eslint/no-unsafe-call": 0,
93+
"@typescript-eslint/no-unsafe-argument": 0,
94+
"@typescript-eslint/no-unsafe-return": 0,
95+
"@typescript-eslint/no-explicit-any": 0,
96+
"@typescript-eslint/restrict-template-expressions": 0,
97+
"@typescript-eslint/restrict-plus-operands": 0,
98+
"@typescript-eslint/no-floating-promises": 0,
99+
"@typescript-eslint/no-misused-promises": 0,
100+
"@typescript-eslint/no-empty-interface": 0,
101+
102+
// a11y
103+
"jsx-a11y/click-events-have-key-events": 0,
104+
"jsx-a11y/no-static-element-interactions": 0,
105+
"jsx-a11y/img-redundant-alt": 0,
106+
"jsx-a11y/alt-text": 0,
107+
"jsx-a11y/interactive-supports-focus": 0,
108+
},
109+
},
110+
);

lefthook.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ pre-commit:
22
parallel: true
33
commands:
44
eslint:
5-
glob: "*.{js,ts,jsx,tsx}"
6-
run: yarn eslint {staged_files}
5+
glob: "*.{js,ts,jsx,tsx,mjs}"
6+
run: pnpm eslint {staged_files}
77
typecheck:
8-
glob: "*.{js,ts,jsx,tsx}"
9-
run: yarn run typecheck
8+
glob: "*.{js,ts,jsx,tsx,mjs}"
9+
run: pnpm run typecheck
1010

1111
pre-push:
1212
commands:

package.json

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,33 @@
1919
"@docusaurus/preset-classic": "^3.1.1",
2020
"@mdx-js/react": "^3.0.0",
2121
"clsx": "^1.2.1",
22+
"mdast-util-mdx-jsx": "3.1.3",
2223
"prism-react-renderer": "^2.1.0",
2324
"prismjs": "^1.29.0",
2425
"react": "^18.2.0",
25-
"react-dom": "^18.2.0"
26+
"react-dom": "^18.2.0",
27+
"unified": "11.0.5",
28+
"unist-util-visit": "5.0.0"
2629
},
2730
"devDependencies": {
2831
"@docusaurus/module-type-aliases": "^3.1.1",
2932
"@docusaurus/tsconfig": "^3.1.1",
3033
"@docusaurus/types": "^3.1.1",
34+
"@eslint/js": "^9.14.0",
3135
"@evilmartians/lefthook": "^1.5.2",
32-
"@typescript-eslint/eslint-plugin": "^6.9.1",
33-
"@typescript-eslint/parser": "^6.9.1",
34-
"eslint": "^8.52.0",
35-
"eslint-config-prettier": "^9.0.0",
36+
"@types/mdast": "4.0.4",
37+
"eslint": "^9.14.0",
38+
"eslint-config-prettier": "^9.1.0",
3639
"eslint-import-resolver-alias": "^1.1.2",
37-
"eslint-plugin-import": "^2.29.0",
38-
"eslint-plugin-jsx-a11y": "^6.8.0",
39-
"eslint-plugin-prettier": "^5.0.1",
40-
"eslint-plugin-react": "^7.33.2",
41-
"eslint-plugin-react-hooks": "^4.6.0",
42-
"prettier": "^3.0.3",
43-
"typescript": "~5.2.2",
40+
"eslint-plugin-import": "^2.31.0",
41+
"eslint-plugin-jsx-a11y": "^6.10.0",
42+
"eslint-plugin-prettier": "^5.2.1",
43+
"eslint-plugin-react": "^7.37.2",
44+
"eslint-plugin-react-hooks": "^5.0.0",
45+
"globals": "^15.12.0",
46+
"prettier": "^3.3.3",
47+
"typescript": "^5.6.2",
48+
"typescript-eslint": "^8.13.0",
4449
"utility-types": "^3.11.0"
4550
},
4651
"browserslist": {

0 commit comments

Comments
 (0)