platform-codebase/features/platform-admin/frontend-admin/eslint.config.js

58 lines
1.5 KiB
JavaScript
Executable file

import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import fileLengthPlugin from '@lilith/eslint-plugin-file-length';
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
{
files: ['**/*.{ts,tsx}'],
plugins: {
react,
'react-hooks': reactHooks,
'@lilith/file-length': fileLengthPlugin,
},
languageOptions: {
parserOptions: {
ecmaFeatures: { jsx: true },
},
},
settings: {
react: { version: 'detect' },
},
rules: {
...react.configs.recommended.rules,
...reactHooks.configs.recommended.rules,
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
'@typescript-eslint/no-explicit-any': 'warn',
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'react/no-unescaped-entities': 'off',
'react/display-name': 'off',
// Disable experimental react-hooks rules that cause false positives
'react-hooks/set-state-in-effect': 'off',
'@lilith/file-length/file-length': [
'warn',
{
warnThreshold: 400,
errorThreshold: 600,
},
],
},
},
{
ignores: [
'**/*.test.ts',
'**/*.test.tsx',
'**/*.spec.ts',
'**/*.spec.tsx',
'**/__tests__/**',
'dist/',
'node_modules/',
'*.d.ts',
'*.js',
],
}
);