Skip to content

Rule Change: Support language and dialects to meta #339

Description

@lumirlumir

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

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

Status
Implementing

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions