Skip to content

Commit c80c1cc

Browse files
committed
chore: add eslint-plugin-react-hooks and configure eslint
1 parent acfeef3 commit c80c1cc

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

eslint.config.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// @ts-check
2+
3+
import eslint from '@eslint/js';
4+
import tseslint from 'typescript-eslint';
5+
import react from 'eslint-plugin-react';
6+
import reactHooks from 'eslint-plugin-react-hooks';
7+
import globals from 'globals';
8+
9+
export default tseslint.config(
10+
{
11+
files: ['src/**/*.{js,jsx,mjs,cjs,ts,tsx}'],
12+
extends: [
13+
eslint.configs.recommended,
14+
...tseslint.configs.recommendedTypeChecked,
15+
],
16+
plugins: {
17+
react,
18+
'react-hooks': reactHooks
19+
},
20+
languageOptions: {
21+
parserOptions: {
22+
ecmaVersion: 'latest',
23+
sourceType: 'module',
24+
ecmaFeatures: {
25+
jsx: true,
26+
},
27+
},
28+
globals: {
29+
...globals.browser,
30+
},
31+
},
32+
rules: {
33+
'@typescript-eslint/no-unused-expressions': 0,
34+
},
35+
}
36+
);

package-lock.json

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"cross-env": "^7.0.3",
3535
"eslint": "^9.23.0",
3636
"eslint-plugin-react": "^7.37.4",
37+
"eslint-plugin-react-hooks": "^5.2.0",
3738
"gh-pages": "^6.1.1",
3839
"globals": "^15.2.0",
3940
"typescript": "^5.8.2",

0 commit comments

Comments
 (0)