-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy patheslint.config.js
More file actions
65 lines (64 loc) · 1.68 KB
/
Copy patheslint.config.js
File metadata and controls
65 lines (64 loc) · 1.68 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import js from '@eslint/js';
import typescript from '@typescript-eslint/eslint-plugin';
import typescriptParser from '@typescript-eslint/parser';
import jsxA11y from 'eslint-plugin-jsx-a11y';
import pluginJest from 'eslint-plugin-jest';
import prettier from 'eslint-config-prettier';
import vitest from '@vitest/eslint-plugin'
import globals from 'globals';
export default [
js.configs.recommended,
{
files: ['**/*.{ts,tsx}'],
languageOptions: {
parser: typescriptParser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
},
plugins: {
'@typescript-eslint': typescript,
'jsx-a11y': jsxA11y,
},
rules: {
...typescript.configs.recommended.rules,
...typescript.configs.strict.rules,
...jsxA11y.configs.recommended.rules,
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{ ignoreRestSiblings: true },
],
// TS handles undefined types, turn off for TS files
'no-undef': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
},
},
{
files: ['**/*.test.{js,jsx,ts,tsx}', '**/*.spec.{js,jsx,ts,tsx}'],
plugins: {
jest: pluginJest,
vitest,
},
languageOptions: {
globals: {
...globals.node,
...pluginJest.environments.globals.globals,
...vitest.environments.env.globals,
},
},
rules: {
...vitest.configs.recommended.rules,
// You can also bring in Jest recommended rules if desired
// ...pluginJest.configs.recommended.rules,
}
},
{
ignores: ['dist/**'],
},
prettier,
];