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
Docs: Add configuration comments in examples #13738
Conversation
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.
Nice catch!
The PR is correct, but it looks like some examples were not :)
Examples of **incorrect** code for this rule: | ||
|
||
```js | ||
/*eslint no-unmodified-loop-condition: "error"*/ | ||
|
||
while (node) { | ||
doSomething(node); | ||
} |
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 doesn't seem to work in the demo (at least when I try), maybe the variables have to be declared?
@yeonjuan if this really should be fixed, what do you think about doing that in this PR or in another PR?
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.
if this really should be fixed, what do you think about doing that in this PR or in another PR?
@mdjermanovic I think doing in this PR nice. I fixed it. Thanks 👍
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.
Thanks! The example with for-loop also doesn't work, but that seems to be a more complex problem for another PR. I'm not sure what was the expected behavior.
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!
Prerequisites checklist
What is the purpose of this pull request? (put an "X" next to an item)
[x] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:
What changes did you make? (Give an overview)
I added missing configuration comments in the documents. It's quite useful for a quick demo :)
Is there anything you'd like reviewers to focus on?
no.