-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
90 lines (88 loc) · 2.56 KB
/
eslint.config.js
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
// @ts-check
import eslint from '@eslint/js'
import prettierConfig from 'eslint-config-prettier'
import jsdoc from 'eslint-plugin-jsdoc'
import playwright from 'eslint-plugin-playwright'
import tseslint from 'typescript-eslint'
export default tseslint.config(
{
...playwright.configs['flat/recommended'],
files: ['e2e'],
},
{
ignores: [
'coverage',
'*/node_modules/*',
'*/esm/*',
'*/types/*',
'*/dist/*',
'.yarn/*',
'eslint.config.js',
'prettier.config.js',
],
},
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
prettierConfig,
{
linterOptions: {
reportUnusedDisableDirectives: true,
},
languageOptions: {
parserOptions: {
project: ['tsconfig.json'],
tsconfigRootDir: import.meta.dirname,
},
},
plugins: {
jsdoc,
},
rules: {
'@typescript-eslint/no-unused-vars': 'off', // Use Typescript own check for this
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/explicit-member-accessibility': [
'error',
{
accessibility: 'explicit',
overrides: {
accessors: 'explicit',
constructors: 'no-public',
methods: 'explicit',
properties: 'off',
parameterProperties: 'explicit',
},
},
],
'@typescript-eslint/no-parameter-properties': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/array-type': ['error', { default: 'array-simple', readonly: 'array-simple' }],
'@typescript-eslint/no-useless-constructor': 'error',
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'jsdoc/require-param-type': 'off',
'jsdoc/require-returns-type': 'off',
'object-shorthand': 'error',
'dot-notation': 'error',
'no-caller': 'error',
'no-useless-concat': 'error',
radix: 'error',
yoda: 'error',
'prefer-arrow-callback': ['error', { allowUnboundThis: true }],
'prefer-rest-params': 'error',
'no-var': 'error',
'prefer-const': 'error',
'prefer-spread': 'error',
'no-shadow': 'error',
'prefer-template': 'error',
'prefer-destructuring': ['error', { array: false, object: true }],
'default-case': 'error',
},
},
{
files: ['**/*.spec.ts', '**/*.spec.tsx'],
rules: {
'@typescript-eslint/unbound-method': 'off', // vi.fn() is fine in tests
},
},
)