45 lines
1.4 KiB
JavaScript
45 lines
1.4 KiB
JavaScript
import js from '@eslint/js'
|
|
import globals from 'globals'
|
|
import reactHooks from 'eslint-plugin-react-hooks'
|
|
import reactRefresh from 'eslint-plugin-react-refresh'
|
|
import tseslint from 'typescript-eslint'
|
|
import prettier from 'eslint-config-prettier'
|
|
import { defineConfig, globalIgnores } from 'eslint/config'
|
|
|
|
export default defineConfig([
|
|
globalIgnores(['dist']),
|
|
{
|
|
files: ['**/*.{ts,tsx}'],
|
|
extends: [
|
|
js.configs.recommended,
|
|
tseslint.configs.recommended,
|
|
reactHooks.configs.flat.recommended,
|
|
reactRefresh.configs.vite,
|
|
prettier,
|
|
],
|
|
languageOptions: {
|
|
ecmaVersion: 2020,
|
|
globals: globals.browser,
|
|
},
|
|
rules: {
|
|
'@typescript-eslint/no-explicit-any': 'warn',
|
|
'@typescript-eslint/no-unused-vars': [
|
|
'warn',
|
|
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_' },
|
|
],
|
|
'@typescript-eslint/no-namespace': 'off',
|
|
'@typescript-eslint/no-empty-object-type': 'warn',
|
|
'@typescript-eslint/ban-ts-comment': 'warn',
|
|
'react-hooks/set-state-in-effect': 'warn',
|
|
'react-hooks/purity': 'warn',
|
|
'no-unused-vars': 'off',
|
|
'react-hooks/exhaustive-deps': 'warn',
|
|
'react-refresh/only-export-components': 'warn',
|
|
'no-empty': ['warn', { allowEmptyCatch: true }],
|
|
'no-irregular-whitespace': 'warn',
|
|
'no-control-regex': 'off',
|
|
'prefer-const': 'warn',
|
|
},
|
|
},
|
|
])
|