-
Notifications
You must be signed in to change notification settings - Fork 65
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
prefer-matches should be prefer-isMatch #77
Comments
I think this is caused by my mistake when I originally proposed this rule in #4. 😊 |
Huh, I thought maybe |
I only changed the error message for now and not the rule name, since removing a rule is a breaking change (anyone who uses the rule explicitly and not in a config would have to change it, or ESLint would fail). |
Migration path idea: You could rename the rule, and then add a new entry in the It's a bit trickier in this repo since you automated the indexing, but doable nonetheless // index.js
var rules = _.assign(
_.zipObject(rules, rules.map(rule => require(`./rules/${rule}`))),
{'prefer-matches': require('./rules/prefer-isMatch')}
);
module.exports = {
rules: rules,
} |
Thanks for the offer, but that would mean that the rule would exist twice in the meantime, and every time a user violates it, they would get two errors with the same message per violation. I think the best course of action is to leave this for now and put it on the list of things to change in the next major version. |
The prefer-matches rule does not work as currently constructed. The function _.matches only takes one argument and returns a function. Whereas ._isMatch will take two arguments and return a boolean. I'm pretty sure that's what you're looking for.
Thanks so much for this terrific library.
The text was updated successfully, but these errors were encountered: