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

Do not reformat interpolation attribute values #94

Merged
merged 1 commit into from
May 29, 2020
Merged

Do not reformat interpolation attribute values #94

merged 1 commit into from
May 29, 2020

Conversation

seletskiy
Copy link
Contributor

Object literals are widely used in Vue.

For example, they can be used to assign set of classes conditionally:

span.aui-lozenge(
  :class=`{
    "aui-lozenge-inprogress": pipeline.status == PipelineStatus.Running,
    "aui-lozenge-error":      pipeline.status == PipelineStatus.Failed
  }`
)

This patch does not modify behavior regarding non-multiline strings.

Fixes #80.

@Shinigami92 Shinigami92 self-requested a review May 29, 2020 18:12
@Shinigami92 Shinigami92 added the type: enhancement Functionality that enhances existing features label May 29, 2020
@Shinigami92 Shinigami92 marked this pull request as draft May 29, 2020 18:19
@Shinigami92 Shinigami92 changed the title do not reformat interpolation attribute values Do not reformat interpolation attribute values May 29, 2020
test/issues/issue-80/unformatted.pug Outdated Show resolved Hide resolved
Object literals are widely used in Vue.

For example, they can be used to assign set of classes conditionally:

```pug
span.aui-lozenge(
  :class=`{
    "aui-lozenge-inprogress": pipeline.status == PipelineStatus.Running,
    "aui-lozenge-error":      pipeline.status == PipelineStatus.Failed
  }`
)
```

This patch does not modify behavior regarding non-multiline strings.

Fixes #80.
@Shinigami92 Shinigami92 marked this pull request as ready for review May 29, 2020 19:52
@Shinigami92 Shinigami92 merged commit 342bb69 into prettier:master May 29, 2020
@seletskiy seletskiy deleted the issue-80 branch June 1, 2020 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Functionality that enhances existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: attribute starting with : formatted differently from the same attribute without :
2 participants