Created
June 4, 2025 11:08
-
-
Save sunmeat/dbba4bcec6387d3e3404037dd24e66d0 to your computer and use it in GitHub Desktop.
предварительные настройки
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import js from '@eslint/js' | |
import globals from 'globals' | |
import reactHooks from 'eslint-plugin-react-hooks' | |
import reactRefresh from 'eslint-plugin-react-refresh' | |
import vitest from 'eslint-plugin-vitest' | |
import vitestGlobals from 'globals' | |
export default [ | |
{ ignores: ['dist'] }, | |
{ | |
files: ['**/*.{js,jsx}'], | |
languageOptions: { | |
ecmaVersion: 2020, | |
globals: globals.browser, | |
parserOptions: { | |
ecmaVersion: 'latest', | |
ecmaFeatures: { jsx: true }, | |
sourceType: 'module', | |
}, | |
}, | |
plugins: { | |
'react-hooks': reactHooks, | |
'react-refresh': reactRefresh, | |
}, | |
rules: { | |
...js.configs.recommended.rules, | |
...reactHooks.configs.recommended.rules, | |
'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }], | |
'react-refresh/only-export-components': [ | |
'warn', | |
{ allowConstantExport: true }, | |
], | |
}, | |
}, | |
{ | |
files: ['**/*.test.{js,jsx}'], | |
languageOptions: { | |
ecmaVersion: 'latest', | |
sourceType: 'module', | |
globals: { | |
...globals.browser, | |
...vitestGlobals.vitest, // чтоб еслинт не подчёркивал ничего | |
}, | |
}, | |
plugins: { | |
vitest, | |
}, | |
rules: { | |
...vitest.configs.recommended.rules, | |
}, | |
}, | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment