Skip to content

vue/component-definition-name-casing

强制组件定义名称使用特定大小写

  • ⚙️ 此规则包含在 "plugin:vue/strongly-recommended"*.configs["flat/strongly-recommended"]"plugin:vue/vue2-strongly-recommended"*.configs["flat/vue2-strongly-recommended"]"plugin:vue/recommended"*.configs["flat/recommended"]"plugin:vue/vue2-recommended"*.configs["flat/vue2-recommended"] 中。
  • 🔧命令行 上的 --fix 选项可以自动修复此规则报告的一些问题。

    ¥🔧 The --fix option on the command line can automatically fix some of the problems reported by this rule.

为组件定义名称大小写定义样式以实现一致性。

¥Define a style for component definition name casing for consistency purposes.

📖 规则详情

此规则旨在警告除配置的大小写之外的组件定义名称。

¥This rule aims to warn the component definition names other than the configured casing.

🔧选项

¥🔧 Options

默认大小写设置为 PascalCase

¥Default casing is set to PascalCase.

json
{
  "vue/component-definition-name-casing": ["error", "PascalCase" | "kebab-case"]
}
  • "PascalCase"(默认)...强制组件定义名称为帕斯卡大小写。

    ¥"PascalCase" (default) ... enforce component definition names to pascal case.

  • "kebab-case" ...强制组件定义名称为短横线大小写。

    ¥"kebab-case" ... enforce component definition names to kebab case.

"PascalCase"(默认)

¥"PascalCase" (default)

Now loading...
Now loading...
Now loading...

"kebab-case"

Now loading...
Now loading...
Now loading...

📚扩展阅读

¥📚 Further Reading

🚀版本

¥🚀 Version

此规则在 eslint-plugin-vue v7.0.0 中引入

¥This rule was introduced in eslint-plugin-vue v7.0.0

🔍代码实现

¥🔍 Implementation

eslint-plugin-vue v10.0 中文网 - 粤ICP备13048890号