Skip to content

Commit ed198a4

Browse files
committed
fix: lint
1 parent 0b80792 commit ed198a4

File tree

4 files changed

+228
-56
lines changed

4 files changed

+228
-56
lines changed

eslint.config.js

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,41 @@ export default [
1616
},
1717
},
1818
globals: {
19-
browser: true,
20-
es6: true,
21-
node: true,
22-
jest: true,
19+
// Browser globals
20+
window: 'readonly',
21+
document: 'readonly',
22+
HTMLElement: 'readonly',
23+
HTMLDivElement: 'readonly',
24+
DOMRect: 'readonly',
25+
console: 'readonly',
26+
global: 'readonly',
27+
// Jest globals
28+
describe: 'readonly',
29+
it: 'readonly',
30+
test: 'readonly',
31+
expect: 'readonly',
32+
beforeEach: 'readonly',
33+
afterEach: 'readonly',
34+
beforeAll: 'readonly',
35+
afterAll: 'readonly',
36+
jest: 'readonly',
37+
// React
38+
React: 'readonly',
2339
},
2440
},
2541
plugins: {
2642
'@typescript-eslint': typescript,
2743
},
2844
rules: {
2945
...typescript.configs.recommended.rules,
46+
// Relax some strict rules
47+
'@typescript-eslint/no-explicit-any': 'warn',
48+
'@typescript-eslint/no-unused-vars': 'warn',
49+
'@typescript-eslint/no-empty-object-type': 'off',
50+
'@typescript-eslint/ban-ts-comment': 'warn',
51+
'no-undef': 'off', // TypeScript handles this
52+
'no-empty': 'warn',
53+
'no-redeclare': 'off', // Jest globals conflict with built-ins
3054
},
3155
},
3256
{

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"test": "jest --passWithNoTests",
3535
"test:coverage": "jest --passWithNoTests --coverage",
3636
"prettier": "prettier ./ --write",
37-
"lint": "echo 'Linting disabled during TSDOWN migration'",
37+
"lint": "eslint src --ext .ts,.tsx",
3838
"prepare": "tsdown",
3939
"size": "size-limit",
4040
"analyze": "size-limit --why",
@@ -89,7 +89,7 @@
8989
"license": "MIT",
9090
"husky": {
9191
"hooks": {
92-
"pre-commit": "echo 'Linting disabled during TSDOWN migration'"
92+
"pre-commit": "eslint src --ext .ts,.tsx"
9393
}
9494
},
9595
"prettier": {
@@ -128,6 +128,8 @@
128128
"@types/jest": "^27.0.3",
129129
"@types/react": "^17.0.35",
130130
"@types/react-dom": "^17.0.11",
131+
"@typescript-eslint/eslint-plugin": "^8.44.1",
132+
"@typescript-eslint/parser": "^8.44.1",
131133
"babel-jest": "^27.5.1",
132134
"babel-loader": "^8.2.4",
133135
"css-loader": "^5.0.0",

0 commit comments

Comments
 (0)