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: fix wrong config in max-len example. #9309
Conversation
LGTM |
@aladdin-add, thanks for your PR! By analyzing the history of the files in this pull request, we identified @scriptdaemon, @iancmyers and @nzakas to be potential reviewers. |
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.
Hmm, that is strange. It seems like backslash escaping is being handled differently in /* eslint */
comments -- that might be a bug in the comment processing.
docs/rules/max-len.md
Outdated
@@ -147,7 +147,7 @@ var longRegExpLiteral = /this is a really really really really really long regul | |||
Examples of **correct** code for this rule with the `{ "ignorePattern": true }` option: |
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.
I think this line is also incorrect: ignorePattern
is a string option, so ignorePattern: true
doesn't make sense.
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.
maybe it make more sense to allow string
and regex
-- using RegExp(string)
can be confusing, and sometimes different behavior. thoughts?
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.
I think there are multiple issues we're discussing in this PR -- maybe we should separate them:
- The current example in the documentation doesn't work, so I think we should fix it in this PR.
- It seems like the comment parsing for config comments might have confusing behavior with backslashes. (Maybe we should create a new issue for this.)
- It might be simpler for the rule to have a regex option rather than a string. (I think it's unlikely that this will work because we need to support JSON config files which don't support regex. However, feel free to create a new issue for it if you'd like.)
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.
agree. updated the PR, so it will not block the merge.:)
LGTM |
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!
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 LGTM but I'd like another set of eyes.
Closing and reopening to restart the appveyor build. |
This reverts commit 4431d68.
* Revert "4.7.0" This reverts commit 439e8e6. * Revert "Build: changelog update for 4.7.0" This reverts commit 2ec62f9. * Revert "Upgrade: Espree v3.5.1 (fixes #9153) (#9314)" This reverts commit 787b78b. * Revert "Update: run rules after `node.parent` is already set (fixes #9122) (#9283)" This reverts commit 1488b51. * Revert "Docs: fix wrong config in max-len example. (#9309)" This reverts commit 4431d68. * Revert "Chore: Revert "avoid handling Rules instances in config-validator" (#9295)" This reverts commit 9d1df92. * Revert "Docs: Fix code snippet to refer to the correct option (#9313)" This reverts commit 7d24dde. * Revert "�Chore: rewrite parseListConfig for a small perf gain. (#9300)" This reverts commit 12388d4.
What is the purpose of this pull request? (put an "X" next to item)
[x] Documentation update
What changes did you make? (Give an overview)
this regex will cause an error:
Is there anything you'd like reviewers to focus on?
it didn't cause an error, but when apply the config, it didn't work. is this expected?