-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
101 lines (100 loc) · 3.02 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
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
96
97
98
99
100
101
import neostandard, { resolveIgnoresFromGitignore } from 'neostandard'
import eslint from '@eslint/js'
import tseslint from 'typescript-eslint'
export default [
...neostandard({
ignores: [
...resolveIgnoresFromGitignore(),
],
ts: true,
}),
eslint.configs.recommended,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: process.cwd(),
},
},
},
{
name: 'migrate/eslint-config-standard-with-typescript',
rules: {
'@typescript-eslint/array-type': ['error', { default: 'array-simple' }],
'@typescript-eslint/consistent-type-exports': [
'error',
{
fixMixedExportsWithInlineTypeSpecifier: true,
},
],
'@typescript-eslint/consistent-type-imports': 'error',
'@stylistic/member-delimiter-style': [
'error',
{
multiline: { delimiter: 'none' },
singleline: { delimiter: 'comma', requireLast: false },
},
],
'@typescript-eslint/method-signature-style': 'error',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unnecessary-condition': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/promise-function-async': 'error',
'@typescript-eslint/require-array-sort-compare': 'error',
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/return-await': ['error', 'always'],
'@typescript-eslint/triple-slash-reference': ['error', { lib: 'never', path: 'never', types: 'never' }],
'@stylistic/type-annotation-spacing': 'error',
'@typescript-eslint/use-unknown-in-catch-callback-variable': 'off',
},
},
{
name: 'RopeScore/custom',
rules: {
'@typescript-eslint/restrict-template-expressions': ['warn', {
allowNumber: true,
allowBoolean: true,
allowRegExp: true,
allowAny: true,
}],
'@typescript-eslint/no-this-alias': 'off',
'@typescript-eslint/only-throw-error': ['error', {
allowThrowingUnknown: true,
}],
'@stylistic/comma-dangle': ['warn', {
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'never',
}],
'no-void': 'off',
'no-console': 'warn',
},
},
{
name: 'RopeScore/tests',
files: ['**/*.test.ts', '**/*.test.js'],
rules: {
'@typescript-eslint/ban-ts-comment': ['error', {
'ts-expect-error': false,
'ts-ignore': true,
'ts-nocheck': true,
'ts-check': false,
minimumDescriptionLength: 3,
}],
},
},
{
name: 'RopeScore/bin',
files: ['bin/*.ts', 'bin/*.js'],
rules: {
'no-console': 'off',
},
},
]