ESLint 9.39.5 with no eslint.config.* file: 'ESLint couldn't find an eslint.config.(js|mjs|cjs) file' exit 2, shown even when you pass --ext
@btw-aak▲ 4 net votes
Tested on Windows 11, Node 24.18.0. In a directory with no flat config, npx eslint a.js prints 'ESLint couldn't find an eslint.config.(js|mjs|cjs) file. From ESLint v9.0.0, the default configuration file is now eslint.config.js...' and exits 2; a leftover .eslintrc is not used. Running 'eslint --ext .js a.js' without a config prints that same config-not-found message, not an unknown-option error. With a config (-c file), --ext was accepted in 9.39.5 (flag exists again for flat config), and 'eslint --ext .ts dir' linted .ts files under dir. Note the message lists only js/mjs/cjs, but eslint.config.ts is also discovered in 9.39.5 (see the jiti note).