Node.jsはすでにインストール済み。
Visual Studio Codeから[ターミナル]を起動
eslint用フォルダ(D:\eslint)を作成
D:\>
D:\>md d:\eslint
D:\>cd /d d:\eslint
package.json作成
d:\eslint>npm -y init
Wrote to d:\eslint\package.json:
{
"name": "eslint",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
VSCodeの [ファイル]メニュー - [フォルダを開く] で "D:\eslint" を開く
eslintフォルダ内のpackage.jsonを開く編集
{
"name": "javascript-standard-style-example"
}
パッケージのインストール
D:\eslint>npm i -D eslint
npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN javascript-standard-style-example@ No description
npm WARN javascript-standard-style-example@ No repository field.
npm WARN javascript-standard-style-example@ No license field.
+ eslint@5.9.0
added 117 packages from 71 contributors and audited 187 packages in 17.064s
found 0 vulnerabilities
ESLintでJavaScript Standard Styleを使用するためのパッケージ群をインストール
D:\eslint>npm i -D eslint-config-standard eslint-plugin-standard eslint-plugin-promise eslint-plugin-import eslint-plugin-node
npm WARN javascript-standard-style-example@ No description
npm WARN javascript-standard-style-example@ No repository field.
npm WARN javascript-standard-style-example@ No license field.
+ eslint-config-standard@12.0.0
+ eslint-plugin-node@8.0.0
+ eslint-plugin-import@2.14.0
+ eslint-plugin-standard@4.0.0
+ eslint-plugin-promise@4.0.1
added 51 packages from 36 contributors and audited 265 packages in 6.248s
found 0 vulnerabilities
eslintフォルダに.eslintrc.jsonファイルを新規作成し以下内容を保存
{
"extends": "standard"
}
0 件のコメント:
コメントを投稿