Skip to content

Commit

Permalink
refactor: migrate to eslint v9
Browse files Browse the repository at this point in the history
  • Loading branch information
DuckyMomo20012 committed Feb 4, 2025
1 parent 1267bf2 commit af80972
Show file tree
Hide file tree
Showing 4 changed files with 397 additions and 480 deletions.
91 changes: 0 additions & 91 deletions .eslintrc.cjs

This file was deleted.

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

export default tseslint.config(
eslint.configs.recommended,
reactPlugin.configs.flat.recommended,
reactPlugin.configs.flat['jsx-runtime'],
// FIXME: Update to flat config when new update is released
{
plugins: { 'react-hooks': reactHooks },
},
// eslint-disable-next-line import/no-named-as-default-member
tseslint.configs.recommended,
importPlugin.flatConfigs.recommended,
importPlugin.flatConfigs.typescript,
jsxA11y.flatConfigs.recommended,
eslintPluginPrettierRecommended,
playwright.configs['flat/recommended'],
{
rules: {
// FIXME: Remove these rules after migrating to flat config
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'import/extensions': [
'warn',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
'import/no-unresolved': 'warn',
'import/order': [
'warn',
{
alphabetize: {
order: 'asc',
},
},
],
'import/prefer-default-export': 'off',
'no-param-reassign': 'off',
'prefer-destructuring': [
'warn',
{
array: false,
object: true,
},
],
'prettier/prettier': [
'error',
{
endOfLine: 'auto',
},
],
'react/jsx-sort-props': 'warn',
'sort-imports': [
'warn',
{
ignoreDeclarationSort: true,
},
],
'spaced-comment': ['warn', 'always', { markers: ['/'] }],
},
},
{
settings: {
react: {
version: 'detect',
},
'import/resolver': { typescript: {} },
},
},
);
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,24 @@
"@babel/core": "7.26.7",
"@commitlint/cli": "19.7.1",
"@commitlint/config-conventional": "19.7.1",
"@eslint/js": "9.19.0",
"@playwright/test": "1.50.1",
"@tailwindcss/postcss": "4.0.3",
"@tailwindcss/vite": "4.0.3",
"@types/react": "18.3.18",
"@types/react-dom": "18.3.5",
"@typescript-eslint/eslint-plugin": "7.18.0",
"@typescript-eslint/parser": "7.18.0",
"@vitejs/plugin-react": "4.3.4",
"@vitest/ui": "3.0.4",
"eslint": "8.57.1",
"eslint": "9.19.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-config-prettier": "9.1.0",
"eslint-config-prettier": "10.0.1",
"eslint-import-resolver-typescript": "3.7.0",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-jsx-a11y": "6.10.2",
"eslint-plugin-playwright": "1.8.3",
"eslint-plugin-playwright": "2.2.0",
"eslint-plugin-prettier": "5.2.3",
"eslint-plugin-react": "7.37.4",
"eslint-plugin-react-hooks": "4.6.2",
"eslint-plugin-react-hooks": "5.1.0",
"husky": "9.1.7",
"lint-staged": "15.4.3",
"postcss": "8.5.1",
Expand All @@ -65,6 +64,7 @@
"prettier-plugin-tailwindcss": "0.6.11",
"tailwindcss": "4.0.3",
"typescript": "5.7.3",
"typescript-eslint": "8.22.0",
"vite": "6.0.11",
"vitest": "3.0.4"
}
Expand Down
Loading

0 comments on commit af80972

Please sign in to comment.