-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy patheslint.config.mjs
More file actions
59 lines (53 loc) · 1.76 KB
/
eslint.config.mjs
File metadata and controls
59 lines (53 loc) · 1.76 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
53
54
55
56
57
58
59
import globals from 'globals'
import tseslint from '@typescript-eslint/eslint-plugin'
import tsParser from '@typescript-eslint/parser'
import pluginPrettier from 'eslint-plugin-prettier'
import preferArrowFunctions from 'eslint-plugin-prefer-arrow-functions'
export default [
// replaces .eslintignore
{ ignores: ['eslint.config.mjs', 'node_modules/', 'dist/', 'build/', 'coverage/'] },
{
files: ['**/*.ts'],
languageOptions: {
parser: tsParser,
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: process.cwd(),
sourceType: 'module',
},
globals: {
...globals.node,
...globals.jest,
},
},
plugins: {
'@typescript-eslint': tseslint,
'prefer-arrow-functions': preferArrowFunctions,
prettier: pluginPrettier,
},
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/consistent-type-imports': 'warn',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-redeclare': 'off',
'@typescript-eslint/space-before-function-paren': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
'prefer-const': 'warn',
// keep your Prettier rule customization
'prettier/prettier': ['warn', { endOfLine: 'auto' }],
'prefer-arrow-functions/prefer-arrow-functions': [
'warn',
{
allowNamedFunctions: false,
classPropertiesAllowed: false,
disallowPrototype: false,
returnStyle: 'unchanged',
singleReturnOnly: false,
},
],
},
},
]