53 lines
1.7 KiB
JavaScript
53 lines
1.7 KiB
JavaScript
import js from '@eslint/js'
|
|
import globals from 'globals'
|
|
import reactPlugin from 'eslint-plugin-react'
|
|
import pluginJsxA11y from 'eslint-plugin-jsx-a11y'
|
|
import pluginImport from 'eslint-plugin-import'
|
|
import { defineConfig } from 'eslint/config'
|
|
import reactHooks from 'eslint-plugin-react-hooks'
|
|
import reactRefresh from 'eslint-plugin-react-refresh'
|
|
|
|
export default defineConfig([
|
|
{ ignores: ['dist'] },
|
|
{
|
|
files: ['**/*.{js,mjs,cjs,jsx}'],
|
|
languageOptions: {
|
|
parserOptions: {
|
|
requireConfigFile: false,
|
|
ecmaFeatures: { jsx: true },
|
|
ecmaVersion: 2022,
|
|
sourceType: 'module',
|
|
},
|
|
globals: globals.browser,
|
|
},
|
|
plugins: {
|
|
js,
|
|
react: reactPlugin,
|
|
'react-hooks': reactHooks,
|
|
'react-refresh': reactRefresh,
|
|
'jsx-a11y': pluginJsxA11y,
|
|
import: pluginImport,
|
|
},
|
|
extends: [
|
|
js.configs.recommended,
|
|
// reactPlugin.configs.recommended,
|
|
// reactPlugin.configs['jsx-runtime'],
|
|
// reactHooks.configs.recommended,
|
|
// pluginJsxA11y.configs.recommended,
|
|
// pluginImport.configs.recommended,
|
|
// pluginImport.configs.typescript,
|
|
],
|
|
rules: {
|
|
...reactPlugin.configs['jsx-runtime'].rules,
|
|
...reactHooks.configs.recommended.rules,
|
|
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
|
|
'react/jsx-uses-react': 'error',
|
|
'react/jsx-uses-vars': 'error',
|
|
},
|
|
},
|
|
{
|
|
files: ['**/*.{js,mjs,cjs,jsx}'],
|
|
languageOptions: { globals: globals.browser },
|
|
},
|
|
])
|