Skip to content

Commit 1b6a4e0

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 bf7e0a7 commit 1b6a4e0

3 files changed

Lines changed: 49 additions & 0 deletions

File tree

.eslintrc.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
"arrow-body-style": ["error", "as-needed"],
31+
"comma-dangle": ["error", "always-multiline"],
32+
"no-trailing-spaces": ["error"],
33+
"semi": ["error", "always"]
34+
},
35+
"globals": {
36+
"diff_match_patch": "readonly",
37+
"$": "readonly",
38+
"jQuery": "readonly",
39+
"Chart": "readonly"
40+
}
41+
}

.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)