Skip to content

Comments

feat: add support for arrayExpression.maxWidth configuration#739

Open
xseman wants to merge 1 commit intodprint:mainfrom
xseman:array-expression-max-width
Open

feat: add support for arrayExpression.maxWidth configuration#739
xseman wants to merge 1 commit intodprint:mainfrom
xseman:array-expression-max-width

Conversation

@xseman
Copy link

@xseman xseman commented Sep 25, 2025

Implements #677

@xseman
Copy link
Author

xseman commented Dec 29, 2025

@dsherret I know you may be busy. This PR has been open for a while. Any feedback would help. Thanks

Comment on lines +1627 to +1629
fn generate_element_text<'a>(node: Node<'a>, context: &mut Context<'a>) -> String {
node.text_fast(context.program).to_string()
}
Copy link
Member

Choose a reason for hiding this comment

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

This is not an accurate way to measure the text of a node because the node could have things like spaces or newlines and bad formatting, so the width might be different once printed. Similarly, in this other PR it's not an accurate way to figure out the node width: https://github.com/dprint/dprint-plugin-typescript/pull/737/changes#diff-d83dd6f700946697666bb782a867b64343578bc2067c1904c08060c5f21009d1R258

Both of these are difficult to do properly and I'm not sure I want to maintain them. Sorry!

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the feedback! It would really help me to know if you think these issues (both this one and #737) are actually worth solving within dprint typescript plugin.

If I get clear direction on the approach you'd prefer, I'm happy to implement it, but I don't want to push for features that don't align with your vision for the module. I'd rather spend my time on things you actually find valuable for the project.

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.

2 participants