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

Why ES6's Template literals not support by Standard? #583

Closed
ole3021 opened this issue Aug 10, 2016 · 2 comments

Comments

@ole3021
Copy link

commented Aug 10, 2016

Hi i'm new to standard, and i love its simple and powerful.

But i have a question

i have write code like

const ms = new Date() - start
ctx.set('X-Response-Time', '${ms}ms')

but i got the warning on first line: " 'ms' is defined but never used at xx col xx ";

I wonder why this warning happen? i think it should be now take as a warning ( in Eslint it is not);
and it's there have a way to ignore this kind of warning?

Best wishes.

@LinusU

This comment has been minimized.

Copy link
Member

commented Aug 10, 2016

Your code will set the header to the string "${ms}ms", you need to use backticks (```) in order to use template strings.

e.g.

const ms = new Date() - start
ctx.set('X-Response-Time', `${ms}ms`)

@feross feross closed this Aug 10, 2016

@ole3021

This comment has been minimized.

Copy link
Author

commented Aug 11, 2016

ok,thanks

@dcousens dcousens added the question label Aug 11, 2016

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
4 participants
You can’t perform that action at this time.