-
-
Notifications
You must be signed in to change notification settings - Fork 353
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
Indicate which rules provide suggestions in readme rules table #1306
Indicate which rules provide suggestions in readme rules table #1306
Conversation
568016b
to
2068ea1
Compare
Actually, we can test this, some code here https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/test/utils/test.mjs should work. |
Added a test to ensure |
Yes, but add it to snapshot tester too, please. |
Co-authored-by: fisker Cheung <lionkay@gmail.com>
Co-authored-by: fisker Cheung <lionkay@gmail.com>
test/utils/test.mjs
Outdated
@@ -112,6 +117,7 @@ class Tester { | |||
const tester = snapshotRuleTester(test, { | |||
parserOptions: defaultParserOptions | |||
}); | |||
verifySuggestionPropertyConsistency(this.rule, tests.invalid); |
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.
This won't work because snapshot tester don't need set errors
, should check here
const {suggestions = []} = message; |
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.
Fixed.
Fixes #1292.
This is another useful point of information about rules that we can include in our readme rules table.
Note that this property name/location will likely change slightly in ESLint 8 and become enforced so that it will be more reliable: eslint/eslint#14312