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

Rule message substitution will get confused with triple braces #6988

Closed
platinumazure opened this issue Aug 27, 2016 · 1 comment
Closed
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly core Relates to ESLint's core APIs and features

Comments

@platinumazure
Copy link
Member

platinumazure commented Aug 27, 2016

Currently, it is impossible to perform rule substitution for no-regex-spaces because the message displays a number in curly braces (representing a regex quantifier).

The correct message: "Spaces are hard to count. Use {{{count}}}."

However, the regex for rule message substitution looks for \{\{\s*(.+?)\s*\}\}, which will result in the substitution code looking for a "{count}" key.

I'd like to replace (.+?) with ([^}]+?). This will force the regex to match {{count}} and extract "count" as the key.

@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Aug 27, 2016
@platinumazure platinumazure added bug ESLint is working incorrectly core Relates to ESLint's core APIs and features evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels Aug 27, 2016
@nzakas nzakas added accepted There is consensus among the team that this change meets the criteria for inclusion and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Sep 1, 2016
@nzakas
Copy link
Member

nzakas commented Sep 1, 2016

Go for it. You can accept bugs that you've verified.

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 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 Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly core Relates to ESLint's core APIs and features
Projects
None yet
Development

No branches or pull requests

3 participants