-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.cjs
81 lines (81 loc) · 2.48 KB
/
.eslintrc.cjs
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
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:svelte/recommended',
],
plugins: ['@typescript-eslint'],
ignorePatterns: ['*.cjs'],
overrides: [
{
files: ["*.svelte"],
parser: "svelte-eslint-parser",
parserOptions: {
parser: "@typescript-eslint/parser",
},
},
],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020
},
env: {
browser: true,
es2017: true,
node: true
},
rules: {
"arrow-parens": ["error", "as-needed", { requireForBlockBody: false }],
// disallow semi-colon
"semi": ["error", "never"],
"quotes": ["error", "double"],
"array-element-newline": ["error", "consistent"],
"no-self-assign": "off",
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
'@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports' }],
"svelte/indent": ["error", {
"indentScript": false,
"indent": 4,
}],
"svelte/prefer-style-directive": ["error"],
"svelte/sort-attributes": ["error"],
"svelte/shorthand-directive": ["error", {
"prefer": "always",
}],
"svelte/no-spaces-around-equal-signs-in-attribute": ["error"],
"svelte/html-quotes": ["error", {
"prefer": "double",
"dynamic": {
"quoted": false,
"avoidInvalidUnquotedInHTML": false
}
}],
"svelte/no-at-html-tags": "warn",
"svelte/mustache-spacing": ["error", {
"attributesAndProps": "always",
"textExpressions": "always", // or "always"
"attributesAndProps": "never", // or "always"
"directiveExpressions": "always", // or "always"
"tags": {
"openingBrace": "never",
"closingBrace": "never",
}
}],
"svelte/max-attributes-per-line": [
"error",
{
"multiline": 1,
"singleline": 1
}
],
"svelte/first-attribute-linebreak": [
"error",
{
"multiline": "below", // or "beside"
"singleline": "beside" // "below"
}
]
}
};