This repository has been archived by the owner on Aug 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.eslintrc.js
109 lines (109 loc) · 3.43 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
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
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'airbnb-base',
'prettier',
'plugin:@typescript-eslint/recommended',
'prettier/@typescript-eslint',
'plugin:prettier/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
'plugin:jest/recommended',
'eslint-config-prettier',
],
plugins: ['@typescript-eslint', 'prettier', 'filenames', 'jest'],
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
jsx: false,
},
},
rules: {
'array-callback-return': 'error',
'block-scoped-var': 'error',
camelcase: ['error', { properties: 'always' }],
'consistent-return': 'off',
'default-case': 'error',
'filenames/match-regex': ['error', '^[a-z0-9-]+(.test)?$', true],
'filenames/match-exported': ['error', 'kebab', null, true],
'filenames/no-index': 'off',
// https://github.com/benmosher/eslint-plugin-import/tree/master/docs/rules
'import/default': 'error',
'import/export': 'error',
'import/exports-last': 'off',
'import/extensions': ['error', 'never', { json: 'always', scss: 'always' }],
'import/first': 'error',
'import/max-dependencies': ['error', { max: 20 }],
'import/named': 'error',
'import/namespace': ['error', { allowComputed: true }],
'import/newline-after-import': 'error',
'import/no-absolute-path': 'error',
'import/no-amd': 'error',
'import/no-anonymous-default-export': 'off',
'import/no-commonjs': 'error',
'import/no-default-export': 'off',
'import/no-duplicates': 'error',
'import/no-dynamic-require': 'error',
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: true,
optionalDependencies: true,
peerDependencies: false,
},
],
'import/no-internal-modules': 'off',
'import/no-mutable-exports': 'error',
'import/no-named-as-default': 'off',
'import/no-named-as-default-member': 'error',
'import/no-named-default': 'error',
'import/no-namespace': 'off',
'import/no-nodejs-modules': 'off',
'import/no-unassigned-import': ['error', { allow: ['**/config/i18n', 'dayjs/locale/**'] }],
'import/no-unresolved': 'off',
'import/no-webpack-loader-syntax': 'error',
'import/order': [
'error',
{
groups: [['builtin', 'external'], ['internal', 'parent'], ['sibling', 'index']],
'newlines-between': 'always',
},
],
'import/prefer-default-export': 'off',
'import/unambiguous': 'off',
'import/no-useless-path-segments': 'off',
'max-depth': ['error', 4],
'max-len': ['error', { code: 120, tabWidth: 2, comments: 120 }],
'no-template-curly-in-string': 'error',
'no-plusplus': 'error',
'no-duplicate-imports': 'error',
'prefer-rest-params': 'error',
'no-unused-vars': 'error',
'no-cond-assign': ['error', 'except-parens'],
'prettier/prettier': ['error'],
'@typescript-eslint/explicit-function-return-type': [
'error',
{
allowExpressions: true,
allowTypedFunctionExpressions: true,
},
],
'@typescript-eslint/interface-name-prefix': ['error', 'always'],
'@typescript-eslint/no-explicit-any': [
'error',
{
ignoreRestArgs: true,
},
],
},
overrides: [
{
files: ['src/**/**.test.ts'],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off'
}
}
],
};