{"id":"534a8cfd28df9198","repo":"eslint/eslint","slug":"this-appears-to-be-in-eslintrc-format-rather-than","errorCode":null,"errorMessage":"This appears to be in eslintrc format rather than flat config format.","messagePattern":"This appears to be in eslintrc format rather than flat config format\\.","errorType":"exception","errorClass":"IncompatibleKeyError","httpStatus":null,"severity":"error","filePath":"lib/config/flat-config-schema.js","lineNumber":549,"sourceCode":"\t\t\t\tassertIsRuleSeverity(ruleId, ruleOptions[0]);\n\t\t\t} else {\n\t\t\t\tassertIsRuleSeverity(ruleId, ruleOptions);\n\t\t\t}\n\t\t}\n\t},\n};\n\n/**\n * Creates a schema that always throws an error. Useful for warning\n * about eslintrc-style keys.\n * @param {string} key The eslintrc key to create a schema for.\n * @returns {ObjectPropertySchema} The schema.\n */\nfunction createEslintrcErrorSchema(key) {\n\treturn {\n\t\tmerge: \"replace\",\n\t\tvalidate() {\n\t\t\tthrow new IncompatibleKeyError(key);\n\t\t},\n\t};\n}\n\nconst eslintrcKeys = [\n\t\"env\",\n\t\"extends\",\n\t\"globals\",\n\t\"ignorePatterns\",\n\t\"noInlineConfig\",\n\t\"overrides\",\n\t\"parser\",\n\t\"parserOptions\",\n\t\"reportUnusedDisableDirectives\",\n\t\"root\",\n];\n\n//-----------------------------------------------------------------------------","sourceCodeStart":531,"sourceCodeEnd":567,"githubUrl":"https://github.com/eslint/eslint/blob/f131c034ad91bbf06bcbb6b5e931447a8e419a46/lib/config/flat-config-schema.js#L531-L567","documentation":"Thrown as IncompatibleKeyError by createEslintrcErrorSchema for any eslintrc-only key that appears in a flat config. The blocked keys are listed in eslintrcKeys: env, extends, globals, ignorePatterns, noInlineConfig, overrides, parser, parserOptions, reportUnusedDisableDirectives, root. Flat config has no equivalent for these exact keys and fails fast to surface migration mistakes.","triggerScenarios":"An eslint.config.js containing extends: [\"eslint:recommended\"], parser: \"@babel/eslint-parser\", or overrides: [...]. createEslintrcErrorSchema(key).validate always throws.","commonSituations":"Renaming .eslintrc.json to eslint.config.js without converting the structure; copy-pasting snippets from old tutorials; using a shareable config that still exports eslintrc shape.","solutions":["Replace extends with importing the recommended config and spreading it into your array.","Move parser to languageOptions.parser and parserOptions to languageOptions.parserOptions.","Move globals into languageOptions.globals and convert overrides into additional flat config objects with files globs."],"exampleFix":"// before\nmodule.exports = { extends: [\"eslint:recommended\"], parser: \"@babel/eslint-parser\" };\n// after\nconst recommended = require(\"eslint\").config.recommended;\nmodule.exports = [\n  ...recommended,\n  { languageOptions: { parser: require(\"@babel/eslint-parser\") } }\n];","handlingStrategy":"validation","validationCode":"const ESLINTRC_KEYS = new Set(['env','extends','globals','ignorePatterns','noInlineConfig','overrides','parser','parserOptions','reportUnusedDisableDirectives','root']);\nfunction hasEslintrcKeys(config) {\n  return Object.keys(config).some(k => ESLINTRC_KEYS.has(k));\n}","typeGuard":"function isFlatConfig(c) {\n  const bad = ['env','extends','globals','ignorePatterns','noInlineConfig','overrides','parser','parserOptions','reportUnusedDisableDirectives','root'];\n  return !bad.some(k => k in c);\n}","tryCatchPattern":"try { /* load */ } catch (e) { if (e.messageTemplate === 'eslintrc-incompat') console.error('Remove eslintrc key', e.messageData.key); else throw e; }","preventionTips":["Run the migration tool when moving from eslintrc to flat config.","Grep new configs for extends/parser/overrides before committing.","Keep a checklist of converted keys during migration."],"tags":["flat-config","eslintrc-migration","config-validation"],"analyzedSha":"f131c034ad91bbf06bcbb6b5e931447a8e419a46","analyzedAt":"2026-08-03T19:53:24.025Z","schemaVersion":2}