-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
indentation is wrong in template literal expression #1176
Comments
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:
|
Bug still exists with standard v12 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This appears to be a bug in ESLint. Has anyone filed an issue on ESLint for this yet? |
I think eslint/eslint#10932 describes the same bug. |
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. |
…k around for ESLint bug) Fixes: #1176
…k around for ESLint bug) Fixes: standard/standard#1176
…k around for ESLint bug) Fixes: standard/standard#1176
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.
The text was updated successfully, but these errors were encountered: