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

Fix: wrong indent at tagged template in indent (fixes #12122) #12596

Merged
merged 7 commits into from Jan 17, 2020
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/rules/indent.js
Expand Up @@ -922,7 +922,11 @@ module.exports = {

parameterParens.add(openingParen);
parameterParens.add(closingParen);
offsets.setDesiredOffset(openingParen, sourceCode.getTokenBefore(openingParen), 0);

const offsetAfterToken = node.callee.type === "TaggedTemplateExpression" ? node.callee.quasi : openingParen;
kaicataldo marked this conversation as resolved.
Show resolved Hide resolved
const offsetToken = sourceCode.getTokenBefore(offsetAfterToken);

offsets.setDesiredOffset(openingParen, offsetToken, 0);

addElementListIndent(node.arguments, openingParen, closingParen, options.CallExpression.arguments);
}
Expand Down