multi-word-component-namesのエラー


こちらを参考にやっていた。


出たエラーはこれ


 ERROR  Failed to compile with 1 error                                                                                                                                                22:57:41

[eslint]
C:\Users\user\Desktop\my-cli\src\components\Footer.vue
  1:1  error  Component name "Footer" should always be multi-word  vue/multi-word-component-names

C:\Users\user\Desktop\my-cli\src\components\Header.vue
  1:1  error  Component name "Header" should always be multi-word  vue/multi-word-component-names

✖ 2 problems (2 errors, 0 warnings)


You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.

コンポーネントの名前は複数単語でないとだめだよ、というもの。
これに対して、Footer→MainFooter、Header→MainHeaderと変更してコンパイルしてもエラーが消えず、悩んだ…。
components/の配下で、ファイル名をMainFooter.vue、MainHeader.vueに変更しているのに、エラー内容ではFooter.vueとHeader.vueのファイルを参照していた。。。

理由は分からないが、サーバーを立ち上げ直したら解決した。(ctrl+C→npm run serve)

もしかして、ファイル増やすと毎回サーバー立ち上げ直さないといけないのかな?😄
ようわからん。謎が多いどすなあ!

この記事が気に入ったらサポートをしてみませんか?