-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Change Request: Default languageOptions for languages #18985
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 inclusioncoreRelates to ESLint's core APIs and featuresRelates to ESLint's core APIs and featuresenhancementThis change enhances an existing feature of ESLintThis change enhances an existing feature of 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 inclusioncoreRelates to ESLint's core APIs and featuresRelates to ESLint's core APIs and featuresenhancementThis change enhances an existing feature of ESLintThis change enhances an existing feature of ESLint
Type
Projects
Status
Complete
ESLint version
HEAD
What problem do you want to solve?
Right now, we have some default languageOptions for JavaScript that are specified in the core. This ensures that
context.languageOptions.parseris always an object even if it's never overwritten.Once we pull the JS functionality out of the core, we'll need to remove this default configuration too, but it has nowhere to go.
Similarly, other language plugins have no way to specify default
languageOptionsthat should be applied whenever the language is used.What do you think is the correct solution?
I think we need to let language objects provide a
defaultLanguageOptionsproperty that the core will read and merge into any config that is using the given language.Another option that doesn't require core changes is for each plugin to export a
baseconfig (or something like that) that users will then have to manually add to their config array. This doesn't seem like a good option due to the chances of forgetting.Participation
Additional comments
No response