-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
129 lines (112 loc) · 2.57 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
module.exports = {
env: {
browser: true,
es6: true
},
extends: ["@tivac"],
parserOptions: {
ecmaVersion: 2018,
sourceType: "module",
allowImportExportFromEverywhere: true,
},
globals : {
"module" : "readable",
"import" : "readable",
"require" : "readable",
"process" : "readable",
"__dirname" : "readable",
"artifacts" : "readable",
"TruffleContract" : "readable",
"Web3" : "readable",
},
plugins: ["svelte3"],
overrides: [
{
files: ['**/*.svelte'],
processor: 'svelte3/svelte3'
}
],
settings: {
"import/core-modules": ["svelte"]
},
rules: {
indent: ["error", 4],
"linebreak-style": ["error", "unix"],
quotes: ["error", "double"],
semi: ["error", "always"],
// Enforce newline consistency in objects
"object-curly-newline": [
"warn",
{
// Object literals w/ 3+ properties need to use newlines
ObjectExpression: {
consistent: true,
minProperties: 3
},
// Destructuring w/ 6+ properties needs to use newlines
ObjectPattern: {
consistent: true,
minProperties: 6
},
// Imports w/ 4+ properties need to use newlines
ImportDeclaration: {
consistent: true,
minProperties: 4
},
// Named exports should always use newlines
ExportDeclaration: "always"
}
],
"consistent-return": "off",
"no-multiple-empty-lines": [
"warn",
{
max: 1,
maxEOF: 1,
maxBOF: 0
}
],
"padding-line-between-statements": [
"warn",
// Always require a newline before returns
{ blankLine: "always", prev: "*", next: "return" },
// Always require a newline after directives
{ blankLine: "always", prev: "directive", next: "*" },
// Always require a newline after imports
{ blankLine: "always", prev: "import", next: "*" },
// Don't require a blank line between import statements
{ blankLine: "any", prev: "import", next: "import" },
// Newline after var blocks
{ blankLine: "always", prev: ["const", "let", "var"], next: "*" },
{
blankLine: "any",
prev: ["const", "let", "var"],
next: ["const", "let", "var"]
},
// Newline before conditionals/loops
{
blankLine: "always",
prev: "*",
next: ["if", "do", "while", "for"]
},
// Newline after blocks
{ blankLine: "always", prev: "block-like", next: "*" }
],
"no-restricted-syntax": [
"error",
// with()
"WithStatement"
],
"no-restricted-globals": [
"error",
{
name: "isNaN",
message: "isNaN is unsafe, use Number.isNaN"
},
{
name: "isFinite",
message: "isFinite is unsafe, use Number.isFinite"
}
]
}
};