/
import.js
68 lines (62 loc) · 1.59 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
module.exports = {
extends: ['plugin:import/recommended'],
overrides: [
{
files: ['*.md/*.js', '*.mdx/*.js'],
rules: {
'import/no-unresolved': 'off',
},
},
],
plugins: ['import'],
rules: {
'import/extensions': [
'error',
'ignorePackages',
{
css: 'always',
js: 'never',
json: 'always',
jsx: 'never',
sass: 'always',
svg: 'always',
ts: 'never',
tsx: 'never',
},
],
'import/newline-after-import': ['error', { count: 1 }],
// no-extraneous-dependencies doesn't work well with monorepos and Yarn
// workspaces.
'import/no-extraneous-dependencies': 'off',
'import/no-named-as-default': 'off',
'import/no-named-default': 'off',
'import/order': [
'error',
{
alphabetize: { order: 'asc' },
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
],
'newlines-between': 'always',
},
],
'import/prefer-default-export': 'off',
'sort-imports': [
'error',
{
// "import/order" already handle sorting import statements between them.
ignoreDeclarationSort: true,
// However "import/order" doesn't handle sorting of the members of a
// destructured import.
// E.g: `import { foo, bar } from 'foobar'` will not fail with
// "import/order", but will with "sort-imports".
// And the good thing is that "sort-imports" is also auto-fixable.
},
],
},
}