Skip to content

Commit dac0387

Browse files
authored
feat: Add meta.language and meta.dialects to RuleDefinition (#156)
1 parent 664740a commit dac0387

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

packages/core/src/types.ts

+10
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,16 @@ export interface RulesMeta<
186186
* Indicates if the rule may provide suggestions.
187187
*/
188188
hasSuggestions?: boolean | undefined;
189+
190+
/**
191+
* The language the rule is intended to lint.
192+
*/
193+
language?: string;
194+
195+
/**
196+
* The dialects of `language` that the rule is intended to lint.
197+
*/
198+
dialects?: string[];
189199
}
190200

191201
/**

packages/core/tests/types/types.test.ts

+2
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,8 @@ const testRule: RuleDefinition<{
236236
badFoo: "change this foo",
237237
wrongBar: "fix this bar",
238238
},
239+
language: "javascript",
240+
dialects: ["javascript", "typescript"],
239241
},
240242

241243
create(context: TestRuleContext): TestRuleVisitor {

0 commit comments

Comments
 (0)