--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"],
// ...
}
]