-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Implement Flat Config #13481
Copy link
Copy link
Closed
Labels
acceptedThere is consensus among the team that this change meets the criteria for inclusionThere is consensus among the team that this change meets the criteria for inclusionbreakingThis change is backwards-incompatibleThis change is backwards-incompatiblecoreRelates to ESLint's core APIs and featuresRelates to ESLint's core APIs and featuresfeatureThis change adds a new feature to ESLintThis change adds a new feature to ESLint
Metadata
Metadata
Assignees
Labels
acceptedThere is consensus among the team that this change meets the criteria for inclusionThere is consensus among the team that this change meets the criteria for inclusionbreakingThis change is backwards-incompatibleThis change is backwards-incompatiblecoreRelates to ESLint's core APIs and featuresRelates to ESLint's core APIs and featuresfeatureThis change adds a new feature to ESLintThis change adds a new feature to ESLint
This issue describes the implementation plan for eslint/rfcs#9, which will take place in several phases:
Phase 1: Extract current config system
eslint/eslintrc)eslintrcsource files and tests into new GitHub repository@eslint/eslintrc@eslint/eslintrcto npm@eslint/eslintrcCLIEngineto useCascadingConfigArrayFactoryfrom@eslint/eslintrcPhase 2: Implement flat config with
eslintrccompatibilityFlatCompatclass ineslint/eslintrcrepositoryFlatConfigArrayto represent simple configsLinterclass to understandFlatConfigArrayobjectsLinter#defineRuleandLinter#definePluginthrow errors when usingFlatConfigArraycontext.languageOptionsin backwards-compatible way tocontextinLintercontext.parserPathstill works inLinterforFlatConfigArray(for now)FlatRuleTesterto allow rule testing withFlatConfigArrayformatFlatESLintclass to mirrorESLintclass but useeslint.config.jsinsteadcli.jsto search foreslint.config.jsfile and useFlatESLintif found (ESLintif not)--resolve-plugins-relative-to)eslint/eslintrepo to use flat configeslintrccompatibilitycwdwere not found #16413FlatESLintgetRulesMetaForResultsfails on anonymous files when optioncwdis set #16410FlatESLintgetRulesMetaForResultsfails on messages without aruleId#16402baseConfigoption is unused inFlatESLint#16341FlatESLint#16340.eslintignoredoesn't work like.gitignore#16264Phase 3: Compatibility testing
typescript-eslintto switch to new format and ensure it works correctly (pull request)eslint-plugin-importto switch to new format and ensure it works correctly (@mdjermanovic) [Fix] pass languageOptions through in child context import-js/eslint-plugin-import#2829 Support eslint flat config import-js/eslint-plugin-import#2873eslint-config-airbnbto switch to new format and ensure it works correctly (@mdjermanovic)eslint-config-standardto switch to new format and ensure it works correctly (pull request]eslint-plugin-nto switch configs to new format and ensure it works correctly (@mdjermanovic) (pull request)eslint-plugin-vueto switch configs to new format and ensure it works correctly (pull request)eslint-plugin-reactto switch configs to new format and ensure it works correctly (@mdjermanovic) (pull request)FlatCompatPhase 4: General availability (v9.0.0)
eslintrcfileseslint.config.jsis the default and recommended format (link to legacyeslintrcdocs from the same page)Linterto use flat config by defaultESLintclass toLegacyESLintand renameFlatESLinttoESLintRuleTesterclass and renameFlatRuleTestertoRuleTesterapi.jsto export new values forESLintandRuleTestershouldUseFlatConfig()to returntrueexcept ifESLINT_USE_FLAT_CONFIGisfalse.Phase 5: Remove
eslintrc(v10.0.0)context.parserPath,context.parserOptions,context.globalsinLinter(fix!: Remove deprecated rule context methods #20086, fix!: Remove deprecated RuleContext methods rewrite#263)configTypeconstructor option forLinter; throw error if found.eslint-envconfig comment is used (feat!: reporteslint-envcomments as errors #20128)eslintrcsupport (feat!: remove eslintrc support #20037)eslintrcdocumentationFlatESLintclassLegacyESLintclassshouldUseFlatConfig()to always returntrueeslintrc🎉