Skip to content

यह पेज एक अनुवाद है। यदि यह अंग्रेज़ी पेज से अलग है, तो अंग्रेज़ी पेज ही सही है। English

vue-pug/attribute-parens-spacing ​

Pug attribute blocks की parentheses के अंदर एकरूप spacing लागू करें।

✅ configs.recommended में चालू (warn पर)। 🔧 --fix से ठीक होने योग्य।

vue/html-closing-bracket-spacing की जगह लेता है, जो Pug templates पर crash करता है और configs.base से बंद है।

Rule का विवरण ​

Rule उसी line पर ( के ठीक बाद और ) के ठीक पहले का whitespace जाँचता है:

  • never (default): वहाँ कोई whitespace नहीं। Fix उसे हटा देता है।
  • always: वहाँ कम से कम एक space। Fix एक जोड़ देता है।

जिस तरफ के whitespace में line break हो वह vue-pug/attribute-parens-newline के अधीन है और छोड़ दिया जाता है, और खाली या केवल whitespace वाला block भी।

गलत ​

vue
<template lang="pug">
a( href="/" ) Home
</template>
vue
<template lang="pug">
input( type="text" name="q")
</template>

सही ​

vue
<template lang="pug">
a(href="/") Home
</template>
vue
<template lang="pug">
input(
  type="text"
  name="q"
)
</template>

Options ​

js
'vue-pug/attribute-parens-spacing': ['warn', 'never']

'never' (default) या 'always'।

["always"] के साथ गलत ​

vue
<template lang="pug">
a(href="/") Home
</template>

["always"] के साथ सही ​

vue
<template lang="pug">
a( href="/" ) Home
</template>

MIT License के अंतर्गत जारी।