-
Notifications
You must be signed in to change notification settings - Fork 19
/
.eslintrc.js
112 lines (94 loc) · 3.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
module.exports = {
extends : [
"@tivac",
"plugin:jest/recommended",
"plugin:eslint-comments/recommended",
],
parser : "@babel/eslint-parser",
parserOptions : {
requireConfigFile : false,
},
env : {
node : true,
jest : true,
es6 : true,
},
plugins : [
"jest",
],
reportUnusedDisableDirectives : true,
rules : {
"max-statements" : [ "warn", 25 ],
"newline-after-var" : "off",
"newline-before-return" : "off",
"lines-around-directive" : "off",
"padding-line-between-statements" : [
"warn",
// Always want a newline before "return"
{ blankLine : "always", prev : "*", next : "return" },
// Newline after variable declarations
{ blankLine : "always", prev : [ "const", "let", "var" ], next : "*" },
{ blankLine : "any", prev : [ "const", "let", "var" ], next : [ "const", "let", "var" ] },
// Newline after directives
{ blankLine : "always", prev : "directive", next : "*" },
{ blankLine : "any", prev : "directive", next : "directive" },
],
"no-unused-vars" : [ "warn", {
varsIgnorePattern : "^_",
argsIgnorePattern : "^_",
}],
// Plugins
"eslint-comments/require-description" : "warn",
"eslint-comments/disable-enable-pair" : [ "warn", { allowWholeFile : true }],
},
overrides : [{
files : [ "packages/www/**/*" ],
extends : [
"plugin:@tivac/svelte/recommended",
],
}, {
files : [ "packages/www/**/*.svelte" ],
extends : [
"plugin:@tivac/svelte/recommended",
"plugin:svelte/recommended",
],
// Parse the `<script>` in `.svelte` using babel's parser for import() support
parserOptions : {
parser : "@babel/eslint-parser",
},
rules : {
// Disabled in favor of svelte/indent further down
indent : "off",
// Security
// Disabled because we use 'em to show markdown content
"svelte/no-at-html-tags" : "off",
// Best Practices
"svelte/no-useless-mustaches" : "warn",
// Stylistic Issues
"svelte/require-optimized-style-attribute" : "error",
"svelte/first-attribute-linebreak" : [ "warn", {
singleline : "beside",
multiline : "below",
}],
"svelte/html-closing-bracket-spacing" : "warn",
"svelte/html-quotes" : [ "warn", {
prefer : "double",
}],
"svelte/indent" : [ "warn", {
indent : 4,
indentScript : false,
alignAttributesVertically : true,
}],
"svelte/max-attributes-per-line" : [ "warn", {
singleline : 3,
}],
"svelte/mustache-spacing" : "warn",
"svelte/no-spaces-around-equal-signs-in-attribute" : "warn",
"svelte/prefer-class-directive" : "off",
"svelte/prefer-style-directive" : "warn",
"svelte/shorthand-attribute" : "warn",
"svelte/shorthand-directive" : "warn",
"svelte/spaced-html-comment" : "warn",
},
}],
};