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

Core rule messages should use our template syntax and avoid concatenation #6977

Closed
platinumazure opened this issue Aug 25, 2016 · 8 comments
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 chore This change is not user-facing rule Relates to ESLint's core rules

Comments

@platinumazure
Copy link
Member

Goal is to make sure all rule messages that need runtime data use the {{ variable }} format and the data: key, rather than string concatenation or ES6 template literals.

@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Aug 25, 2016
@platinumazure platinumazure added rule Relates to ESLint's core rules accepted There is consensus among the team that this change meets the criteria for inclusion chore This change is not user-facing and removed triage An ESLint team member will look at this issue soon labels Aug 25, 2016
@platinumazure
Copy link
Member Author

Note; Discussion came up in chat about whether we should consider just using ES6 templates instead. At this point I just want to get all the rules into our "current"/"old" style before we consider a huge change like that (which would be breaking unless we supported the current form, anyway).

@kaicataldo
Copy link
Member

I like the idea of doing this task as a prerequisite to #6407 (comment). We can use ES6 template literals everywhere else.

@platinumazure
Copy link
Member Author

Working on this. I might just do the ES6 templates everywhere else in
lib/rules so that someone can use prefer-template to help make sure I
didn't miss any.

On Aug 25, 2016 9:56 PM, "Kai Cataldo" notifications@github.com wrote:

I like the idea of doing this task as a prerequisite to #6407 (comment)
#6407 (comment). We
can use ES6 template literals everywhere else.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#6977 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AARWelISSYiXnvNU2n5_cEdw-XC8WSQAks5qjlXEgaJpZM4Jtg74
.

@kaicataldo
Copy link
Member

Great. I can work on the converting to template literals in other directories besides lib/rules.

@platinumazure
Copy link
Member Author

PR up at #6989.

@gyandeeps
Copy link
Member

Just curious, why are we just not going directly to template strings? (sorry if I missed the discussion)

@platinumazure
Copy link
Member Author

platinumazure commented Aug 27, 2016

@gyandeeps At this point, for no real reason besides following our own guidelines for how to write rules.

There's also issue #6740-- one benefit I could see from that issue is being able to show possible rule messages (with format placeholder) in CLI docs. That said, if there is a way to take a template string and render it as a string without interpolation, I wouldn't be opposed to using that format. I'm not super familiar with template strings, so maybe there is a way.

@mysticatea
Copy link
Member

I prefer #6740 than ES templates because it's easier to support i18n 😇

@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 chore This change is not user-facing rule Relates to ESLint's core rules
Projects
None yet
Development

No branches or pull requests

5 participants