技術と本について書くブログ

技術と本について書くblog。技術メモなど雑記を書いているblog。

ESLintのエラーまとめ

Expected indentation of 2 spaces but found 4

Visual Studio CodeならShift+Option+fで整形(space数は下のバーから変更)

✘ 18 problems (15 errors, 3 warnings)

Expected method shorthand

functionを書いてはいけない before mounted: function() { after mounted() {

semi

Missing semicolon セミコロンがない

More than 1 blank line not allowed

余計な空行を入れない

Unexpected negated condition

elseがあるif文は否定から入らないようにする before if (!hoge) { after if (hoge) {

no-unused-expressions

Expected an assignment or function call and instead saw an expression

文の位置の表現の使用を許可しません

no-else-return

Unnecessary 'else' after 'return' elseがあるif文でreturnがある場合、elseいらない

class-methods-use-this

Expected 'this' to be used by class method 'getCountryPopulationData'

no-mixed-operators

+や/を一緒に使ってはいけない

operator-linebreak ':' should be placed at the end of the line

eslintを一部で無視する

/* eslint-disable class-methods-use-this, no-undefined */
getData() {
/* eslint-enable class-methods-use-this, no-undefined */