Skip to content
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

Merged
merged 2 commits into from Sep 15, 2017

Conversation

aladdin-add
Copy link
Member

@aladdin-add aladdin-add commented Sep 15, 2017

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:
image

Is there anything you'd like reviewers to focus on?

new RegExp("^\\s*var\\s.+=\\s*require\\s*\\(/");

it didn't cause an error, but when apply the config, it didn't work. is this expected?

@eslintbot
Copy link

LGTM

@mention-bot
Copy link

@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.

Copy link
Member

@not-an-aardvark not-an-aardvark left a 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.

@@ -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:
Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member

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.)

Copy link
Member Author

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.:)

@not-an-aardvark not-an-aardvark added the documentation Relates to ESLint's documentation label Sep 15, 2017
@eslintbot
Copy link

LGTM

Copy link
Member

@not-an-aardvark not-an-aardvark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Copy link
Member

@platinumazure platinumazure left a 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.

@not-an-aardvark
Copy link
Member

Closing and reopening to restart the appveyor build.

@btmills btmills merged commit 4431d68 into eslint:master Sep 15, 2017
@aladdin-add aladdin-add deleted the docs-fix-max-len branch September 15, 2017 19:27
aladdin-add added a commit to aladdin-add/eslint that referenced this pull request Sep 18, 2017
ilyavolodin pushed a commit that referenced this pull request Sep 18, 2017
* 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.
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Mar 15, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Mar 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion documentation Relates to ESLint's documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants