Skip to content

Conversation

@seiyab
Copy link
Collaborator

@seiyab seiyab commented Mar 25, 2023

Description

Fix #14575

Checklist

  • I’ve added tests to confirm my change works.
  • (If changing the API or CLI) I’ve documented the changes I’ve made (in the docs/ directory).
  • (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

Comment on lines +93 to +95
v-if=" (x as string).length > 0"
v-for="a in [1,2, 3,4,5].map( (x : number) => x * x)"
:foo=" (x as number).toFixed( 2) "
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These aren't formatted in this branch due to #14432 .
Rebasing to next branch, they are formatted.
Feel free to ask me to

  • remove these lines
  • or, change base branch

Copy link
Member

Choose a reason for hiding this comment

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

We can ignore it.

sosukesuzuki

This comment was marked as resolved.

@fisker
Copy link
Member

fisker commented Mar 25, 2023

It's fine to merge into main, #14559 already need update.

if (lang === "ts" || lang === "typescript") {
const shouldMarkTs = vueScriptTags.some((vueScriptTag) =>
["ts", "typescript"].includes(vueScriptTag.attrMap.lang)
);
Copy link
Member

Choose a reason for hiding this comment

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

filter + some can reduce to one .some.

@seiyab seiyab marked this pull request as ready for review March 26, 2023 02:30
@fisker fisker changed the title Fix: Vue not formatting TS expression if script[lang=ts] is second <script>` Format TS expressions even <script lang="ts"> is not the first script tag Mar 27, 2023
@fisker fisker changed the title Format TS expressions even <script lang="ts"> is not the first script tag Format TS expressions when any script tag has lang="ts" Mar 27, 2023
@fisker fisker merged commit 1bf47c1 into prettier:main Mar 27, 2023
@seiyab seiyab deleted the 14575-vue-multiple-script-tag-ts branch March 27, 2023 04:09
medikoo pushed a commit to medikoo/prettier-elastic that referenced this pull request Feb 13, 2024
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.

Vue not formatting TS expression if script[lang=ts] is second <script>

3 participants