arm-core/web/eslint.config.js
Andrey Epifancev 99252d7a85 fix(web): синхронизация встроенного фронта с arm-web@test (025233f) (#115)
Перенесён диапазон arm-web 100fbfb..025233f (2 коммитов, 19 файлов набора
синхронизации) скриптом docs/scripts/sync-web.sh. После переноса web/ и
arm-web@test идентичны по набору. Коммиты arm-web:
- f868a92 Скан PDF с JBIG2 не рисовался: передать pdf.js wasmUrl и копировать wasm в сборку (#32)
- a8a6da0 Форматирование перед PR: ESLint + Prettier и npm run format (#29)

Co-Authored-By: sync-web.sh <noreply@aepif.ru>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 13:46:39 +04:00

47 lines
1.7 KiB
JavaScript

// ESLint для разработчиков фронта. Правила повторяют biome.json (biome остаётся в make lint/check);
// форматирование — только Prettier, поэтому eslint-config-prettier подключается последним.
import js from '@eslint/js';
import prettier from 'eslint-config-prettier';
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import globals from 'globals';
import tseslint from 'typescript-eslint';
export default tseslint.config(
{ ignores: ['node_modules', 'dist'] },
js.configs.recommended,
...tseslint.configs.recommended,
{
files: ['src/**/*.{ts,tsx}'],
languageOptions: { globals: globals.browser },
plugins: { react, 'react-hooks': reactHooks },
settings: { react: { version: 'detect' } },
rules: {
// correctness
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_' },
],
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
// nursery
'no-dupe-else-if': 'error',
'no-nested-ternary': 'error',
'react/jsx-curly-brace-presence': ['error', { props: 'never', children: 'never' }],
// style
'default-case': 'error',
'@typescript-eslint/prefer-for-of': 'error',
'react/jsx-fragments': ['error', 'syntax'],
'@typescript-eslint/array-type': ['error', { default: 'array' }],
'operator-assignment': 'error',
// suspicious
'no-console': 'warn',
'no-empty': 'error',
'@typescript-eslint/no-empty-function': 'error',
'@typescript-eslint/no-explicit-any': 'warn',
'require-await': 'error',
},
},
prettier,
);