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

【ESLint】flat config で対象ファイルを指定する方法

Last updated at Posted at 2024-12-18

--extは使えない

flat configを使用する場合は--extは使えません。

flat configを使用しているのにも関わらず、--extを使用すると以下のようなエラーメッセージが出力されます。

Invalid option '--ext' - perhaps you meant '-c'?
You're using eslint.config.js, some command line flags are no longer available. Please see https://eslint.org/docs/latest/use/command-line-interface for details.

対象ファイルを指定する方法

flat configで対象ファイルを指定するにはeslint.config.js filesを記述します。
--ext .ts,.tsxと指定していた場合には以下のようになります。

eslint.config.js

export default [
    {
        files: ["**/*.ts", "**/*.tsx"],
        
        // ...
    }
]

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