여씨의 개발이야기

[Vue] Component name "Discount" should always be multi-word vue/multi-word-component-names 본문

🐞 Debug

[Vue] Component name "Discount" should always be multi-word vue/multi-word-component-names

yeossi 2024. 1. 25. 10:57

코딩중 eslint 에러가 출력되었다.

error  Component name "Discount" should always be multi-word  vue/multi-word-component-names

해당 에러는 어느 순간부터 뷰 업데이트가 된 이후 컴포넌트 이름이 2단어 이상으로 작명해야해서 발생하는 에러라고 한다.  

DiscountBanner.vue 이런 식으로 2단어 이상으로 작명하면 된다고 한다.  

이게 싫다면 package.json 파일 열어서 "rules" 라는 항목에

"rules": {
   "vue/multi-word-component-names": "off"
}

또는 vue.config.js 파일 열어서 "module.exports = defineConfig" 항목에

module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave: false,
});

lintOnSave: false,를 추가하면 된다.

재기동 필수!

Comments