8000 Change Request: Default languageOptions for languages · Issue #18985 · eslint/eslint · GitHub
[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Request: Default languageOptions for languages #18985

Closed
1 task
nzakas opened this issue Oct 4, 2024 · 3 comments · Fixed by #19003
Closed
1 task
8000

Change Request: Default languageOptions for languages #18985

nzakas opened this issue Oct 4, 2024 · 3 comments · Fixed by #19003
Assignees
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint

Comments

@nzakas
Copy link
Member
nzakas commented Oct 4, 2024

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

@nzakas nzakas added core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint labels Oct 4, 2024
@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Oct 4, 2024
@DeshDeepakKushwaha
Copy link

I’d like to work on implementing the tags/labels feature as discussed in this issue.

@mdjermanovic
Copy link
Member

I’d like to work on implementing the tags/labels feature as discussed in this issue.

@DeshDeepakKushwaha perhaps you intended to post this on #18989?

@mdjermanovic
Copy link
Member

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.

Makes sense to me. I can work on this.

@mdjermanovic mdjermanovic self-assigned this Oct 8, 2024
@mdjermanovic mdjermanovic moved this from Needs Triage to Ready to Implement in Triage Oct 8, 2024
@mdjermanovic mdjermanovic added the accepted There is consensus among the team that this change meets the criteria for inclusion label Oct 8, 2024
@mdjermanovic mdjermanovic moved this from Ready to Implement to Implementing in Triage Oct 8, 2024
@github-project-automation github-project-automation bot moved this from Implementing to Complete in Triage Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants
0