在 package.json 中使用 eslintIgnore

如果未找到 .eslintignore 文件且未指定备用文件,ESLint 将在 package.json 中查找 eslintIgnore 键以检查要忽略的文件。

If an .eslintignore file is not found and an alternate file is not specified, ESLint will look in package.json for an eslintIgnore key to check for files to ignore.

{
    "name": "mypackage",
    "version": "0.0.1",
    "eslintConfig": {
        "env": {
            "browser": true,
            "node": true
        }
    },
    "eslintIgnore": ["hello.js", "world.js"]
}