npmeslint95% confidence\u2191 90

how to silence warnings about ignored files in eslint

Full error message
After setting up eslint and adding some files in the ignore list, every time that eslint is run it produces warnings about files that are ignored:

 /path/to/file/name.min.js
  0:0  warning  File ignored because of a matching ignore pattern. Use "--no-ignore" to override

How can this warning be silenced?

Check if you're running eslint with an unquoted glob argument. If so, put the glob in quotes. eslint src/** ❌ Bad (no quotes = OS will expand into many args) eslint "src/**" ✔️ Good (quotes = a single string argument) Why? If you call eslint using a cli glob pattern not in quotes, e.g. eslint src/**, that glob gets expanded into all matching files and passed to eslint as a gigantic list of cli arguments. e.g. eslint path/to/file/name.min.js src/foo.js src/bar.js src/manymore.js ..... So when eslint ignores a file due to your ignore pattern, yet that file was explicitly passed as a command line argument, eslint is warning us eslint speaking: "Um, I ignored /path/to/file/name.min.js because of an ignore pattern, but you explicitly passed it to me to lint, so this must not be what you wanted, right?" But when you pass the glob in quotes, e.g. eslint "src/**", the glob is not expanded to many arguments; rather, it's just a single string argument, and eslint is the one who knows it's a glob but since it takes care of figuring out which files to match it can do so while respecting eslintignore. So there's nothing weird going on that eslint thinks it should warn you about.

API access

Get this solution programmatically \u2014 free, no authentication.

curl https://depscope.dev/api/error/f6f70ac010a4f5f77d4812aedc10b505bf119d01e8668b2020162fae0a7f7acf
hash \u00b7 f6f70ac010a4f5f77d4812aedc10b505bf119d01e8668b2020162fae0a7f7acf
how to silence warnings about ignored files in eslint — DepScope fix | DepScope