-
-
Notifications
You must be signed in to change notification settings - Fork 542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ESLint check #2438
Add ESLint check #2438
Conversation
Currently have continue-on-error on and JSLint also not remove, should it be remove? There is still allow lint that I did not fix. |
Currently still have 75 errors |
hi @dodieboy |
JSLint is not doing anything at the moment "Stopping. (4% scanned)."
it doesnt understand (not that I would expect it to) manifest.json so doesnt know
init.js is the last file injected and extension was defined all the way back in core.js youtube/js&css/extension/core.js Line 24 in d4a8733
but the worst thing about jslint is how opinionated Crockford is leading to some hardcoded nonsense like prohibited Tabs or code indentation. Imo no point keeping JSLint around with ESLint in place.
at first glance ESLint seem to have a grasp of file order? did you instrument this manually by giving it some sort of a map? for example
it doesnt mindlessly complain about "ImprovedTube not defined". Did you configure it with no-undef? Hmm it doesnt complain about undefined Do you know of a way of instrumenting ESLint about execution contexts and order of files? Even if it had explicit support for linking web extensions by parsing manifest.json that would only solve /extension/ part of the extension. /web-accessible/ are manually injected in particular order youtube/js&css/extension/init.js Lines 58 to 69 in d4a8733
and afaik there is no way for linter to know that. Something like a test_extension.js file containing
and test_webaccessible.js
with ESLint running only over those two files? Problem: There are more no-redeclare errors in appearance.js later in the file, like
that it fails to flag, I dont know why yet. Also doesnt complain about stray spaces [no-multi-spaces], this is super minor :) Personally I really dont like the Java switch indent rules, much prefer saner php ones as they actually make Switch/case visible from far without reading the code. Imo Switch statement https://www.crockford.com/code.html "This avoids over-indentation." is a huge crock of bullshit :) JSLint is very badly opinionated in this way :( beautifier/js-beautify#15 also agrees with me and indents 'case' properly, can check it out at https://beautifier.io. You edited a ton of files crushing Switch statements according to Crockford fantasy :( :)
Everything doesnt have to pass from the get go, we can have few months of linter not passing while we systematically fix errors. TLDR: EDIT: the flattened Switch statements, Revert all changes + EDIT2:
|
After reading thro all the changes only 39658f7 will require some reverts after applying another rule to the pile: |
I think this 16531ca broke the Action?
|
I will look into it later |
as expected :D
means we indeed need those:
created and thrown into /test/ directory, and ESLint run only on 'background.js test_extension.js test_webaccessible.js test_menu.js' and nothing else
saw that in your config (Im learning about configuring elsing as I go) and dont like it. Linter will still assume functions from other .js files are not defined in file being parsed at this moment etc.
please dont :) better to massage eslint into interpreting all files in related bundles (menu/extension/webaccessible). |
Added the new rule and refix the indent base on the new rule |
Removed the cache function for now, when everything confirm already than I will add it back |
Added ESLint into the test as mention on #2332 with some config like indent "tab", ignore empty catch and more