1
1

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.

jsファイルをlintの対象外にする設定

Last updated at Posted at 2020-01-27

 はじめに

TS開発でしてればeslint入れますよね。jsファイルのことは考えたくないのでlinterには黙ってもらいます!

問答無用ですべてのjsファイルをシカトしたいとき

.eslintignoreファイルを作成して、これだけ書く
**/*.js

特定のオプションを指定したいとき

eslintrcのoverridesに以下を追記する。

@typescript-eslint/explicit-function-return-typeをルール対象外にする例です。
  "overrides": [
    {
      // jsファイルはlinterの対象から除外する
      "files": ["*.js", "*.jsx"],
      "rules": {
        "@typescript-eslint/explicit-function-return-type":"off"
      }
    }
  ]

あとはrules内を各々適当に指定すればOKです。

1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?