0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

プロジェクトのディレクトリを汚さず、eslintコマンドで構文チェックする

Last updated at Posted at 2020-07-24

1. Node.jsをインストール

  • 省略

2. eslintをインストール、初期化

mkdir <任意のnpm用ディレクトリ>
cd <任意のnpm用ディレクトリ>
npm init
npm install eslint

3. eslintの設定(適当に)

<任意のnpm用ディレクトリ>.eslintrc.json
{
    "env": {
        "browser": true,
        "es2020": true
    },
    "parserOptions": {
        "ecmaVersion": 11
    },
    "rules": {
        "semi": [
            2,
            "always"
        ],
        "comma-dangle": [
            "error",
            "never"
        ]
    }
}

4. チェック実行

cd <任意のnpm用ディレクトリ>
npx eslint -c ./.eslintrc.json <チェック対象ディレクトリ>
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?