Skip to content

Commit fa55ab9

Browse files
committed
Install and configure ESlint
1 parent 071d47c commit fa55ab9

File tree

6 files changed

+943
-992
lines changed

6 files changed

+943
-992
lines changed

.eslintignore

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

.eslintrc.js

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

eslint.config.mjs

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import js from '@eslint/js'
2+
import globals from 'globals'
3+
import reactHooks from 'eslint-plugin-react-hooks'
4+
import reactPlugin from 'eslint-plugin-react'
5+
import tseslint from 'typescript-eslint'
6+
7+
export default tseslint.config(
8+
{
9+
// Adjust these ignores to match your component project structure
10+
ignores: ['node_modules', 'dist', 'build', 'demo', '.rollup.cache'],
11+
},
12+
{
13+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
14+
files: ['**/*.{ts,tsx}'],
15+
languageOptions: {
16+
ecmaVersion: 2020,
17+
globals: {
18+
...globals.browser,
19+
React: 'readonly',
20+
},
21+
},
22+
plugins: {
23+
react: reactPlugin,
24+
'react-hooks': reactHooks,
25+
},
26+
rules: {
27+
...reactPlugin.configs.recommended.rules,
28+
...reactHooks.configs.recommended.rules,
29+
'react/prop-types': 'off',
30+
// Keep React in JSX scope for React 16 compatibility
31+
'react/react-in-jsx-scope': 'error',
32+
},
33+
settings: {
34+
react: {
35+
version: 'detect',
36+
},
37+
},
38+
},
39+
// Add JavaScript files support
40+
{
41+
extends: [js.configs.recommended],
42+
files: ['**/*.{js,jsx}'],
43+
languageOptions: {
44+
ecmaVersion: 2020,
45+
globals: {
46+
...globals.browser,
47+
React: 'readonly',
48+
},
49+
},
50+
plugins: {
51+
react: reactPlugin,
52+
'react-hooks': reactHooks,
53+
},
54+
rules: {
55+
...reactPlugin.configs.recommended.rules,
56+
...reactHooks.configs.recommended.rules,
57+
'react/prop-types': 'off',
58+
// Keep React in JSX scope for React 16 compatibility
59+
'react/react-in-jsx-scope': 'error',
60+
},
61+
settings: {
62+
react: {
63+
version: 'detect',
64+
},
65+
},
66+
}
67+
)

jest.config.js

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

package.json

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,24 +51,21 @@
5151
"object-property-extractor": "^1.0.13"
5252
},
5353
"devDependencies": {
54+
"@eslint/js": "^9.24.0",
5455
"@rollup/plugin-node-resolve": "^16.0.0",
5556
"@rollup/plugin-terser": "^0.4.4",
5657
"@rollup/plugin-typescript": "^11.1.6",
5758
"@types/jest": "^29.5.14",
5859
"@types/node": "^20.11.17",
5960
"@types/react": ">=16.0.0",
60-
"@typescript-eslint/eslint-plugin": "^6.4.0",
61-
"eslint": "^8.0.1",
62-
"eslint-config-prettier": "^9.1.0",
63-
"eslint-config-standard-with-typescript": "^43.0.1",
64-
"eslint-plugin-import": "^2.25.2",
65-
"eslint-plugin-n": "^15.0.0 || ^16.0.0 ",
66-
"eslint-plugin-promise": "^6.0.0",
67-
"eslint-plugin-react": "^7.33.2",
68-
"eslint-plugin-react-hooks": "^4.6.0",
61+
"eslint": "^9.24.0",
62+
"eslint-plugin-react": "^7.37.5",
63+
"eslint-plugin-react-hooks": "^5.2.0",
6964
"fs-extra": "^11.2.0",
65+
"globals": "^16.0.0",
7066
"jest": "^29.7.0",
71-
"react-dom": ">=16.0.0",
67+
"react": "^19.1.0",
68+
"react-dom": "^19.1.0",
7269
"rimraf": "^5.0.5",
7370
"rollup": "^4.10.0",
7471
"rollup-plugin-bundle-size": "^1.0.3",
@@ -79,7 +76,8 @@
7976
"ts-jest": "^29.2.5",
8077
"ts-node": "^10.9.2",
8178
"tslib": "^2.6.2",
82-
"typescript": "^5.3.3"
79+
"typescript": "^5.3.3",
80+
"typescript-eslint": "^8.29.1"
8381
},
8482
"keywords": [
8583
"react",

0 commit comments

Comments
 (0)