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?

【ESLint】ファイルを無視する方法

Last updated at Posted at 2024-12-17

特定のファイルを無視する方法

eslint.config.jsignoresを記述することで特定のファイルを無視できます。
以下のように記述した場合、semiのルールにおいて**/*.config.jsは無視されます。

eslint.config.js
export default [
    {
        files: ["src/**/*.js"],
        ignores: ["**/*.config.js"],
        rules: {
            semi: "error"
        }
    }
];

以下のように独立したオブジェクトにignoresを記述した場合にはグローバルにファイルを無視します。

eslint.config.js
import js from '@eslint/js';

export default [
    {
        files: [
            '**/*.js'
        ],
        ...js.configs.recommended
    },
    {
        ignores: [
            'ignored.js'
        ]
    }
];

参考

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?