Appearance
vue/no-irregular-whitespace
禁止在
.vue中出现不规则空格文件¥disallow irregular whitespace in
.vuefiles
📖 规则详情
vue/no-irregular-whitespace 规则旨在捕获无效的空白,这些空白不是正常的制表符和空格。其中一些字符可能会在现代浏览器中引起问题,而其他字符则是需要调试的问题。vue/no-irregular-whitespace 规则与核心 no-irregular-whitespace 规则类似,但它适用于 .vue 中的源代码。
¥vue/no-irregular-whitespace rule is aimed at catching invalid whitespace that is not a normal tab and space. Some of these characters may cause issues in modern browsers and others will be a debugging issue to spot. vue/no-irregular-whitespace rule is the similar rule as core no-irregular-whitespace rule but it applies to the source code in .vue.
🔧选项
¥🔧 Options
js
{
"vue/no-irregular-whitespace": ["error", {
"skipStrings": true,
"skipComments": false,
"skipRegExps": false,
"skipTemplates": false,
"skipHTMLAttributeValues": false,
"skipHTMLTextContents": false
}]
}skipStrings:如果true,则允许字符串字面量中出现任何空格字符。默认true¥
skipStrings: iftrue, allows any whitespace characters in string literals. defaulttrueskipComments:如果true,则允许注释中出现任何空格字符。默认false¥
skipComments: iftrue, allows any whitespace characters in comments. defaultfalseskipRegExps:如果true,则允许正则表达式字面量中出现任何空格字符。默认false¥
skipRegExps: iftrue, allows any whitespace characters in regular expression literals. defaultfalseskipTemplates:如果true,则允许模板字面量中出现任何空格字符。默认false¥
skipTemplates: iftrue, allows any whitespace characters in template literals. defaultfalseskipHTMLAttributeValues:如果true,则允许 HTML 属性值中出现任何空格字符。默认false¥
skipHTMLAttributeValues: iftrue, allows any whitespace characters in HTML attribute values. defaultfalseskipHTMLTextContents:如果true,则允许 HTML 文本内容中出现任何空格字符。默认false¥
skipHTMLTextContents: iftrue, allows any whitespace characters in HTML text contents. defaultfalse
"skipStrings": true(默认)
¥"skipStrings": true (default)
"skipStrings": false
"skipComments": true
"skipRegExps": true
"skipTemplates": true
"skipHTMLAttributeValues": true
"skipHTMLTextContents": true
📚扩展阅读
¥📚 Further Reading
🚀版本
¥🚀 Version
此规则在 eslint-plugin-vue v6.1.0 中引入
¥This rule was introduced in eslint-plugin-vue v6.1.0
🔍代码实现
¥🔍 Implementation
使用 ❤️ 来自 ESLint 核心
¥Taken with ❤️ from ESLint core