Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upTagged template string considered an expression, not a function call #822
Comments
yoshuawuyts
added
the
bug
label
Mar 16, 2017
This comment has been minimized.
This comment has been minimized.
|
Thanks for the issue, @yoshuawuyts. This sounds like a bug in ESLint's |
This comment has been minimized.
This comment has been minimized.
|
Thank you :D
…On Fri, Mar 17, 2017, 01:28 Feross Aboukhadijeh ***@***.***> wrote:
Thanks for the issue, @yoshuawuyts <https://github.com/yoshuawuyts>. This
sounds like a bug in ESLint's no-unused-expressions
<http://eslint.org/docs/rules/no-unused-expressions> rule. I'll open an
issue with them.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#822 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACWleuW4Kz7xzeDtLmEPlVyQ_a9AFqneks5rmdOcgaJpZM4Mf-lN>
.
|
This comment has been minimized.
This comment has been minimized.
|
Issue filed here: eslint/eslint#8268 |
feross
added
the
blocked
label
Mar 17, 2017
This comment has been minimized.
This comment has been minimized.
|
They actually already have a PR out that adds an option to ignore tagged template literals: eslint/eslint#8253 When that makes it into a release, I'll add the option and publish a new version on the v9 and v10 lines. |
This comment has been minimized.
This comment has been minimized.
vitorbal
commented
Mar 17, 2017
|
@feross FYI, today's release will most likely contain this fix! |
This comment has been minimized.
This comment has been minimized.
|
@vitorbal Excellent! Just saw that. I'll do a |
feross
added a commit
to standard/eslint-config-standard
that referenced
this issue
Mar 18, 2017
feross
closed this
in
standard/eslint-config-standard@0855c53
Mar 18, 2017
This comment has been minimized.
This comment has been minimized.
|
Fix published as 9.0.2. (Also, for users of the v10 beta, published as 10.0.0-beta.2.) |
yoshuawuyts commentedMar 16, 2017
Intro
Template strings are a way to interpolate variables with strings. It's nice, and often more readable than traditional string concatenation
Tagged template strings take this behavior a bit further, and allow functions to be called as if they were strings - but instead the functions receive multiple strings, and a trailing array of positional arguments that the have been used for interpolation. This allows operating on the string and adding all sorts of interesting behavior.
Example
Bug
It appears that
standard@9has introduced a regression where tagged template strings are now considered static expressions - even though they're functions. I think we should probably look into this.Thanks!