Skip to content

Rule Change: Support language and dialects to meta #339

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

Open
1 task done
lumirlumir opened this issue Apr 7, 2025 · 1 comment
Open
1 task done

Rule Change: Support language and dialects to meta #339

lumirlumir opened this issue Apr 7, 2025 · 1 comment

Comments

@lumirlumir
Copy link
Member

lumirlumir commented Apr 7, 2025

What rule do you want to change?

Every rule

What change do you want to make?

N/A

How do you think the change should be implemented?

Other

Example code

meta: {
		type: "problem",

		docs: {
			description: "Disallow HTML tags",
		},

		messages: {
			disallowedElement: 'HTML element "{{name}}" is not allowed.',
		},

		schema: [
			{
				type: "object",
				properties: {
					allowed: {
						type: "array",
						items: {
							type: "string",
						},
						uniqueItems: true,
					},
				},
				additionalProperties: false,
			},
		],
	},

What does the rule currently do for this code?

Currently, none of the rules have the language or dialects fields in their meta.

I noticed that all new rules added to ESLint for TypeScript support now include the language and dialects fields:

https://github.com/eslint/eslint/pull/19562/files#diff-d46d32957ba664c4b406c7587c5e047ab7f719ea98a597e0316837d61be4fc48R150-R151

Like we did for JavaScript, I’d like to suggest adding the language and dialects fields to meta as well.

What will the rule do after it's changed?

I think we could add them like this:

meta: {
    // ...
    language: 'markdown',
    dialects: ['commonmark', 'gfm'],
    // ...
}

The language field should be 'markdown', and the dialects can be 'commonmark' and 'gfm'.

Participation

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

Additional comments

No response

@eslintbot eslintbot added this to Triage Apr 7, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Apr 7, 2025
@nzakas
Copy link
Member

nzakas commented Apr 7, 2025

We are holding off on doing this for other plugins as we are revisiting this design:
eslint/eslint#19462

@nzakas nzakas moved this from Needs Triage to Blocked in Triage Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Blocked
Development

No branches or pull requests

2 participants