【Vue CLI】ESlintのエラー解決集
- Extra semicolon
- Missing space before function parentheses
- Expected space(s) after "for"
- Expected '===' and instead saw '=='
- Trailing spaces not allowed
- Expected space or tab after '//' in comment
- Expected indentation of 6 spaces but found 22
- Elements in iteration expect to have 'v-bind:key' directives
Missing space before function parentheses
意味
functionと()の間にスペースをつけて!
解決方法
修正前
decisionJanken(myHand, youHand)
修正後
decisionJanken (myHand, youHand)
Expected space(s) after "for"
意味
forと()の間にスペースを入れて!
解決方法
修正前
for(let btn of btns)
修正後
for (let btn of btns)
Expected '===' and instead saw '=='
意味
=は3つにして!
解決方法
修正前
if(decision == 1)
修正後
if(decision === 1)
Trailing spaces not allowed
意味
変な改行が入ってるよ!
解決方法
Expected space or tab after '//' in comment
意味
//の後にスペースを入れて!
解決方法
修正前
//10進数で押したボタンのvalue
修正後
// 10進数で押したボタンのvalue
Expected indentation of 6 spaces but found 22
意味
スペース6つがふさわしいのに22個も入ってるよ!
解決方法
修正前
//10進数で押したボタンのvalueを
修正後
//10進数で押したボタンのvalueを
Elements in iteration expect to have 'v-bind:key' directives
意味
v-forでリストレンダリングするならv-bind:'key'で一意的な値を割り振って!
解決方法
修正前
<li v-for='(score, i) of $parent.$data.scores'>
修正後
<li v-for='(score, i) of $parent.$data.scores' :key='i'>