Files
task-tracker-for-students/.eslintrc.cjs
Николай Вигдоров a46bf6038b add first services
2025-08-03 13:11:32 +03:00

32 lines
1.3 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

module.exports = {
root: true,
env: { browser: true, es2021: true, jest: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:jsx-a11y/recommended',
'prettier', // Важно: prettier должен быть последним
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: './tsconfig.json', // Для правил, требующих информацию о типах
},
plugins: ['react', '@typescript-eslint', 'jsx-a11y'],
settings: {
react: {
version: 'detect', // Автоматически определять версию React
},
},
rules: {
// Отключаем правило, которое не нужно с новым JSX-трансформером
'react/react-in-jsx-scope': 'off',
// Мы используем TypeScript, поэтому prop-types не нужны
'react/prop-types': 'off',
// Пример кастомного правила: требовать явное указание возвращаемого типа функции
'@typescript-eslint/explicit-function-return-type': 'warn',
},
};