-
Notifications
You must be signed in to change notification settings - Fork 11
/
.eslintrc.js
100 lines (98 loc) · 2.47 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
/* eslint-disable sort-keys-shorthand/sort-keys-shorthand */
module.exports = {
env: {
browser: true,
es6: true,
},
extends: ["prettier"],
ignorePatterns: ["node_modules/"],
globals: {
Atomics: "readonly",
SharedArrayBuffer: "readonly",
},
plugins: ["import", "prettier", "sort-keys-shorthand"],
rules: {
/* Standard ESLint rules */
"arrow-parens": ["error", "as-needed"],
"comma-dangle": ["error", "always-multiline"],
"max-classes-per-file": "off", // Component and ComponentItem support
"no-console": [
"error",
{
allow: ["error"],
},
],
"no-multiple-empty-lines": "error",
"object-shorthand": ["error", "always"],
"prefer-const": [
"error",
{
destructuring: "all",
},
],
"quote-props": ["error", "as-needed"],
quotes: [
"error",
"double",
{
avoidEscape: true,
},
],
semi: ["error", "never"],
"sort-imports": [
"error",
{
ignoreCase: true,
ignoreDeclarationSort: true,
ignoreMemberSort: false,
},
],
"sort-keys": "off", // We use a custom sorter that enforces shorthand-first keys
/* import/export rules */
// "import/default": "off",
"import/first": "error", // Use custom import/order grouping rather than enforcing a single group
"import/export": "error",
// "import/named": "off",
"import/namespace": "error",
"import/no-default-export": "error",
"import/no-duplicates": "error",
"import/no-extraneous-dependencies": "off",
"import/no-extraneous-dependencies": "error",
"import/no-named-as-default": "error",
"import/no-named-as-default-member": "error",
"import/no-unresolved": "error",
"import/order": [
"error",
{
alphabetize: {
caseInsensitive: true,
order: "asc",
},
groups: [["builtin", "external"], "internal", "index", "sibling", "parent"],
"newlines-between": "always",
pathGroups: [
{
group: "internal",
pattern: "src/*",
},
],
},
],
/* Finally, miscellaneous */
"sort-keys-shorthand/sort-keys-shorthand": [
"error",
"asc",
{
caseSensitive: true,
natural: false,
minKeys: 2,
shorthand: "first",
},
],
"prettier/prettier": "error",
},
parserOptions: {
allowImportExportEverywhere: true,
sourceType: "module",
},
}