{"id":"4260b173f2694872","repo":"babel/babel","slug":"no-babel-config-file-detected-for-config-options","errorCode":null,"errorMessage":"No Babel config file detected for ${config.options.filename}. Either disable config file checking with requireConfigFile: false, or configure Babel so that it can find the config files.","messagePattern":"No Babel config file detected for (.+?)\\. Either disable config file checking with requireConfigFile: false, or configure Babel so that it can find the config files\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"eslint/babel-eslint-parser/src/worker/configuration.ts","lineNumber":69,"sourceCode":"    },\n  };\n}\n\nfunction validateResolvedConfig(\n  config: PartialConfig,\n  options: Options,\n  parseOptions: InputOptions,\n): InputOptions | NormalizedOptions {\n  if (config !== null) {\n    if (options.requireConfigFile !== false) {\n      if (!config.hasFilesystemConfig()) {\n        let error = `No Babel config file detected for ${config.options.filename}. Either disable config file checking with requireConfigFile: false, or configure Babel so that it can find the config files.`;\n\n        if (config.options.filename!.includes(\"node_modules\")) {\n          error += `\\nIf you have a .babelrc.js file or use package.json#babel, keep in mind that it's not used when parsing dependencies. If you want your config to be applied to your whole app, consider using babel.config.js or babel.config.json instead.`;\n        }\n\n        throw new Error(error);\n      }\n    }\n    if (config.options) return config.options;\n  }\n\n  return getDefaultParserOptions(parseOptions);\n}\n\nfunction getDefaultParserOptions(options: InputOptions): InputOptions {\n  return {\n    plugins: [],\n    ...options,\n    babelrc: false,\n    configFile: false,\n    ignore: undefined,\n    only: undefined,\n  };\n}","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/babel/babel/blob/06b6eae39da4ce0689fad64e2c48a6375a464208/eslint/babel-eslint-parser/src/worker/configuration.ts#L51-L87","documentation":"Thrown by @babel/eslint-parser's worker when loadPartialConfigAsync returns a non-null config whose hasFilesystemConfig() is false and the user has not set requireConfigFile:false. The parser needs a Babel config to apply transforms for linting; without one it refuses to proceed rather than silently linting unconfigured code. An extra hint is appended when the filename is inside node_modules, because relative configs (.babelrc / package.json#babel) do not apply there.","triggerScenarios":"validateResolvedConfig at configuration.ts:55 runs after loadPartialConfigAsync. It throws at line 69 when options.requireConfigFile !== false AND config.hasFilesystemConfig() === false. Reached via the WorkerClient path when babelOptions.babelrc and configFile are not both false (parse.ts:41).","commonSituations":"New project using @babel/eslint-parser with no babel.config.js / .babelrc; linting a file outside the configured rootMode; config file is misnamed; linting node_modules dependencies that have no Babel config.","solutions":["Set requireConfigFile:false in the parserOptions.babelOptions of your ESLint config (the intended escape hatch for JS that needs no Babel transforms).","Add a babel.config.js (project-wide) or .babelrc (relative) so Babel can resolve configuration for the linted files.","If linting files outside the project root, set rootMode:'upward' so Babel searches upward for the config."],"exampleFix":"// before (eslintrc)\nparserOptions: {\n  sourceType: \"module\",\n  babelOptions: {}\n}\n\n// after\nparserOptions: {\n  sourceType: \"module\",\n  requireConfigFile: false,\n  babelOptions: { babelrc: false, configFile: false }\n}","handlingStrategy":"validation","validationCode":"// Validate eslint parserOptions before linting\nconst parserOptions = {\n  requireConfigFile: false,\n  babelOptions: { babelrc: false, configFile: false },\n};\n// or ensure a babel config file exists:\nconst fs = require(\"fs\");\nconst hasConfig = [\"babel.config.js\", \".babelrc\"].some(f => fs.existsSync(f));\nif (!hasConfig) parserOptions.requireConfigFile = false;","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set requireConfigFile:false when no Babel config is intended.","Add a babel.config.js at the project root for monorepos.","Use rootMode:'upward' when linting outside the project root."],"tags":["config","eslint","setup","babel-eslint-parser"],"analyzedSha":"06b6eae39da4ce0689fad64e2c48a6375a464208","analyzedAt":"2026-08-03T20:13:43.465Z","schemaVersion":2}