Skip to content

Commit 58590de

Browse files
committed
fix: add eslint deps and config
1 parent 3ca1f6d commit 58590de

File tree

3 files changed

+2205
-4
lines changed

3 files changed

+2205
-4
lines changed

eslint.config.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import eslintJs from '@eslint/js';
2+
import { defineConfig, globalIgnores } from 'eslint/config';
3+
import react from 'eslint-plugin-react';
4+
import globals from 'globals';
5+
import tseslint from 'typescript-eslint';
6+
7+
export default defineConfig([
8+
globalIgnores(['dist']),
9+
{
10+
files: ['**/*.js'],
11+
extends: [
12+
eslintJs.configs.recommended
13+
]
14+
},
15+
{
16+
files: ['**/*.js', '**/*.ts', '**/*.tsx'],
17+
extends: [
18+
tseslint.configs.recommended
19+
]
20+
},
21+
{
22+
files: ['**/*.ts', '**/*.tsx'],
23+
extends: [
24+
react.configs.flat.recommended,
25+
react.configs.flat['jsx-runtime']
26+
],
27+
languageOptions: {
28+
parser: tseslint.parser,
29+
parserOptions: {
30+
ecmaFeatures: {
31+
jsx: true
32+
}
33+
},
34+
globals: {
35+
...globals.browser
36+
}
37+
},
38+
settings: {
39+
react: {
40+
version: 'detect'
41+
}
42+
}
43+
}
44+
]);

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,31 @@
3333
"scripts": {
3434
"build": "tsdown",
3535
"dev": "tsdown --watch",
36+
"lint": "eslint .",
3637
"playground": "vite --config playground/vite.config.ts",
3738
"test": "vitest",
3839
"typecheck": "tsc --noEmit",
3940
"release": "bumpp && pnpm publish",
4041
"prepublishOnly": "pnpm run build"
4142
},
4243
"devDependencies": {
44+
"@eslint/js": "^9.37.0",
4345
"@testing-library/jest-dom": "^6.6.3",
4446
"@testing-library/react": "^16.3.0",
4547
"@types/node": "^22.15.17",
4648
"@types/react": "^19.1.3",
4749
"@types/react-dom": "^19.1.4",
4850
"@vitejs/plugin-react": "^4.4.1",
4951
"bumpp": "^10.1.0",
52+
"eslint": "^9.37.0",
53+
"eslint-plugin-react": "^7.37.5",
54+
"globals": "^16.4.0",
5055
"happy-dom": "^17.4.6",
5156
"react": "^19.1.0",
5257
"react-dom": "^19.1.0",
5358
"tsdown": "^0.11.1",
5459
"typescript": "^5.8.3",
60+
"typescript-eslint": "^8.46.0",
5561
"vite": "npm:rolldown-vite@latest",
5662
"vitest": "^3.1.3"
5763
}

0 commit comments

Comments
 (0)