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 Jan 13, 2025
1 parent e2aa105 commit fbf7ca4
Show file tree
Hide file tree
Showing 8 changed files with 4,327 additions and 2,946 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 { FlatCompat } from '@eslint/eslintrc';
import tseslint from 'typescript-eslint';
import importPlugin from 'eslint-plugin-import';
import jsxA11y from 'eslint-plugin-jsx-a11y';
import react from 'eslint-plugin-react';

const compat = new FlatCompat();

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'],
...compat.extends('plugin:react-hooks/recommended'),
{
settings: {
'import/resolver': { typescript: true },
react: { version: 'detect' },
},
rules: {
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
},
},
);
33 changes: 21 additions & 12 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 @@ -54,19 +54,28 @@
"proxy-compare": "^3.0.0"
},
"devDependencies": {
"@types/node": "^20.12.8",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"@eslint/js": "^9.18.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.5",
"@typescript-eslint/eslint-plugin": "^8.19.1",
"@typescript-eslint/parser": "^8.19.1",
"documentation": "^14.0.3",
"eslint": "8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.29.1",
"eslint": "^9.18.0",
"eslint-import-resolver-typescript": "^3.7.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-react": "^7.37.4",
"eslint-plugin-react-hooks": "^5.1.0",
"happy-dom": "^16.5.3",
"immer": "^10.1.1",
"prettier": "^3.2.5",
"prettier": "^3.4.2",
"ts-expect": "^1.3.0",
"typescript": "^5.4.5",
"vite": "^5.2.10",
"vitest": "^1.5.3"
"typescript": "^5.7.3",
"typescript-eslint": "^8.19.1",
"vite": "^6.0.7",
"vite-tsconfig-paths": "^5.1.4",
"vitest": "^2.1.8"
}
}
Loading

0 comments on commit fbf7ca4

Please sign in to comment.