Skip to content

Conversation

@sosukesuzuki
Copy link
Member

Description

Closes #15934

Checklist

  • I’ve added tests to confirm my change works.
  • (If the change is user-facing) I’ve added my changes to changelog_unreleased/*/XXXX.md file following changelog_unreleased/TEMPLATE.md.
  • I’ve read the contributing guidelines.

Try the playground for this PR

@sosukesuzuki sosukesuzuki marked this pull request as ready for review January 21, 2024 04:49
const isStyleProperty = (node, name) =>
isObjectProperty(node) &&
node.key.type === "Identifier" &&
node.key.name === "styles" &&
Copy link
Member

Choose a reason for hiding this comment

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

!node.computed

Copy link
Member Author

Choose a reason for hiding this comment

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

I fixed this and added tests. Also I've create the new similar issue for template as a good first ( #15969 )

name === "value",
...angularComponentObjectExpressionPredicates,
const isTemplateLiteral = (node) => node.type === "TemplateLiteral";
const isStyleProperty = (node, name) =>
Copy link
Member

Choose a reason for hiding this comment

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

How about isObjectPropertyNamedStyles?

Copy link
Member

Choose a reason for hiding this comment

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

Second parameter should be named key

@sosukesuzuki sosukesuzuki merged commit 2fe7f41 into prettier:main Jan 21, 2024
@sosukesuzuki sosukesuzuki deleted the feat-15934 branch January 21, 2024 09:10
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.

Angular inline styles are not formatted if specified as single string (new in v17)

2 participants