Closed pdehaan closed 6 years ago
I auto-fixed a bunch of the ESLint issues locally using $ npm run lint:js -- --fix, but there are still a few issues you may want to tweak manually (or modify ESLint rules/config):
$ npm run lint:js
> cloud-storage-shield-study-webextension-experiment@1.0.0 lint:js /Users/pdehaan/dev/github/mozilla/shield-cloudstorage
> eslint webextension --ext=js,json,jsm
/Users/pdehaan/dev/github/mozilla/shield-cloudstorage/webextension/background.js
2:3 error Move function declaration to program root no-inner-declarations
3:2 error Mixed spaces and tabs no-mixed-spaces-and-tabs
3:4 error Unexpected tab character no-tabs
3:4 warning Unexpected console statement no-console
4:2 error Mixed spaces and tabs no-mixed-spaces-and-tabs
4:4 error Unexpected tab character no-tabs
5:2 error Unexpected tab character no-tabs
5:2 error Mixed spaces and tabs no-mixed-spaces-and-tabs
6:2 error Unexpected tab character no-tabs
6:2 error Mixed spaces and tabs no-mixed-spaces-and-tabs
6:8 warning Unexpected console statement no-console
7:2 error Mixed spaces and tabs no-mixed-spaces-and-tabs
7:2 error Unexpected tab character no-tabs
8:2 error Unexpected tab character no-tabs
8:2 error Mixed spaces and tabs no-mixed-spaces-and-tabs
11:3 error Move function declaration to program root no-inner-declarations
12:2 error Mixed spaces and tabs no-mixed-spaces-and-tabs
12:4 warning Unexpected console statement no-console
12:4 error Unexpected tab character no-tabs
13:2 error Mixed spaces and tabs no-mixed-spaces-and-tabs
13:4 error Unexpected tab character no-tabs
14:2 error Unexpected tab character no-tabs
14:2 error Mixed spaces and tabs no-mixed-spaces-and-tabs
15:2 error Unexpected tab character no-tabs
15:2 error Mixed spaces and tabs no-mixed-spaces-and-tabs
15:8 warning Unexpected console statement no-console
16:2 error Unexpected tab character no-tabs
16:2 error Mixed spaces and tabs no-mixed-spaces-and-tabs
17:2 error Unexpected tab character no-tabs
17:2 error Mixed spaces and tabs no-mixed-spaces-and-tabs
23:3 warning Unexpected console statement no-console
/Users/pdehaan/dev/github/mozilla/shield-cloudstorage/webextension/privileged/ui/CloudDownloadsView.jsm
23:7 error Ci is now defined in global scope, a separate definition is no longer necessary mozilla/no-define-cc-etc
23:12 error Use Ci rather than Components.interfaces mozilla/use-cc-etc
25:1 error Unexpected var, use let or const instead no-var
348:23 error Expected '===' and instead saw '==' eqeqeq
473:5 error Unexpected lexical declaration in case block no-case-declarations
473:5 error Unexpected lexical declaration in case block no-case-declarations
485:1 error Unexpected var, use let or const instead no-var
621:1 error Unexpected var, use let or const instead no-var
641:73 error Expected '===' and instead saw '==' eqeqeq
642:73 error Expected '===' and instead saw '==' eqeqeq
/Users/pdehaan/dev/github/mozilla/shield-cloudstorage/webextension/privileged/ui/cloudstorage.js
15:36 error Cu.import imports into variables and into global scope mozilla/no-import-into-var-and-global
22:11 warning Unexpected console statement no-console
✖ 43 problems (37 errors, 6 warnings)
And stylelint reports a few errors, which may be worth investigating:
$ npm run lint:css
> cloud-storage-shield-study-webextension-experiment@1.0.0 lint:css /Users/pdehaan/dev/github/mozilla/shield-cloudstorage
> stylelint 'webextension/skin/*.css'
webextension/skin/clouddownloads.css
15:1 ✖ Unexpected unknown type selector "richlistitem" selector-type-no-unknown
19:1 ✖ Unexpected unknown type selector "richlistitem" selector-type-no-unknown
55:1 ✖ Unexpected duplicate selector "#cloudDownloadTypeIcon", first used at line 48 no-duplicate-selectors
75:22 ✖ Unexpected unknown type selector "radio" selector-type-no-unknown
88:22 ✖ Unexpected unknown type selector "radio" selector-type-no-unknown
92:22 ✖ Unexpected unknown type selector "radio" selector-type-no-unknown
126:32 ✖ Unexpected unknown type selector "menuseparator" selector-type-no-unknown
@pdehaan +1, Thanks for filing, will run lint and update PR with fixes
PR updated with the fix
Rough first stab at implementation...
package.json:
.eslintrc.js:
.stylelintrc