Skip to content

feat: add alignValues option - #102

Merged
JoshuaKGoldberg merged 4 commits into
dmnd:mainfrom
PaperStrike:feat/opt-align-values
Sep 3, 2025
Merged

JoshuaKGoldberg merged 4 commits into
dmnd:mainfrom
PaperStrike:feat/opt-align-values

Conversation

@PaperStrike

Copy link
Copy Markdown
Contributor

PR Checklist

Overview

This PR implements the alignValues option for dedent() to handle interpolated values with proper indentation alignment. When enabled via dedent({ alignValues: true }), the function will align each interpolated value's indentation to match its starting line's indentation within the template literal.

And added a basic test for nested interpolated string.

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic all looks great, thanks for the quick PR! 🔥

I'd like to only block on one point: adding docs to the README.md. The other two I don't think should block merging the PR at all.

Comment thread src/types.ts Resolved
Comment thread src/dedent.ts Resolved
Comment thread src/dedent.ts Resolved
@JoshuaKGoldberg JoshuaKGoldberg added the status: waiting for author Needs an action taken by the original poster label Aug 21, 2025
@github-actions github-actions Bot removed the status: waiting for author Needs an action taken by the original poster label Aug 28, 2025
@gabriel-moresco

Copy link
Copy Markdown

Any update?

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great, thanks a bunch! ✨

Comment thread src/dedent.ts Resolved
@JoshuaKGoldberg
JoshuaKGoldberg merged commit 304d0fc into dmnd:main Sep 3, 2025
@github-actions

github-actions Bot commented Sep 3, 2025

Copy link
Copy Markdown

🎉 This is included in version v1.7.0 🎉

The release is available on:

Cheers! 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an option to recursively dedent nested template literal strings

3 participants