-
Notifications
You must be signed in to change notification settings - Fork 2
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
Consider adding more ESLint rules #6
Comments
Sure, feel free to raise a PR. (Or if you wanna, also for the extensions where you find them useful.) As long as they are not already included in the default set feel free to add them. |
None of the ones in my suggested list above are in their recommended set. When creating that list I tried to configure the rules to follow your existing coding style, but there were a few cases that were not clear, so I went with my personal preference:
It also might be good to use a newer more modern JS/ECMA version (such as Line 4 in 2068d62
.eslintrc file should also now be called .eslintrc.json .
|
I'm not convinced of that one, it also says “if used incorrectly” that can be a problem. The other rules are fine.
Hmm no preference here, Either remove my rule to remove the parens or force them. As for the modernization/renaming: Sure, go for it. I'd just rather not use "latest", but hardcode the latest version (2020 or so?) in there, as we usually develop against a minimum browser version and the extension needs to stay compatible here. |
OK, I removed it from my suggested list above.
Per the documentation, |
Sure 2021 is fine.
Well… I'd only increment it if we need a new feature. Otherwise why do so? Also, what is very clear: The version given there must be supported by the oldest browser mentioned in our |
https://caniuse.com/sr_es12 is BTW not very helpful 😲 |
Yes, for existing add-ons, but this repository is just a template, so presumably new add-ons would not need to worry about supporting old browsers as much. Note that a few of my suggested rules do require 2021.
There does not seem to be much coloration between JS/ECMA and browser versions, as browsers frequently implement the new features months or years before they are officially standardized, but sometimes not until after.
See here (scroll down): https://kangax.github.io/compat-table/es2016plus/ |
Looking at the over 260 ESLint rules, there have been a lot of potenchally useful ones implemented since this .eslintrc file was created. It would probably be good to add some them to this repository and your other add-ons.
Here are the rules I would specifically suggest adding (listed in the same order as the documentation):
Many of these would have automatically caught things you have mentioned in your reviews of my various PRs. Using these additional rules to check Unicodify and the Awesome Emoji Picker found a few mostly minor issues.
The text was updated successfully, but these errors were encountered: