-
Notifications
You must be signed in to change notification settings - Fork 26.8k
Open
Description
- Original discussion: What rules do the community tend to override? #1089 (comment)
- Patch: Add new-cap exceptions for immutable.js #1090
I don't want to bikeshed on this, but I do have some concerns about this rule change I'd like to bring up.
My biggest concern is that it will lead to more people overriding the new-cap rule than in the past because this new rule is so limited in scope. This would be the opposite of the intended outcome of #1089.
- This rule creates exceptions for
Immutable.{Map,Set,List} - The Immutable API contains many more types (Record, Seq, Collection, OrderedMap, etc)
The result is that eslint will tell people to use new for new Immutable.Record() AND to NOT use new for Immutable.Map(). The only way to make this consistent is to override the rule in your local environment, and this will be incredibly common.
My suggestion is to either:
- revert the rule change
- re-implement the rule to use
capIsNewExceptionPatterninstead ofcapIsNewExceptionsin order to target the entire Immutable.js API with a regular expression.
If this interests you I'm happy to submit a patch for either choice.
Metadata
Metadata
Assignees
Labels
No labels