-
-
Couldn't load subscription status.
- Fork 417
feat: add 'unopinionated' config #2715
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
feat: add 'unopinionated' config #2715
Conversation
|
I don't think "Type safety makes this much less useful" is a good reason to make rule 'opinionated'. If I understand it correctly. It should only include rules for correctness, there should be only a few rules. |
45b069b to
b31c759
Compare
|
Rules like Strictly speaking, part of |
|
Ok I think I adjusted for that? |
|
I didn't go through all rules, but I still think there are too many rules in this preset. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
|
Can you fix the conflicts? |
|
👍 Done. I added the two newly introduced rules, |
|
Update: also the new |
|
One more rule to add: 5f27ec2 And a merge conflict fix. and then this is ready for merge. |
|
Thanks for doing this 🙏 |
|
Thanks for all the feedback & reviews, this is really exciting! |
|
It appears that I might've run into the downstream effects of this PR. They don't seem to all actually be though. For example, Think for example this const result = doThing()
if (result !== undefined) {
... happy path...
} else {
... some other handling/cleanup...
}The way this is written is a direct representation of my mental model of the control flow being put into code. Sonarcloud however now is telling me that this would be a code smell, because it's "hard to understand", even though the way it is written makes things easier to understand (for me at least). Thus, you may perhaps want to revisit the "unopinionated" rule classifications. That all said, I don't have a horse in this race since I just got rid of Sonar and don't use this eslint plugin, so feel free to discard this input. |
|
Please open an issue for the rules you think are opinionated. We can discuss. |
Fixes #896.
Adds all rules from
recommendedto a newunopinionatedconfig, with the exception of rules that add in subjective opinions >1% of users might not want (per my vague guesstimation). This list was generated by looking through #896 & linked issues, then running on my personal repos:.toMatchInlineSnapshot()This
unopinionatedconfig does include the following rules that were mentioned as being candidates for removal:consistent-returndoesn't enforce correctnessI recognize I'm not an expert on this plugin and look forward to learning why some rules should(n't) be on those lists.☺️