Skip to content

Commit

Permalink
chore(eslint): migrate to eslint 9 flat config (#78)
Browse files Browse the repository at this point in the history
* chore(eslint): migrate to eslint 9 flat config

* tweak ignores

* update deps

* update react hooks & compiler
  • Loading branch information
dai-shi authored Jan 26, 2025
1 parent 8016638 commit b0ffac5
Show file tree
Hide file tree
Showing 8 changed files with 4,156 additions and 2,726 deletions.
34 changes: 0 additions & 34 deletions .eslintrc.cjs

This file was deleted.

31 changes: 31 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
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';
import reactCompiler from 'eslint-plugin-react-compiler';

export default tseslint.config(
{ ignores: ['dist/', 'website/'] },
eslint.configs.recommended,
tseslint.configs.recommended,
importPlugin.flatConfigs.recommended,
jsxA11y.flatConfigs.recommended,
react.configs.flat.recommended,
react.configs.flat['jsx-runtime'],
reactHooks.configs['recommended-latest'],
reactCompiler.configs.recommended,
{
settings: {
'import/resolver': { typescript: true },
react: { version: 'detect' },
},
rules: {
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
},
},
);
30 changes: 19 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"src",
"dist"
],
"packageManager": "pnpm@8.15.0",
"packageManager": "pnpm@9.4.0",
"scripts": {
"compile": "rm -rf dist && pnpm run '/^compile:.*/'",
"compile:esm": "tsc -p tsconfig.esm.json",
Expand All @@ -53,18 +53,26 @@
"singleQuote": true
},
"devDependencies": {
"@types/node": "^22.9.1",
"@typescript-eslint/eslint-plugin": "^8.15.0",
"@typescript-eslint/parser": "^8.15.0",
"@eslint/js": "^9.19.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.2.0",
"@testing-library/user-event": "^14.6.1",
"@types/node": "^22.10.10",
"documentation": "^14.0.3",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint": "^9.19.0",
"eslint-import-resolver-typescript": "^3.7.0",
"eslint-plugin-import": "^2.31.0",
"prettier": "^3.3.3",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-react": "^7.37.4",
"eslint-plugin-react-compiler": "19.0.0-beta-decd7b8-20250118",
"eslint-plugin-react-hooks": "5.2.0-canary-de1eaa26-20250124",
"happy-dom": "^16.7.2",
"prettier": "^3.4.2",
"ts-expect": "^1.3.0",
"typescript": "^5.6.3",
"vite": "^5.4.11",
"vitest": "^2.1.5"
"typescript": "^5.7.3",
"typescript-eslint": "^8.21.0",
"vite": "^6.0.11",
"vite-tsconfig-paths": "^5.1.4",
"vitest": "^3.0.4"
}
}
Loading

0 comments on commit b0ffac5

Please sign in to comment.