35 lines
906 B
JavaScript
35 lines
906 B
JavaScript
// ESLint конфигурация для frontend (React, ES Modules, JSX)
|
|
import js from '@eslint/js';
|
|
import globals from 'globals';
|
|
import react from 'eslint-plugin-react';
|
|
import reactHooks from 'eslint-plugin-react-hooks';
|
|
|
|
export default [
|
|
js.configs.recommended,
|
|
{
|
|
files: ['src/**/*.{js,jsx}'],
|
|
languageOptions: {
|
|
ecmaVersion: 2024,
|
|
sourceType: 'module',
|
|
parserOptions: {
|
|
ecmaFeatures: { jsx: true },
|
|
},
|
|
globals: {
|
|
...globals.browser,
|
|
},
|
|
},
|
|
plugins: {
|
|
react: { ...react, configs: { recommended: { rules: react.configs.recommended.rules } } },
|
|
'react-hooks': reactHooks,
|
|
},
|
|
rules: {
|
|
...react.configs.recommended.rules,
|
|
...reactHooks.configs.recommended.rules,
|
|
'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
|
|
},
|
|
settings: {
|
|
react: { version: '18.3' },
|
|
},
|
|
},
|
|
];
|