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 upindentation is wrong in template literal expression #1176
Comments
This comment has been minimized.
This comment has been minimized.
chrisdickinson
commented
Aug 26, 2018
|
I noticed this as well. Example code that works as expected: function example () {
const router = reverse`
GET /example greet
`({
greet () {
}
})
}But once I add a parameter to the template string, like so: function example () {
const router = reverse`
GET /example/${id} greet
`({
greet () {
}
})
}
function example () {
const router = reverse`
GET /example/${id} greet
`({
greet () {
}
})
}which seems wrong. (This might be a bug in eslint!) An example of the error reported follows:
|
This comment has been minimized.
This comment has been minimized.
|
Bug still exists with standard v12 |
This comment has been minimized.
This comment has been minimized.
stale
bot
commented
Nov 27, 2018
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
stale
bot
added
the
stale
label
Nov 27, 2018
stale
bot
closed this
Dec 4, 2018
lock
bot
locked as resolved and limited conversation to collaborators
Mar 4, 2019
standard
unlocked this conversation
Aug 12, 2019
feross
reopened this
Aug 12, 2019
stale
bot
removed
the
stale
label
Aug 12, 2019
feross
added
blocked
bug
labels
Aug 12, 2019
This comment has been minimized.
This comment has been minimized.
|
This appears to be a bug in ESLint. Has anyone filed an issue on ESLint for this yet? |
This comment has been minimized.
This comment has been minimized.
|
I think eslint/eslint#10932 describes the same bug. |
This comment has been minimized.
This comment has been minimized.
|
Okay, until ESLint fixes this, let's just disable indentation checking on children of template literals. I'm going to add this exception to the This will be released in standard v14. |
CedricRaison commentedAug 10, 2018
What version of standard? 11.0.1
What operating system, Node.js, and npm version? Ubuntu 18.04 node 8.9 npm 5.5.1
What did you expect to happen?
Template literal expressions does not indent correctly.
example with styleguide.js from choo website.
If you run
standard --fix styleguide.js, template literal expression indentation is totally wrong at line 16 and in every template literal expression.I past the code to the try it out section of the standard website and it work well, so I assume the website use an old version of the standard library that don't contain the bug.