52 lines
1.3 KiB
JavaScript
52 lines
1.3 KiB
JavaScript
import js from '@eslint/js'
|
|
import tsParser from '@typescript-eslint/parser'
|
|
import tsPlugin from '@typescript-eslint/eslint-plugin'
|
|
import reactHooks from 'eslint-plugin-react-hooks'
|
|
import reactRefresh from 'eslint-plugin-react-refresh'
|
|
import globals from 'globals'
|
|
|
|
export default [
|
|
{
|
|
ignores: ['dist/**', 'node_modules/**']
|
|
},
|
|
js.configs.recommended,
|
|
{
|
|
files: ['**/*.{ts,tsx}'],
|
|
languageOptions: {
|
|
parser: tsParser,
|
|
parserOptions: {
|
|
ecmaVersion: 2020,
|
|
sourceType: 'module',
|
|
ecmaFeatures: {
|
|
jsx: true
|
|
}
|
|
},
|
|
globals: {
|
|
...globals.browser,
|
|
...globals.es2021
|
|
}
|
|
},
|
|
plugins: {
|
|
'@typescript-eslint': tsPlugin,
|
|
'react-hooks': reactHooks,
|
|
'react-refresh': reactRefresh
|
|
},
|
|
rules: {
|
|
...tsPlugin.configs.recommended.rules,
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
'@typescript-eslint/ban-ts-comment': 'off',
|
|
'react-hooks/rules-of-hooks': 'error',
|
|
'react-hooks/exhaustive-deps': 'warn',
|
|
'react-refresh/only-export-components': 'warn'
|
|
}
|
|
},
|
|
{
|
|
files: ['**/*.config.{js,ts}', '**/*.config.{cjs,mjs}', 'vite.config.*', 'eslint.config.js'],
|
|
languageOptions: {
|
|
globals: {
|
|
...globals.node
|
|
}
|
|
}
|
|
}
|
|
]
|