-
Notifications
You must be signed in to change notification settings - Fork 65
/
import.js
90 lines (89 loc) · 2.82 KB
/
import.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
/**
* @see https://github.com/eslint/eslint/issues/3458
* @see https://www.npmjs.com/package/@rushstack/eslint-patch
*/
require('@rushstack/eslint-patch/modern-module-resolution')
module.exports = {
env: {
es6: true,
},
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: ['import'],
settings: {
'import/ignore': ['node_modules', '.json$', '.(scss|less|css|styl)$'],
},
rules: {
'import/consistent-type-specifier-style': ['error', 'prefer-inline'],
'import/default': 'error',
'import/dynamic-import-chunkname': 'off',
'import/export': 'error',
'import/exports-last': 'off',
'import/extensions': 'off',
'import/first': 'error',
'import/group-exports': 'off',
'import/max-dependencies': 'off',
'import/named': 'error',
'import/namespace': 'error',
'import/newline-after-import': 'off',
'import/no-absolute-path': 'error',
'import/no-amd': 'error',
'import/no-anonymous-default-export': 'off',
'import/no-commonjs': 'off',
'import/no-cycle': 'off', // this rule is quite slow...
'import/no-default-export': 'off',
'import/no-deprecated': 'warn', // this is an in progress rule
'import/no-duplicates': 'error',
'import/no-dynamic-require': 'off',
'import/no-empty-named-blocks': 'error',
'import/no-extraneous-dependencies': 'error',
'import/no-import-module-exports': 'error',
'import/no-internal-modules': 'off',
'import/no-mutable-exports': 'error',
'import/no-named-as-default': 'error',
'import/no-named-as-default-member': 'error',
'import/no-named-default': 'error',
'import/no-named-export': 'off', // Prohibit named exports. Mostly an inverse of no-default-export
'import/no-namespace': 'off',
'import/no-nodejs-modules': 'off',
'import/no-relative-packages': 'warn',
'import/no-relative-parent-imports': 'off',
'import/no-restricted-paths': 'off',
'import/no-self-import': 'error',
'import/no-unassigned-import': 'off',
'import/no-unresolved': 'error',
'import/no-unused-modules': 'off',
'import/no-useless-path-segments': 'off',
'import/no-webpack-loader-syntax': 'error',
'import/order': [
'warn',
{
groups: [
'builtin',
['external', 'internal'],
'parent',
['sibling', 'index'],
],
},
],
'import/prefer-default-export': 'off',
'import/unambiguous': 'off', // not sure I understand this rule well enough right now...
},
overrides: [
{
files: ['**/*.ts?(x)'],
extends: 'plugin:import/typescript',
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: ['@typescript-eslint'],
rules: {
'import/no-unresolved': 'off', // ts(2307)
},
},
],
}