-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy patheslint.config.mjs
58 lines (57 loc) · 1.73 KB
/
eslint.config.mjs
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
import pluginJs from "@eslint/js";
/** @type {import('eslint').Linter.Config[]} */
export default [
{
files: ["ntag215.js"],
languageOptions: {
sourceType: "script"
}
},
{
languageOptions: {
globals: {
process: "readonly",
require: "readonly",
clearTimeout: "readonly",
setTimeout: "readonly",
setWatch: "readonly",
clearWatch: "readonly",
console: "readonly",
E: "readonly",
NRF: "readonly",
analogWrite: "readonly",
digitalWrite: "readonly",
D14: "readonly"
}
}
},
pluginJs.configs.recommended,
{
rules: {
"prefer-const": ["warn", {
"destructuring": "all",
"ignoreReadBeforeAssign": true
}],
"no-unused-vars": ["error", {
"varsIgnorePattern": "^_|fastMode",
"argsIgnorePattern": "^_"
}],
"no-var": "error",
"indent": ["error", 2, { "SwitchCase": 1 }],
"quotes": ["error", "double"],
"semi": ["error", "always"],
"comma-dangle": ["error", "never"],
"space-before-function-paren": ["error", "never"],
"keyword-spacing": ["error", { "before": true, "after": true }],
"newline-before-return": "error",
"padding-line-between-statements": [
"error",
{ "blankLine": "always", "prev": "*", "next": "return" },
{ "blankLine": "always", "prev": ["const", "let", "var"], "next": "*"},
{ "blankLine": "any", "prev": ["const", "let", "var"], "next": ["const", "let", "var"] },
{ "blankLine": "always", "prev": "*", "next": ["if", "for", "while", "switch", "try"] },
{ "blankLine": "always", "prev": ["if", "for", "while", "switch", "try"], "next": "*" }
]
}
}
];