-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.core.js
114 lines (113 loc) · 2.6 KB
/
.eslintrc.core.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
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
102
103
104
105
106
107
108
109
110
111
112
113
114
// basic eslint settings to use via CLI
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
},
plugins: ['@typescript-eslint'],
extends: [
'airbnb',
'plugin:@typescript-eslint/recommended',
'airbnb-typescript', // must be below `@typescript-eslint/recommended`
'plugin:prettier/recommended',
],
rules: {
'import/prefer-default-export': 'off',
'import/no-default-export': 'error',
'import/no-cycle': [
'error',
{
maxDepth: 2,
},
],
'import/no-dynamic-require': 'off',
'import/order': [
'error',
{
groups: [['builtin', 'external'], 'internal', ['parent', 'sibling'], 'index'],
'newlines-between': 'always',
},
],
'import/no-extraneous-dependencies': 'error',
'global-require': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/member-ordering': [
'error',
{ default: ['constructor', 'field', 'method', 'signature'] },
],
'@typescript-eslint/type-annotation-spacing': [
'error',
{
before: false,
after: true,
overrides: {
arrow: {
before: true,
after: true,
},
},
},
],
'class-methods-use-this': 'off',
'no-unused-expressions': 'off',
'no-console': [
'error',
{
allow: ['info', 'warn', 'error'],
},
],
'@typescript-eslint/lines-between-class-members': [
'error',
'always',
{
exceptAfterSingleLine: true,
},
],
'no-undef': 'off',
'func-names': [
'error',
'as-needed',
{
generators: 'never',
},
],
'consistent-return': 'off',
'no-underscore-dangle': [2, { allowAfterThis: true }],
'@typescript-eslint/no-use-before-define': [
'error',
{ functions: false, classes: true, variables: true },
],
'@typescript-eslint/ban-ts-comment': [
'error',
{
'ts-ignore': 'allow-with-description',
},
],
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/no-for-in-array': 'error',
'@typescript-eslint/restrict-template-expressions': 'error',
},
overrides: [
{
files: ['**/*.test.ts'],
rules: {
'import/no-extraneous-dependencies': 'off',
},
},
],
env: {
browser: true,
node: true,
},
globals: {
window: 'readonly',
},
settings: {
'import/resolver': {
node: {
paths: ['src'],
},
},
},
};