Files
lcbp3/frontend/eslint.config.mjs
T
admin 11984bfa29
CI Pipeline / build (push) Failing after 12m41s
Build and Deploy / deploy (push) Failing after 2m44s
260322:1648 Correct Coresspondence / Doing RFA / Correct CI
2026-03-22 16:48:12 +07:00

90 lines
2.1 KiB
JavaScript

import js from '@eslint/js';
import globals from 'globals';
import typescriptParser from '@typescript-eslint/parser';
import typescriptPlugin from '@typescript-eslint/eslint-plugin';
import reactHooksPlugin from 'eslint-plugin-react-hooks';
const eslintConfig = [
js.configs.recommended,
{
files: ['**/*.{js,jsx}'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
...globals.browser,
...globals.node,
...globals.es2021,
},
},
rules: {
'no-console': 'error',
'no-unused-vars': 'error',
},
},
{
files: ['**/*.{ts,tsx}'],
languageOptions: {
parser: typescriptParser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
globals: {
...globals.browser,
...globals.node,
...globals.es2021,
},
},
plugins: {
'@typescript-eslint': typescriptPlugin,
'react-hooks': reactHooksPlugin,
},
rules: {
'no-console': 'error',
'no-unused-vars': 'off',
'no-undef': 'off',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'no-restricted-syntax': [
'error',
{
selector: "CallExpression[callee.name='parseInt']",
message: '❌ parseInt() is forbidden (UUID risk)',
},
{
selector: "UnaryExpression[operator='+']",
message: '❌ +value is forbidden (UUID risk)',
},
],
},
},
// Ignore config files and build outputs
{
ignores: [
'node_modules/**',
'.next/**',
'out/**',
'dist/**',
'build/**',
'*.config.js',
'*.config.mjs',
'*.config.ts',
],
},
];
export default eslintConfig;