-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
47 lines (46 loc) · 1.64 KB
/
Copy patheslint.config.js
File metadata and controls
47 lines (46 loc) · 1.64 KB
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
import js from "@eslint/js"
import globals from "globals"
export default [
{
// The config UI is the only JavaScript worth checking. tools/callgraph_web is generated.
ignores: ["tools/**", "build/**", "dist/**", "index.html"],
},
js.configs.recommended,
{
files: ["src/statsbadge/web/*.js"],
languageOptions: {
ecmaVersion: "latest",
sourceType: "script",
globals: globals.browser,
},
rules: {
semi: ["error", "never"],
// A line opening with a bracket or a template literal continues the one above it
// where there is no semicolon to say otherwise.
"no-unexpected-multiline": "error",
quotes: ["error", "double", { avoidEscape: true }],
"comma-dangle": ["error", "always-multiline"],
// Two spaces a level, and a continuation lines up under whatever it continues, which
// is how the Python here is written too. No line length: ruff does not check one either.
indent: ["error", 2, {
flatTernaryExpressions: true,
ArrayExpression: "first",
ObjectExpression: "first",
CallExpression: { arguments: "first" },
FunctionDeclaration: { parameters: "first" },
FunctionExpression: { parameters: "first" },
VariableDeclarator: "first",
}],
"no-var": "error",
"prefer-const": "error",
"prefer-template": "error",
"object-shorthand": "error",
"arrow-parens": ["error", "always"],
eqeqeq: ["error", "smart"],
"dot-notation": "error",
"no-else-return": "error",
"no-unused-vars": ["error", { caughtErrors: "none" }],
curly: ["error", "multi-line"],
},
},
]