Closed kieckhafer closed 5 years ago
I started a list a couple weeks ago as I added our linting rules to a codebase that did not previously have them. In my prime I used to get fired up about linting rules but nowdays I only have problems with the weird pointy ones that tell me I can't do things that every other kid on the block does. Mom and Dad, please.
error
in our config, and I would like the rule to be disabled.function() {}
is pretty conventional, but if somebody pushes hard for function () {}
I won't glare at them. Things like this fall into "who cares as long as it's consistent and --fix
able".I care even less about these but don't really understand why they are enforced:
@zenweasel @spencern @aldeed
Are there any new rules that you would like enforced, or older rules that should be removed, in this 2.0.0
release: https://github.com/reactioncommerce/reaction-eslint-config/pull/17
What about the rules @rosshadden mentioned above?
@aldeed you mentioned a few here, still contemplating those? https://github.com/reactioncommerce/reaction-eslint-config/issues/5
function
is a keyword. (From Crockford's original guidelines I believe.) So I'm partial to that. But I think it's somewhat a moot point because we also have eslint rule that requires all anonymous functions be arrow functions, so function () {
should never appear anywhere. I think in a perfect world, I'd actually disallow anonymous functions entirely because names are helpful in the stack trace.always-return
but catch-or-return
helps avoid errors being swallowed so it's very important. I can't tell you how many hours I've lost debugging issues that were due to errors being thrown in async functions that didn't have a catch
anywhere in the chain.recommended
config for that and disable any that we don't like, but I think in particular the ones that ensure we are not using deprecated APIs or APIs that are unavailable in the depended version of Node are useful.I'd also update to latest of all the plugin packages if you haven't already @kieckhafer
Well, just a note that things like prefer-destructuring
aren't for people like @rosshadden, they are for less experienced people who just don't do it, and in general when you can, you should. You can always disable it for a particular line if you have a good reason to do it and a comment why you did is probably good learning for everybody and without that we don't know if you intended to or just forgot.
That and catch-and-return
are good guardrails for people imho. Experts can break the rules when needed.
So it seems like we should keep all the rules that were mentioned to be seen more as helpful rules for beginners as opposed to annoying rules for more experienced developers.
:tada: This issue has been resolved in version 1.10.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
After auditing all existing
eslint
warnings, we will be releasing v.2.0.0 of this config. We should spend some time revisiting the existing rules and adding any new rules we see fit prior to this release.Please use this ticket for any discussion about what to remove / add / update.