Ревью кода: исправление найденных проблем

This commit is contained in:
Suslov-MD
2026-08-16 18:49:14 +00:00
parent dad4642197
commit 29b0a16f94
28 changed files with 726 additions and 396 deletions
+11 -3
View File
@@ -329,19 +329,27 @@ export default defineConfig(
'no-alert': 'off',
// e.target.value = '' — сброс file input (стандартный паттерн)
'no-param-reassign': ['error', { props: true, ignorePropertyModificationsFor: ['e'] }],
// Навигация после await (window.location.href → useNavigate)
'require-atomic-updates': 'off',
// async IIFE в useEffect для загрузки новости
'@typescript-eslint/no-floating-promises': 'off',
// newsId гарантированно string (проверено isNew)
'@typescript-eslint/restrict-template-expressions': 'off',
},
},
{
name: 'client/auth-context',
files: ['src/auth/AuthContext.tsx'],
rules: {
// onAuthExpired: navigate('/login') возвращает void,
// но линтер требует обработки (no-floating-promises)
'@typescript-eslint/no-floating-promises': 'off',
},
},
{
name: 'client/auth-pages',
files: ['src/pages/LoginPage.tsx', 'src/pages/RegisterPage.tsx'],
rules: {
// .then()/.catch() в цепочке — не floating promise
// .then/.catch/.finally цепочка в handleSubmit: rejection обработан,
// но no-floating-promises не распознаёт pattern (см. комментарий в файле)
'@typescript-eslint/no-floating-promises': 'off',
},
},