Skip to content

Commit 6c7049e

Browse files
committed
[IMP] runbot: add eslint basic config
Based on the `web/tooling` eslint configuration, but trimmed down to only use `eslint` itself (and not prettier).
1 parent a00977c commit 6c7049e

4 files changed

Lines changed: 60 additions & 0 deletions

File tree

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lib

.eslintrc.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"extends": ["eslint:recommended"],
3+
"parserOptions": {
4+
"sourceType": "module",
5+
"ecmaVersion": 2022
6+
},
7+
"env": {
8+
"browser": true,
9+
"es6": true
10+
},
11+
"rules": {
12+
"no-undef": ["error"],
13+
"no-restricted-globals": ["error", "event", "self"],
14+
"no-const-assign": ["error"],
15+
"no-debugger": ["error"],
16+
"no-dupe-class-members": ["error"],
17+
"no-dupe-keys": ["error"],
18+
"no-dupe-args": ["error"],
19+
"no-dupe-else-if": ["error"],
20+
"no-unsafe-negation": ["error"],
21+
"no-duplicate-imports": ["error"],
22+
"valid-typeof": ["error"],
23+
"no-unused-vars": ["error", { "vars": "all", "args": "none", "ignoreRestSiblings": false, "caughtErrors": "all" }],
24+
"curly": ["error", "all"],
25+
"no-restricted-syntax": ["error", "PrivateIdentifier"],
26+
"prefer-const": ["error", {
27+
"destructuring": "all",
28+
"ignoreReadBeforeAssign": true
29+
}],
30+
"no-console": ["warn"],
31+
"no-var": ["error"],
32+
"arrow-body-style": ["error", "as-needed"],
33+
"arrow-parens": ["error"],
34+
"brace-style": ["error"],
35+
"object-curly-spacing": ["error", "always"],
36+
"array-bracket-spacing": ["error"],
37+
"comma-dangle": ["error", "always-multiline"],
38+
"semi": ["error", "always"],
39+
"quotes": ["error", "double"],
40+
"indent": ["error", 4, { "SwitchCase": 1 }],
41+
"eol-last": ["error"],
42+
"no-multiple-empty-lines": ["error"],
43+
"no-trailing-spaces": ["error"]
44+
},
45+
"globals": {
46+
"diff_match_patch": "readonly",
47+
"$": "readonly",
48+
"jQuery": "readonly",
49+
"Chart": "readonly"
50+
}
51+
}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ runbot/static/nginx
1212
runbot/static/databases
1313
runbot/static/docker
1414
runbot/static/docker-registry
15+
# npm files
16+
node_modules
17+
package-lock.json

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"devDependencies": {
3+
"eslint": "^8.27.0"
4+
}
5+
}

0 commit comments

Comments
 (0)