Comment
Author: Admin | 2025-04-28
File is found, then the search stops, otherwise it checks for eslint.config.mjs. If that file is found, then the search stops, otherwise it checks for eslint.config.cjs. If none of the files are found, it checks the parent directory for each file. This search continues until either a config file is found or the root directory is reached.You can prevent this search for eslint.config.js by using the -c or --config option on the command line to specify an alternate configuration file, such as: npmnpx eslint --config some-other-file.js **/*.js yarnyarn dlx eslint --config some-other-file.js **/*.js pnpmpnpm dlx eslint --config some-other-file.js **/*.js bunbunx eslint --config some-other-file.js **/*.js In this case, ESLint does not search for eslint.config.js and instead uses some-other-file.js.Experimental Configuration File ResolutionYou can use the unstable_config_lookup_from_file flag to change the way ESLint searches for configuration files. Instead of searching from the current working directory, ESLint will search for a configuration file by first starting in the directory of the file being linted and then searching up its ancestor directories until it finds a eslint.config.js file (or any other extension of configuration file). This behavior is better for monorepos, where each subdirectory may have its own configuration file.To use this feature on the command line, use the --flag flag:npx eslint --flag unstable_config_lookup_from_file .For more information about using feature flags, see Feature Flags.TypeScript Configuration FilesFor Deno and Bun, TypeScript configuration files are natively supported; for Node.js, you must install the optional dev dependency jiti in version 2.0.0 or later in your project (this dependency
Add Comment