スポンサーリンク
最近時間がとてもあるので勉強しようと思いnode.jsに取り組んでます。
まず開発環境を構築するのですが、そこでjavascriptの静的解析ツールである eslint
を使えるようにしたいのでその手順を書いていきます。
javascriptの静的解析ツールです。括弧の閉じ忘れやセミコロンのつけ忘れなど明らかに文法的に間違った内容などを見つけてくれます。
PC : macbook air
OS : macOS catalina 10.15.4
開発環境 : visual studio code (vscode)
まずvscodeにeslintをインストールします。
画面左下の 拡張機能
をクリックし、検索窓に eslint
と入力します。
(おそらく)一番最初に表示されるESLintというパッケージをインストールします。(オレンジのロゴのやつです)
次に開発するコードで使うためのモジュールをインストールします。こちらはnpmを使ってインストールします。
$ npm install eslint --save-dev
以下のような感じで結果が表示されればOKです。
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN blog@1.0.0 No description
+ eslint@7.0.0
added 136 packages from 82 contributors and audited 136 packages in 13.76s
found 0 vulnerabilities
eslintを使うには設定が必要なので、以下のコマンドで設定ウィザードを起動します。
$ ./node_modules/.bin/eslint --init
設定は各自の環境によって変わると思いますので、お好みでどうぞ。
スポンサーリンク
2021/03/21 09:19:08
http://ponlinecialisk.com/ - buy cialis online
2021/04/08 01:46:30
Get composition assistance for those who require engaging, more 100% accurate, and persuasive texts. Impress admissions committees with formatting, editing, and caliber writing. Thinking about just how exactly to compose a ? Practice writing ideas that are useful and easy to earn a potent impression! https://www.thelittleaussiebakery.com/basic-advice-for-military-essay-writing/