How to ignore all files using eslint config file? - Stack Overflow

admin2025-04-18  4

I am trying to skip eslint checks in my project pipeline by specifying a config file that skips all files and doesn't actually lint the files so no errors are thrown. It is a react project and should account for js, jsx, ts, tsx

Below is the example from the docs I used:

// eslint.config.mjs
export default [
  {
    ignores: ["**/*"],
  },
];

This is my output

user@:~/xxx/xxx/simple-react-web (test_skip_node_linter)
$ npx eslint "/home/user/xxx/xxx/simple-react-web/" --config ./eslint.config.mjs

Oops! Something went wrong! :(

ESLint: 9.18.0

You are linting "/home/user/xxx/xxx/simple-react-web/", but all of the files matching the glob pattern "/home/user/xxx/xxx/simple-react-web/" are ignored.

If you don't want to lint these files, remove the pattern "/home/user/xxx/xxx/simple-react-web/" from the list of arguments passed to ESLint.

If you do want to lint these files, explicitly list one or more of the files from this glob that you'd like to lint to see more details about why they are ignored.

  * If the file is ignored because of a matching ignore pattern, check global ignores in your config file.
    

  * If the file is ignored because no matching configuration was supplied, check file patterns in your config file.
    

  * If the file is ignored because it is located outside of the base path, change the location of your config file to be in a parent directory.

I am trying to skip eslint checks in my project pipeline by specifying a config file that skips all files and doesn't actually lint the files so no errors are thrown. It is a react project and should account for js, jsx, ts, tsx

Below is the example from the docs I used:

// eslint.config.mjs
export default [
  {
    ignores: ["**/*"],
  },
];

This is my output

user@:~/xxx/xxx/simple-react-web (test_skip_node_linter)
$ npx eslint "/home/user/xxx/xxx/simple-react-web/" --config ./eslint.config.mjs

Oops! Something went wrong! :(

ESLint: 9.18.0

You are linting "/home/user/xxx/xxx/simple-react-web/", but all of the files matching the glob pattern "/home/user/xxx/xxx/simple-react-web/" are ignored.

If you don't want to lint these files, remove the pattern "/home/user/xxx/xxx/simple-react-web/" from the list of arguments passed to ESLint.

If you do want to lint these files, explicitly list one or more of the files from this glob that you'd like to lint to see more details about why they are ignored.

  * If the file is ignored because of a matching ignore pattern, check global ignores in your config file.
    https://eslint.org/docs/latest/use/configure/ignore

  * If the file is ignored because no matching configuration was supplied, check file patterns in your config file.
    https://eslint.org/docs/latest/use/configure/configuration-files#specifying-files-with-arbitrary-extensions

  * If the file is ignored because it is located outside of the base path, change the location of your config file to be in a parent directory.

Share Improve this question asked Jan 29 at 11:56 TS01TS01 73 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 0

Pardon any unintended negative connotations, but you're holding it wrong.

转载请注明原文地址:http://www.anycun.com/QandA/1744968059a90168.html