-
-
Notifications
You must be signed in to change notification settings - Fork 421
/
Copy patheslint.config.js
95 lines (94 loc) · 2.3 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
91
92
93
94
95
import typescriptPlugin from '@typescript-eslint/eslint-plugin'
import typescriptParser from '@typescript-eslint/parser'
import prettierConfig from 'eslint-config-prettier'
import reactPlugin from 'eslint-plugin-react'
export default [
{
ignores: ['coverage', 'dist', 'test/dist']
},
{
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.mjs', '**/*.cjs'],
languageOptions: {
parser: typescriptParser,
parserOptions: {
ecmaVersion: 'latest',
project: 'tsconfig.json',
ecmaFeatures: {
jsx: true
}
}
},
plugins: {
'@typescript-eslint': typescriptPlugin,
react: reactPlugin
},
settings: {
react: {
version: 'detect'
}
},
rules: {
...typescriptPlugin.configs.recommended.rules,
...reactPlugin.configs.recommended.rules,
...reactPlugin.configs['jsx-runtime'].rules,
// Turns off rules that conflict with Prettier
...prettierConfig.rules,
eqeqeq: [
'error',
'always',
{
null: 'ignore'
}
],
'no-unused-vars': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'after-used',
argsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_'
}
],
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-var-requires': 'off',
'react/jsx-sort-props': [
'error',
{
callbacksLast: true,
reservedFirst: true,
shorthandFirst: true
}
],
'react/no-unknown-property': [
'error',
{
ignore: ['jsx', 'global', 'fetchPriority']
}
],
'react/prop-types': 'off'
}
},
{
files: ['**/*.cjs'],
languageOptions: {
parserOptions: {
sourceType: 'commonjs'
}
},
rules: {
'@typescript-eslint/no-require-imports': 'off'
}
},
{
files: ['test/**/*.ts', 'test/**/*.tsx'],
languageOptions: {
globals: {
QUnit: false
}
}
}
]