26
Visual Studioコードを使用してbabel/ES7 stage-0ルールに基づいてJavaScriptファイルをリントする方法はありますか?VSCode Linter ES6 ES7 Babel linter
私はコードをlintする必要があります。私はすでにwebpackをJsファイルに変換しています。私は進む方法
Visual Studioコードを使用してbabel/ES7 stage-0ルールに基づいてJavaScriptファイルをリントする方法はありますか?VSCode Linter ES6 ES7 Babel linter
私はコードをlintする必要があります。私はすでにwebpackをJsファイルに変換しています。私は進む方法
:npm install -g eslint
npm install --save-dev babel-eslint
npm install --save-dev eslint-plugin-react
{
"env": {
"browser": true,
"node": true,
"es6": true,
"jest": true,
"jquery": true
},
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"arrowFunctions": true,
"binaryLiterals": true,
"blockBindings": true,
"classes": true,
"defaultParams": true,
"destructuring": true,
"forOf": true,
"generators": true,
"modules": true,
"objectLiteralComputedProperties": true,
"objectLiteralDuplicateProperties": true,
"objectLiteralShorthandMethods": true,
"objectLiteralShorthandProperties": true,
"octalLiterals": true,
"regexUFlag": true,
"regexYFlag": true,
"spread": true,
"superInFunctions": true,
"templateStrings": true,
"unicodeCodePointEscapes": true,
"globalReturn": true,
"jsx": true,
"experimentalObjectRestSpread": true
}
},
"plugins": [
"react"
],
"rules": {
"strict": 0
}
}
{
//disable default javascript validator replaced by eslint
"javascript.validate.enable" : false
}
を今:あなたはユーザパラメータ(settings.json)を開き、書き込み、VSCコードでVSC
PS:私の.eslintrcはので、それを削除すること自由に感じ毛羽立ちES7のためのいくつかの役に立たない余分なデータを使用していますことがあります)
どこに.eslintrcファイルを置くべきですか?私のホームディレクトリに?または "ルート"ディレクトリ –
プロジェクトのルートディレクトリには、 'openFolder'を使用するときにVSCodeで選択したディレクトリがあります。 –
ありがとうございます。これはまだそれについて行くための最善の方法ですか? githubのVSCodeスレッドが閉じられていない –