-
Notifications
You must be signed in to change notification settings - Fork 11
/
.eslintrc.js
60 lines (53 loc) · 1.62 KB
/
.eslintrc.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
module.exports = {
parserOptions: {
parser: '@typescript-eslint/parser',
},
env: {},
plugins: ['simple-import-sort'],
ignorePatterns: ['lib/', 'old/'],
extends: [
'plugin:@typescript-eslint/recommended',
// Disables rules that TypeScript already checks.
'plugin:@typescript-eslint/eslint-recommended',
// disables rules that prettier fixes.
// others disable rules that common eslint configs set.
'prettier',
],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-use-before-define': [
'error',
{
// Allow function hoisting.
functions: false,
classes: false,
variables: false,
typedefs: false,
},
],
'simple-import-sort/imports': [
'warn',
{
groups: [
// Side effect imports.
['^\\u0000'],
// Node.js builtins.
// eslint-disable-next-line @typescript-eslint/no-var-requires
[`^(${require('module').builtinModules.join('|')})(/|$)`],
// Packages.
// Things that start with a letter (or digit or underscore), or `@`
// followed by a letter.
['^@?\\w'],
// Local packages.
['^(@src)(/.*|$)'],
// Parent imports. Put `..` last.
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
// Other relative imports. Put same-folder imports and `.` last.
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
],
},
],
// '@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
},
}