7ec9dbfdee
- invalidateCurrentUser перечитывает профиль, а не только удаляет кэш: без запроса AuthGuard не видит 401 и второе устройство остаётся в приложении после logout-all или смены пароля (AGENT.md 11.6, пункт 12); - сброс сессии и уход из последнего сервера инвалидируют список серверов: пустой снапшот подставлял устаревший REST-ответ, и сервер возвращался в рейку (видно и после кика); - joinGuild проверяет бан сервера: публичный сервер больше не обходится нажатием «Войти» вместо приглашения (AGENT.md 7.17, 7.20), тест расширен; - e2e/voice-ten приведён к линту, console.log разрешён в e2e (диагностика прогона), артефакты Playwright исключены из prettier.
52 lines
1.9 KiB
JavaScript
52 lines
1.9 KiB
JavaScript
import js from '@eslint/js';
|
|
import globals from 'globals';
|
|
import reactHooks from 'eslint-plugin-react-hooks';
|
|
import reactRefresh from 'eslint-plugin-react-refresh';
|
|
import tseslint from 'typescript-eslint';
|
|
|
|
export default tseslint.config(
|
|
// Артефакты Playwright (test-results*, отчёты) не линтуем: их пишет прогон.
|
|
{ ignores: ['dist', 'coverage', 'node_modules', 'test-results*', 'playwright-report'] },
|
|
{
|
|
files: ['**/*.{ts,tsx}'],
|
|
extends: [js.configs.recommended, ...tseslint.configs.recommendedTypeChecked],
|
|
languageOptions: {
|
|
ecmaVersion: 2023,
|
|
globals: { ...globals.browser, ...globals.es2023 },
|
|
parserOptions: {
|
|
projectService: true,
|
|
tsconfigRootDir: import.meta.dirname,
|
|
},
|
|
},
|
|
plugins: {
|
|
'react-hooks': reactHooks,
|
|
'react-refresh': reactRefresh,
|
|
},
|
|
rules: {
|
|
...reactHooks.configs.recommended.rules,
|
|
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
|
|
'@typescript-eslint/no-explicit-any': 'error',
|
|
'@typescript-eslint/consistent-type-imports': 'error',
|
|
'@typescript-eslint/no-unused-vars': [
|
|
'error',
|
|
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
|
|
],
|
|
'no-console': ['error', { allow: ['warn', 'error'] }],
|
|
},
|
|
},
|
|
{
|
|
files: ['tests/**/*.{ts,tsx}', 'e2e/**/*.ts', 'playwright.config.ts'],
|
|
languageOptions: { globals: { ...globals.node } },
|
|
},
|
|
{
|
|
files: ['eslint.config.js'],
|
|
extends: [tseslint.configs.disableTypeChecked],
|
|
},
|
|
// e2e-тесты печатают диагностику прогона (шаги, размеры потоков, fps),
|
|
// поэтому console.log в них разрешён: без него живой тест не отладить.
|
|
{
|
|
files: ['e2e/**/*.ts'],
|
|
rules: { 'no-console': 'off' },
|
|
},
|
|
);
|