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 proposal: Template tag spacing #7631

Closed
1 of 4 tasks
Assignees
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 feature This change adds a new feature to ESLint help wanted The team would welcome a contribution from the community for this issue rule Relates to ESLint's core rules

Comments

@phaux
Copy link

phaux commented Nov 21, 2016

Please describe what the rule should do: Similar to func-call-spacing – it would enforce spacing between template tag and template literal.

What category of rule is this? (place an "X" next to just one item)

  • Enforces code style
  • Warns about a potential error
  • Suggests an alternate way of doing something
  • Other (please specify:)

Provide 2-3 code examples that this rule will warn about:

// correct with spacing required
const [user] = await sql `SELECT * FROM users WHERE id = ${id}`
ctx.body = {
  name: user.name,
  avatar: escape `/avatars/${user.id}.jpg`,
}

// correct with spacing disallowed
const [user] = await sql`SELECT * FROM users WHERE id = ${id}`
ctx.body = {
  name: user.name,
  avatar: escape`/avatars/${user.id}.jpg`,
}
@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Nov 21, 2016
@platinumazure platinumazure added evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion feature This change adds a new feature to ESLint rule Relates to ESLint's core rules and removed triage An ESLint team member will look at this issue soon labels Nov 21, 2016
@platinumazure
Copy link
Member

Seems reasonable to me-- I'll 👍 this.

@vitorbal
Copy link
Member

I'll 👍 this too. I think we should allow configuring "always" or "never"
having spacing btwn them.
On Mon, Nov 21, 2016 at 7:52 PM Kevin Partington notifications@github.com
wrote:

Seems reasonable to me-- I'll 👍 this.


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

@dead-claudia
Copy link

👍 from me, too. And I agree @vitorbal (although one space should also be an option).

@vitorbal
Copy link
Member

@phaux are you willing to work on a PR for this if it gets accepted?

@phaux
Copy link
Author

phaux commented Nov 24, 2016

@vitorbal I think I can do it

@ilyavolodin
Copy link
Member

Anyone on the team wants to champion this? It looks like there are more then enough votes to accept this, just need a champion.

@kaicataldo
Copy link
Member

I'll champion this. @phaux Is everything clear? Please let us know if you need any help with anything, either here in this issue or in our Gitter.

@kaicataldo kaicataldo self-assigned this Dec 2, 2016
@vitorbal
Copy link
Member

vitorbal commented Dec 2, 2016

marking this as accepted as we have a champion and enough +1's

@vitorbal vitorbal 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 Dec 2, 2016
@kaicataldo kaicataldo added the help wanted The team would welcome a contribution from the community for this issue label Dec 23, 2016
@jwilsson
Copy link
Contributor

I'd like to take a stab at this if no one else is working on it, @phaux?

@kaicataldo
Copy link
Member

kaicataldo commented Jan 11, 2017

@jwilsson Go for it! It looks like we didn't discuss a configuration schema, but it seems to me like this should have one string option that is either "always" or "never" (similar to template-curly-spacing). Thoughts on what the default should be @eslint/eslint-team?

Aside from needing to figure out the default value, is everything else clear? Please feel free to comment on here or swing by the ESLint Gitter if you need any help!

@not-an-aardvark
Copy link
Member

"always" and "never" sound good to me.

I think the default should be "never", since I've never seen anyone intentionally use a space here.

@vitorbal
Copy link
Member

vitorbal commented Jan 11, 2017 via email

@kaicataldo
Copy link
Member

Agreed 👍

@jwilsson
Copy link
Contributor

Cool, I'll take a look in the coming days.

@phaux
Copy link
Author

phaux commented Jan 12, 2017

I haven't began working on it yet so go ahead @jwilsson .

I agree upon the default, because it makes this new syntax stand out more. Putting a space there makes it look less like an invocation (even tho I think it looks prettier)

@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 feature This change adds a new feature to ESLint help wanted The team would welcome a contribution from the community for this issue rule Relates to ESLint's core rules
Projects
None yet
9 participants