Ревью кода: исправление найденных проблем
This commit is contained in:
+11
-3
@@ -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',
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user