annotate .eslintrc.js @ 8254:4d36432bf705

eslint: install eslint with front-end so it can be run manually eslint can be run manually on the main .js files with: ./node_modules/.bin/eslint kallithea/public/js/base.js kallithea/public/js/codemirror_loadmode.js kallithea/public/js/graph.js - but it is quite noisy. Some problems do however stand out as relevant to fix. Script sections in HTML files can also be checked after removing mako markup: hg up -cr. sed -i -e 's/\${[^{}]*\({[^{}]*}[^{}]*\)*}/""/g' -e 's/%\(if\|else\|endif\|for\|endfor\)\>.*//g' -e 's/##.*//g' $(hg loc 'kallithea/templates/**.html') vim kallithea/templates/pullrequests/pullrequest.html +139 # blank out the multi line 'var url = ${}' ./node_modules/.bin/eslint $(hg loc 'kallithea/templates/**.html') hg up -Cr. - but that is even more noisy. The noise is mainly due to eslint not knowing that everything runs together, with kallithea/templates/base/root.html defining global variables, kallithea/public/js/base.js using these and defining functions, which then is used "everywhere". There might be solutions to that - this is a starting point.
author Mads Kiilerich <mads@kiilerich.com>
date Sun, 16 Feb 2020 02:12:48 +0100
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8254
4d36432bf705 eslint: install eslint with front-end so it can be run manually
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
1 module.exports = {
4d36432bf705 eslint: install eslint with front-end so it can be run manually
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
2 "env": {
4d36432bf705 eslint: install eslint with front-end so it can be run manually
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
3 "browser": true,
4d36432bf705 eslint: install eslint with front-end so it can be run manually
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
4 "es6": true,
4d36432bf705 eslint: install eslint with front-end so it can be run manually
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
5 "jquery": true
4d36432bf705 eslint: install eslint with front-end so it can be run manually
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
6 },
4d36432bf705 eslint: install eslint with front-end so it can be run manually
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
7 "extends": "eslint:recommended",
4d36432bf705 eslint: install eslint with front-end so it can be run manually
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
8 "globals": {
4d36432bf705 eslint: install eslint with front-end so it can be run manually
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
9 "Atomics": "readonly",
4d36432bf705 eslint: install eslint with front-end so it can be run manually
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
10 "SharedArrayBuffer": "readonly"
4d36432bf705 eslint: install eslint with front-end so it can be run manually
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
11 },
4d36432bf705 eslint: install eslint with front-end so it can be run manually
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
12 "parserOptions": {
4d36432bf705 eslint: install eslint with front-end so it can be run manually
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
13 "ecmaVersion": 2018,
4d36432bf705 eslint: install eslint with front-end so it can be run manually
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
14 "sourceType": "module"
4d36432bf705 eslint: install eslint with front-end so it can be run manually
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
15 },
4d36432bf705 eslint: install eslint with front-end so it can be run manually
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
16 "plugins": [
4d36432bf705 eslint: install eslint with front-end so it can be run manually
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
17 "html"
4d36432bf705 eslint: install eslint with front-end so it can be run manually
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
18 ],
4d36432bf705 eslint: install eslint with front-end so it can be run manually
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
19 "rules": {
4d36432bf705 eslint: install eslint with front-end so it can be run manually
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
20 }
4d36432bf705 eslint: install eslint with front-end so it can be run manually
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
21 };