Skip to content

Commit

Permalink
chore(eslint): migrate to eslint 9 flat config
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi committed Dec 22, 2024
1 parent 6d90496 commit f42a19f
Show file tree
Hide file tree
Showing 4 changed files with 347 additions and 397 deletions.
39 changes: 0 additions & 39 deletions .eslintrc.cjs

This file was deleted.

41 changes: 41 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import importPlugin from 'eslint-plugin-import';
import jsxA11y from 'eslint-plugin-jsx-a11y';
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';

export default tseslint.config(
eslint.configs.recommended,
tseslint.configs.recommended,
importPlugin.flatConfigs.recommended,
jsxA11y.flatConfigs.recommended,
react.configs.flat.recommended,
react.configs.flat['jsx-runtime'],
{
settings: {
'import/resolver': {
typescript: true,
alias: {
map: [['jotai-valtio', './src/index.ts']],
},
},
react: {
version: 'detect',
},
},
plugins: {
'react-hooks': reactHooks,
},
rules: {
...reactHooks.configs.recommended.rules,
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
},
},
{
ignores: ['dist/'],
},
);
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,15 @@
"singleQuote": true
},
"devDependencies": {
"@eslint/js": "^9.17.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.1.0",
"@testing-library/user-event": "^14.5.2",
"@types/node": "^22.10.2",
"@types/react": "^19.0.2",
"@types/react-dom": "^19.0.2",
"@typescript-eslint/eslint-plugin": "^8.18.1",
"@typescript-eslint/parser": "^8.18.1",
"eslint": "8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint": "^9.17.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-import-resolver-typescript": "^3.7.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
Expand All @@ -80,6 +79,7 @@
"react-dom": "^19.0.0",
"ts-expect": "^1.3.0",
"typescript": "^5.7.2",
"typescript-eslint": "^8.18.1",
"valtio": "^2.1.2",
"vite": "^6.0.4",
"vitest": "^2.1.8"
Expand Down
Loading

0 comments on commit f42a19f

Please sign in to comment.