Skip to content

Change Request: Default languageOptions for languages #18985

@nzakas

Description

@nzakas

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.parser is 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 languageOptions that 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 defaultLanguageOptions property 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 base config (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

  • I am willing to submit a pull request for this change.

Additional comments

No response

Metadata

Metadata

Assignees

Labels

acceptedThere is consensus among the team that this change meets the criteria for inclusioncoreRelates to ESLint's core APIs and featuresenhancementThis change enhances an existing feature of ESLint

Type

No type

Projects

Status

Complete

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions