Skip to content

Commit b3fb6c0

Browse files
authored
Update vite and eslint configs (#176)
* remove configuration for vitest, it's in vite.config.ts now * use typescript in vite config for coherence * detail: force error for exhaustive-deps (and don't rely on outdated 'recommended' config of react hooks) * use vite.config.ts for coverage as well as for test * load all the rules and only overrride the non default one
1 parent 65d7393 commit b3fb6c0

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

eslint.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default typescript.config(
2525
rules: {
2626
...react.configs.recommended.rules,
2727
...react.configs['jsx-runtime'].rules,
28-
...reactHooks.configs.recommended.rules,
28+
...reactHooks.configs['recommended-latest'].rules,
2929
'react-refresh/only-export-components': [
3030
'warn',
3131
{ allowConstantExport: true },
@@ -78,6 +78,8 @@ export default typescript.config(
7878
'@typescript-eslint/restrict-template-expressions': 'off',
7979
'@typescript-eslint/no-unused-vars': 'warn',
8080
'@typescript-eslint/require-await': 'warn',
81+
// react hooks
82+
'react-hooks/exhaustive-deps': 'error',
8183
},
8284
settings: { react: { version: 'detect' } },
8385
},

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
],
2929
"scripts": {
3030
"build:types": "tsc -b",
31-
"build:lib": "vite build -c vite.lib.config.js",
31+
"build:lib": "vite build -c vite.lib.config.ts",
3232
"build:app": "vite build",
3333
"build": "run-s build:lib build:types build:app",
34-
"coverage": "vitest run -c vite.lib.config.js --coverage --coverage.include=src --coverage.include=bin",
34+
"coverage": "vitest run --coverage --coverage.include=src --coverage.include=bin",
3535
"dev": "run-p -l watch:ts watch:vite watch:serve",
3636
"lint": "eslint",
3737
"lint:fix": "eslint --fix",
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,4 @@ export default defineConfig({
2929
},
3030
sourcemap: true,
3131
},
32-
test: { environment: 'jsdom', globals: true },
3332
})

0 commit comments

Comments
 (0)