-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
64 lines (64 loc) · 1.8 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
61
62
63
64
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
},
plugins: ['@typescript-eslint', 'import', 'jest'],
extends: [
'airbnb-typescript/base',
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:jest/recommended',
'prettier',
'prettier/@typescript-eslint',
],
rules: {
'no-console': 'off',
'consistent-return': 'off',
'import/prefer-default-export': 'off',
'no-empty-function': ['error', { allow: ['constructors'] }],
'no-useless-constructor': 'off',
'no-restricted-syntax': ['error', 'LabeledStatement', 'WithStatement'],
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/consistent-type-assertions': [
'error',
{
assertionStyle: 'as',
objectLiteralTypeAssertions: 'allow-as-parameter',
},
],
'import/order': ['error', { 'newlines-between': 'always' }],
'no-await-in-loop': 'off',
'@typescript-eslint/explicit-function-return-type': [
'error',
{
allowExpressions: true,
allowHigherOrderFunctions: true,
allowTypedFunctionExpressions: true,
},
],
'import/no-extraneous-dependencies': 'off',
},
overrides: [
{
files: ['**/*.test.{js,ts}', '**/*.spec.{js,ts}', '**/*.e2e.{js,ts}'],
rules: {
'@typescript-eslint/consistent-type-assertions': 'off',
},
},
],
settings: {
'import/resolver': {
typescript: {
alwaysTryTypes: true, // always try to resolve types under `<roo/>@types` directory even it doesn't contain any source code, like `@types/unist`
},
},
},
env: {
node: true,
'jest/globals': true,
},
};