Skip to content

Commit

Permalink
Upadting eslint with new flat config
Browse files Browse the repository at this point in the history
  • Loading branch information
corbanbrook committed Jan 21, 2025
1 parent bfb6912 commit 94a9190
Show file tree
Hide file tree
Showing 6 changed files with 1,028 additions and 1,199 deletions.
65 changes: 0 additions & 65 deletions .eslintrc

This file was deleted.

60 changes: 60 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import eslint from '@eslint/js'
import tseslint from 'typescript-eslint'

import reactHooksPlugin from 'eslint-plugin-react-hooks'
import importPlugin from 'eslint-plugin-import'

export default tseslint.config(eslint.configs.recommended, tseslint.configs.recommended, {
ignores: ['dist'],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020
},
plugins: {
'react-hooks': reactHooksPlugin,
import: importPlugin
},
rules: {
curly: ['warn'],
'no-empty': 'off',
'no-fallthrough': 'off',
'no-async-promise-executor': 'off',

'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-wrapper-object-types': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_', caughtErrors: 'none' }],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-empty-interface': 'off',

'import/no-unresolved': 'off',
'import/no-named-as-default': 'off',
'import/order': [
'warn',
{
alphabetize: {
order: 'asc',
caseInsensitive: true
},
pathGroups: [
{
pattern: '~/**',
group: 'external',
position: 'after'
}
],
'newlines-between': 'always'
}
],

'react/prop-types': 'off',
'react/display-name': 'off',
'react-hooks/exhaustive-deps': 'off',
'react/no-unescaped-entities': 'off'
}
})
18 changes: 8 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"test:watch": "vitest",
"test:coverage": "vitest run --coverage",
"typecheck": "tsc --noEmit",
"lint": "eslint -c .eslintrc './src/**/*.{ts,tsx}'",
"lint:fix": "eslint -c .eslintrc --fix './src/**/*.{ts,tsx}'",
"lint": "eslint './src/**/*.{ts,tsx}'",
"lint:fix": "eslint --fix './src/**/*.{ts,tsx}'",
"format": "prettier --list-different --write src/**/*.{ts,tsx}",
"prepare": "husky",
"prepack": "pnpm build",
Expand Down Expand Up @@ -64,6 +64,7 @@
"@babel/core": "^7.26.0",
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.11",
"@eslint/js": "^9.18.0",
"@storybook/addon-actions": "^7.6.17",
"@storybook/addon-docs": "^7.6.17",
"@storybook/addon-essentials": "^7.6.17",
Expand All @@ -81,19 +82,15 @@
"@types/node": "^22.10.7",
"@types/react": "^18.3.4",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^7.16.0",
"@typescript-eslint/parser": "^7.16.0",
"@vitejs/plugin-react": "^4.3.4",
"@vitest/coverage-v8": "^3.0.3",
"autoprefixer": "^10.4.20",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.34.3",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint": "^9.18.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-react": "^7.37.4",
"eslint-plugin-react-hooks": "^5.1.0",
"ethers": "5.7.2",
"framer-motion": "^7.6.7",
"happy-dom": "^16.7.1",
Expand All @@ -106,6 +103,7 @@
"storybook": "^7.6.17",
"tailwindcss": "^3.4.17",
"typescript": "^4.9.5",
"typescript-eslint": "^8.21.0",
"vite": "^6.0.11",
"vite-plugin-dts": "^4.0.3",
"vite-plugin-eslint": "^1.8.1",
Expand Down
Loading

0 comments on commit 94a9190

Please sign in to comment.