chore(repository): reset repo to new version
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
import importPlugin from 'eslint-plugin-import';
|
||||
import react from 'eslint-plugin-react';
|
||||
import reactHooks from 'eslint-plugin-react-hooks';
|
||||
import globals from 'globals';
|
||||
import unicodeEscapePlugin from './eslint.unicode-escapes-plugin.mjs';
|
||||
|
||||
export default [
|
||||
{ ignores: ['node_modules/**', 'dist/**', 'build/**', 'vite.config.js'] },
|
||||
{
|
||||
files: ['**/*.js', '**/*.jsx'],
|
||||
plugins: { react, 'react-hooks': reactHooks, 'import': importPlugin },
|
||||
languageOptions: {
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module',
|
||||
parserOptions: { ecmaFeatures: { jsx: true } },
|
||||
globals: { ...globals.browser, React: 'readonly', Intl: 'readonly' },
|
||||
},
|
||||
settings: {
|
||||
'react': { version: 'detect' },
|
||||
'import/extensions': ['.js', '.jsx'],
|
||||
'import/resolver': {
|
||||
node: { extensions: ['.js', '.jsx'] },
|
||||
alias: { map: [['@', './src']], extensions: ['.js', '.jsx'] },
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
...react.configs.recommended.rules,
|
||||
...reactHooks.configs.recommended.rules,
|
||||
...importPlugin.flatConfigs.recommended.rules,
|
||||
|
||||
// Non-critical rules - disabled since code works fine without them
|
||||
'react/prop-types': 'off',
|
||||
'react/no-unescaped-entities': 'off',
|
||||
'react/display-name': 'off', // Non-critical, component works without displayName
|
||||
'react/jsx-uses-react': 'off', // Not needed in React 17+, non-critical
|
||||
'react/react-in-jsx-scope': 'off', // Not needed in React 17+, non-critical
|
||||
'react/jsx-uses-vars': 'off', // Non-critical, code works fine
|
||||
'react/jsx-no-comment-textnodes': 'off', // Non-critical, comments could be visible if put inside the JSX, most cases are just rendering text like '///'
|
||||
|
||||
'no-unused-vars': 'off', // Non-critical, code works fine with unused vars
|
||||
'import/no-named-as-default': 'off', // Can cause runtime import errors, usually fine to leave as is
|
||||
'import/no-named-as-default-member': 'off', // Can cause runtime import errors
|
||||
|
||||
// Critical rules that prevent runtime errors
|
||||
'no-undef': 'error', // Undefined variables cause runtime errors
|
||||
'no-empty': ['error', { allowEmptyCatch: true }], // Empty blocks often signal a bug (e.g. missing body)
|
||||
|
||||
// Override recommended import rules for stricter checking
|
||||
'import/no-self-import': 'error', // Extremely fast rule, breaking results in infinite loop/bundling error
|
||||
|
||||
// Disable expensive rules for performance
|
||||
'import/no-cycle': 'off', // AI rarely makes this error, and the rule is very slow to run
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['**/*.jsx'],
|
||||
plugins: { horizons: unicodeEscapePlugin },
|
||||
rules: { 'horizons/no-unicode-escapes-in-jsx': 'warn' },
|
||||
},
|
||||
{ files: ['tools/**/*.js', 'tailwind.config.js'], languageOptions: { globals: globals.node } },
|
||||
];
|
||||
Reference in New Issue
Block a user