Repository: prettier/prettier (JavaScript)

Issue:
Avoid tags for the singleAttributePerLine rule
Is it possible to specify a list of tags to avoid for this rule? I'm working with Vue 3 and I would LOVE to keep both of this tags in one line:

```
<script
  setup
  lang="ts"
>
  ...
</script>
```

```
<style
  scoped
  lang="scss"
>
  ...
</style>
```




Hints:
Can we disable it for `script` and `style`?
me too,how resolve it
> We can disable this just like we did with indentation (`vueIndentScriptAndStyle`).

answer error
me too,how resolve it

> me too,how resolve it

i dont know. I've given up using prettier

Patch:
diff --git a/src/language-html/print/tag.js b/src/language-html/print/tag.js
--- a/src/language-html/print/tag.js
+++ b/src/language-html/print/tag.js
@@ -17,6 +17,7 @@ const {
   isPreLikeNode,
   hasPrettierIgnore,
   shouldPreserveContent,
+  isVueSfcBlock,
 } = require("../utils/index.js");
 
 function printClosingTag(node, options) {
@@ -251,8 +252,11 @@ function printAttributes(path, options, print) {
     node.attrs[0].fullName === "src" &&
     node.children.length === 0;
 
-  const attributeLine =
-    options.singleAttributePerLine && node.attrs.length > 1 ? hardline : line;
+  const shouldPrintAttributePerLine =
+    options.singleAttributePerLine &&
+    node.attrs.length > 1 &&
+    !isVueSfcBlock(node, options);
+  const attributeLine = shouldPrintAttributePerLine ? hardline : line;
 
   /** @type {Doc[]} */
   const parts = [
diff --git a/src/language-html/utils/index.js b/src/language-html/utils/index.js
--- a/src/language-html/utils/index.js
+++ b/src/language-html/utils/index.js
@@ -674,6 +674,7 @@ module.exports = {
   isVueScriptTag,
   isVueSlotAttribute,
   isVueSfcBindingsAttribute,
+  isVueSfcBlock,
   isDanglingSpaceSensitiveNode,
   isIndentationSensitiveNode,
   isLeadingSpaceSensitiveNode,


Test patch:
diff --git a/tests/format/vue/single-attribute-per-line/__snapshots__/jsfmt.spec.js.snap b/tests/format/vue/single-attribute-per-line/__snapshots__/jsfmt.spec.js.snap
--- a/tests/format/vue/single-attribute-per-line/__snapshots__/jsfmt.spec.js.snap
+++ b/tests/format/vue/single-attribute-per-line/__snapshots__/jsfmt.spec.js.snap
@@ -1,5 +1,152 @@
 // Jest Snapshot v1, https://goo.gl/fbAQLP
 
+exports[`sfc-blocks.vue - {"singleAttributePerLine":true} format 1`] = `
+====================================options=====================================
+parsers: ["vue"]
+printWidth: 80
+singleAttributePerLine: true
+                                                                                | printWidth
+=====================================input======================================
+<script setup lang="ts">
+console.log("hello")
+</script>
+
+<style scoped lang="scss">
+p {
+  color: red;
+}
+</style>
+
+<unknown-block foo bar="bar" baz long_long_long_long_attribute></unknown-block>
+
+<script lang="ts" src="./long_long_long_long_long_long_file_path.ts">
+</script>
+
+<script lang="ts" src="./long_long_long_long_long_long_long_file_path.ts">
+</script>
+
+<script lang="ts" src="./short">
+</script>
+
+<template lang="pug" src="./long_long_long_long_long_long_file_path.pug">
+</template>
+
+<template lang="pug" src="./long_long_long_long_long_long_long_long_file_path.pug">
+</template>
+
+<template lang="pug" src="./short">
+</template>
+
+=====================================output=====================================
+<script setup lang="ts">
+console.log("hello");
+</script>
+
+<style scoped lang="scss">
+p {
+  color: red;
+}
+</style>
+
+<unknown-block foo bar="bar" baz long_long_long_long_attribute></unknown-block>
+
+<script lang="ts" src="./long_long_long_long_long_long_file_path.ts"></script>
+
+<script
+  lang="ts"
+  src="./long_long_long_long_long_long_long_file_path.ts"
+></script>
+
+<script lang="ts" src="./short"></script>
+
+<template lang="pug" src="./long_long_long_long_long_long_file_path.pug">
+</template>
+
+<template
+  lang="pug"
+  src="./long_long_long_long_long_long_long_long_file_path.pug"
+>
+</template>
+
+<template lang="pug" src="./short">
+</template>
+
+================================================================================
+`;
+
+exports[`sfc-blocks.vue format 1`] = `
+====================================options=====================================
+parsers: ["vue"]
+printWidth: 80
+                                                                                | printWidth
+=====================================input======================================
+<script setup lang="ts">
+console.log("hello")
+</script>
+
+<style scoped lang="scss">
+p {
+  color: red;
+}
+</style>
+
+<unknown-block foo bar="bar" baz long_long_long_long_attribute></unknown-block>
+
+<script lang="ts" src="./long_long_long_long_long_long_file_path.ts">
+</script>
+
+<script lang="ts" src="./long_long_long_long_long_long_long_file_path.ts">
+</script>
+
+<script lang="ts" src="./short">
+</script>
+
+<template lang="pug" src="./long_long_long_long_long_long_file_path.pug">
+</template>
+
+<template lang="pug" src="./long_long_long_long_long_long_long_long_file_path.pug">
+</template>
+
+<template lang="pug" src="./short">
+</template>
+
+=====================================output=====================================
+<script setup lang="ts">
+console.log("hello");
+</script>
+
+<style scoped lang="scss">
+p {
+  color: red;
+}
+</style>
+
+<unknown-block foo bar="bar" baz long_long_long_long_attribute></unknown-block>
+
+<script lang="ts" src="./long_long_long_long_long_long_file_path.ts"></script>
+
+<script
+  lang="ts"
+  src="./long_long_long_long_long_long_long_file_path.ts"
+></script>
+
+<script lang="ts" src="./short"></script>
+
+<template lang="pug" src="./long_long_long_long_long_long_file_path.pug">
+</template>
+
+<template
+  lang="pug"
+  src="./long_long_long_long_long_long_long_long_file_path.pug"
+>
+</template>
+
+<template lang="pug" src="./short">
+</template>
+
+================================================================================
+`;
+
 exports[`single-attribute-per-line.vue - {"singleAttributePerLine":true} format 1`] = `
 ====================================options=====================================
 parsers: ["vue"]
diff --git a/tests/format/vue/single-attribute-per-line/sfc-blocks.vue b/tests/format/vue/single-attribute-per-line/sfc-blocks.vue
new file mode 100644
--- /dev/null
+++ b/tests/format/vue/single-attribute-per-line/sfc-blocks.vue
@@ -0,0 +1,29 @@
+<script setup lang="ts">
+console.log("hello")
+</script>
+
+<style scoped lang="scss">
+p {
+  color: red;
+}
+</style>
+
+<unknown-block foo bar="bar" baz long_long_long_long_attribute></unknown-block>
+
+<script lang="ts" src="./long_long_long_long_long_long_file_path.ts">
+</script>
+
+<script lang="ts" src="./long_long_long_long_long_long_long_file_path.ts">
+</script>
+
+<script lang="ts" src="./short">
+</script>
+
+<template lang="pug" src="./long_long_long_long_long_long_file_path.pug">
+</template>
+
+<template lang="pug" src="./long_long_long_long_long_long_long_long_file_path.pug">
+</template>
+
+<template lang="pug" src="./short">
+</template>