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: Move the language option to settings.language. #277

Closed
1 task
m1rn opened this issue Aug 30, 2024 · 1 comment
Closed
1 task

Change Request: Move the language option to settings.language. #277

m1rn opened this issue Aug 30, 2024 · 1 comment

Comments

@m1rn
Copy link

m1rn commented Aug 30, 2024

Environment

Node version: v22.1.0
npm version: v10.7.0
Local ESLint version: v9.9.1 (Currently used)
Global ESLint version: Not found
Operating System: win32 10.0.22631

What problem do you want to solve?

@eslint/markdown and @eslint/json both have a language option that needs to be defined within the ESLint configuration object. However, this property is not actually documented in the ESLint configuration object documentation, leading to editor complaints when using TypeScript. I would prefer that such custom fields be defined in settings, for example:

import markdown from '@eslint/markdown';

export default [
  {
    files: ['**/*.md'],
    plugins: {
      markdown,
    },
    rules: {
      'markdown/fenced-code-language': 2
    },
    processor: 'markdown/markdown',
    settings: {
      language: 'markdown/commonmark',
    }
  }
];

What do you think is the correct solution?

Participation

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

Additional comments

No response

@nzakas
Copy link
Member

nzakas commented Aug 30, 2024

This is the standard way ESLint switches languages. It's mentioned in the ESLint docs:
https://eslint.org/docs/latest/use/configure/plugins#specify-a-language

@types/eslint isn't actually maintained by us, that's why it's not there yet, but we can take a look to see if we can get it added.

@nzakas nzakas closed this as not planned Won't fix, can't repro, duplicate, stale Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

2 participants