-
-
Notifications
You must be signed in to change notification settings - Fork 429
/
eslint.config.mjs
66 lines (62 loc) · 1.85 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
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
// @ts-check
import eslint from '@eslint/js'
import tseslint from 'typescript-eslint'
import react from 'eslint-plugin-react'
import prettier from 'eslint-config-prettier'
import importPlugin from 'eslint-plugin-import-x'
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
react.configs.flat.recommended,
prettier,
{
files: ['**/*.ts', '**/*.tsx'],
rules: {
// FIXME: All of these rules should be errors instead
'@typescript-eslint/no-base-to-string': 'warn',
'@typescript-eslint/no-floating-promises': 'warn',
'@typescript-eslint/no-for-in-array': 'warn',
'@typescript-eslint/no-unsafe-argument': 'warn',
'@typescript-eslint/no-unsafe-assignment': 'warn',
'@typescript-eslint/no-unsafe-call': 'warn',
'@typescript-eslint/no-unsafe-member-access': 'warn',
'@typescript-eslint/no-unsafe-return': 'warn',
'@typescript-eslint/require-await': 'warn',
'@typescript-eslint/restrict-template-expressions': 'warn',
'@typescript-eslint/unbound-method': 'warn',
'react/no-unknown-property': [
'error',
{ ignore: ['partition', 'allowpopups', 'useragent'] }
],
'@typescript-eslint/no-misused-promises': [
'error',
{ checksVoidReturn: false }
],
'import/no-duplicates': 'error'
},
plugins: {
import: importPlugin
},
languageOptions: {
parserOptions: {
project: './tsconfig.eslint.json',
tsconfigRootDir: import.meta.dirname
}
},
settings: {
react: {
version: 'detect'
}
}
},
{
files: ['**/__tests__/**/*.ts', '**/__mocks__/**/*.ts'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'import/no-duplicates': 'off'
}
},
{
ignores: ['build/', '**/*.js', 'eslint.config.mjs']
}
)