-
Notifications
You must be signed in to change notification settings - Fork 225
/
Copy patheslint.config.mjs
39 lines (37 loc) · 1.13 KB
/
eslint.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import pluginJs from '@eslint/js';
import pluginJest from 'eslint-plugin-jest';
import pluginReact from 'eslint-plugin-react';
import unusedImports from 'eslint-plugin-unused-imports';
import globals from 'globals';
/** @type {import('eslint').Linter.Config[]} */
export default [
{
files: ['**/*.{js,mjs,cjs,jsx}'],
settings: {react: {version: 'detect'}},
plugins: {jest: pluginJest, 'unused-imports': unusedImports},
languageOptions: {
globals: pluginJest.environments.globals.globals
},
rules: {
'no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': [
'warn',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_'
}
],
'jest/no-disabled-tests': 'warn',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/prefer-to-have-length': 'warn',
'jest/valid-expect': 'error'
}
},
{languageOptions: {globals: globals.browser}},
pluginJs.configs.recommended,
pluginReact.configs.flat.recommended
];