Vue ESLint Component name should always be multi-word

意思是建議組件名由多個單詞組成,使用 About 之類的單個單詞命名組件可能會報這個提示。

Option 1: 全局關閉

// <projectRoot>/.eslintrc.js
module.exports = {
  ⋮
  rules: {
    'vue/multi-word-component-names': 0,
  },
}

Option 2: 覆蓋指定目錄的 ESLint 配置

// <projectRoot>/.eslintrc.js
module.exports = {
  ⋮
  overrides: [
    {
      files: ['src/views/**/*.vue'],
      rules: {
        'vue/multi-word-component-names': 0,
      },
    },
  ],
}

Option 3: 在指定目錄創建 ESLint 配置

// <projectRoot>/src/views/.eslintrc.js
module.exports = {
  rules: {
    'vue/multi-word-component-names': 0,
  },
}

vue.js - ESLint Vue multiword components - Stack Overflow

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章