2025-08-12 22:31:26 +01:00
|
|
|
import js from '@eslint/js'
|
|
|
|
import globals from 'globals'
|
|
|
|
import reactHooks from 'eslint-plugin-react-hooks'
|
|
|
|
import reactRefresh from 'eslint-plugin-react-refresh'
|
2025-08-13 00:51:44 +01:00
|
|
|
import react from 'eslint-plugin-react'
|
|
|
|
import tseslint from '@typescript-eslint/eslint-plugin'
|
|
|
|
import tsparser from '@typescript-eslint/parser'
|
2025-08-12 22:31:26 +01:00
|
|
|
|
|
|
|
export default [
|
|
|
|
js.configs.recommended,
|
|
|
|
{
|
|
|
|
files: ['**/*.{js,jsx,ts,tsx}'],
|
|
|
|
languageOptions: {
|
|
|
|
globals: {
|
|
|
|
...globals.browser,
|
|
|
|
...globals.es2020,
|
2025-08-13 00:51:44 +01:00
|
|
|
...globals.node,
|
|
|
|
React: 'readonly',
|
2025-08-12 22:31:26 +01:00
|
|
|
},
|
2025-08-13 00:51:44 +01:00
|
|
|
parser: tsparser,
|
2025-08-12 22:31:26 +01:00
|
|
|
parserOptions: {
|
|
|
|
ecmaVersion: 'latest',
|
|
|
|
sourceType: 'module',
|
|
|
|
ecmaFeatures: {
|
|
|
|
jsx: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
plugins: {
|
2025-08-13 00:51:44 +01:00
|
|
|
'react': react,
|
2025-08-12 22:31:26 +01:00
|
|
|
'react-hooks': reactHooks,
|
|
|
|
'react-refresh': reactRefresh,
|
2025-08-13 00:51:44 +01:00
|
|
|
'@typescript-eslint': tseslint,
|
|
|
|
},
|
|
|
|
settings: {
|
|
|
|
react: {
|
|
|
|
version: 'detect',
|
|
|
|
},
|
2025-08-12 22:31:26 +01:00
|
|
|
},
|
|
|
|
rules: {
|
2025-08-13 00:51:44 +01:00
|
|
|
...react.configs.recommended.rules,
|
2025-08-12 22:31:26 +01:00
|
|
|
...reactHooks.configs.recommended.rules,
|
|
|
|
'react-refresh/only-export-components': [
|
|
|
|
'warn',
|
|
|
|
{ allowConstantExport: true },
|
|
|
|
],
|
2025-08-13 00:51:44 +01:00
|
|
|
'no-unused-vars': 'off',
|
|
|
|
'@typescript-eslint/no-unused-vars': 'warn',
|
|
|
|
'react/prop-types': 'off',
|
|
|
|
'react/react-in-jsx-scope': 'off',
|
2025-08-12 22:31:26 +01:00
|
|
|
},
|
|
|
|
},
|
|
|
|
]
|