-
Notifications
You must be signed in to change notification settings - Fork 93
Expand file tree
/
Copy patheslint.config.mjs
More file actions
52 lines (51 loc) · 1.69 KB
/
eslint.config.mjs
File metadata and controls
52 lines (51 loc) · 1.69 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
import tseslint from 'typescript-eslint';
import eslintPluginJest from 'eslint-plugin-jest';
import eslintPluginPrettier from 'eslint-plugin-prettier/recommended';
export default tseslint.config(
{
ignores: ['dist/', 'lib/', 'node_modules/'],
},
...tseslint.configs.recommendedTypeChecked,
eslintPluginJest.configs['flat/recommended'],
eslintPluginPrettier,
{
languageOptions: {
parserOptions: {
projectService: {
allowDefaultProject: ['src/*.test.ts'],
},
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
// Beyond recommendedTypeChecked
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/array-type': 'error',
'@typescript-eslint/explicit-function-return-type': [
'error',
{allowExpressions: true},
],
'@typescript-eslint/explicit-member-accessibility': [
'error',
{accessibility: 'no-public'},
],
'@typescript-eslint/no-unnecessary-qualifier': 'error',
'@typescript-eslint/prefer-for-of': 'warn',
'@typescript-eslint/prefer-includes': 'error',
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
'@typescript-eslint/promise-function-async': 'error',
'@typescript-eslint/require-array-sort-compare': 'error',
},
},
{
files: ['**/*.test.ts'],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/unbound-method': 'off',
},
},
);