49 lines
1.9 KiB
JavaScript
49 lines
1.9 KiB
JavaScript
import { defineConfig } from 'eslint/config'
|
|
import tseslint from '@electron-toolkit/eslint-config-ts'
|
|
import eslintConfigPrettier from '@electron-toolkit/eslint-config-prettier'
|
|
import eslintPluginReact from 'eslint-plugin-react'
|
|
import eslintPluginReactHooks from 'eslint-plugin-react-hooks'
|
|
import eslintPluginReactRefresh from 'eslint-plugin-react-refresh'
|
|
|
|
export default defineConfig(
|
|
{ ignores: ['**/node_modules', '**/dist', '**/out'] },
|
|
tseslint.configs.recommended,
|
|
eslintPluginReact.configs.flat.recommended,
|
|
eslintPluginReact.configs.flat['jsx-runtime'],
|
|
{
|
|
settings: {
|
|
react: {
|
|
version: 'detect'
|
|
}
|
|
}
|
|
},
|
|
{
|
|
files: ['**/*.{ts,tsx}'],
|
|
plugins: {
|
|
'react-hooks': eslintPluginReactHooks,
|
|
'react-refresh': eslintPluginReactRefresh
|
|
},
|
|
rules: {
|
|
...eslintPluginReactHooks.configs.recommended.rules,
|
|
...eslintPluginReactRefresh.configs.vite.rules,
|
|
|
|
// --- REGLAS RELAJADAS ---
|
|
// Permite usar 'any' sin que marque error
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
// No obliga a declarar el tipo de retorno en cada función
|
|
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
// Pasa variables o imports sin usar a simple advertencia (amarillo) en vez de error (rojo)
|
|
'@typescript-eslint/no-unused-vars': 'warn',
|
|
// Permite usar require() o comentarios @ts-ignore si los necesitas
|
|
'@typescript-eslint/no-require-imports': 'off',
|
|
'@typescript-eslint/ban-ts-comment': 'off',
|
|
// Evita quejas por no usar PropTypes (innecesario usando TypeScript)
|
|
'react/prop-types': 'off',
|
|
// Permite caracteres como comillas o símbolos directos en el texto JSX sin escapar
|
|
'react/no-unescaped-entities': 'off',
|
|
// Relaja el aviso de Fast Refresh si exportas constantes junto a componentes
|
|
'react-refresh/only-export-components': 'warn'
|
|
}
|
|
},
|
|
eslintConfigPrettier
|
|
) |