Skip to content

Commit

Permalink
feat: Add meta.language and meta.dialects to RuleDefinition (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
nzakas authored Feb 21, 2025
1 parent 664740a commit dac0387
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,16 @@ export interface RulesMeta<
* Indicates if the rule may provide suggestions.
*/
hasSuggestions?: boolean | undefined;

/**
* The language the rule is intended to lint.
*/
language?: string;

/**
* The dialects of `language` that the rule is intended to lint.
*/
dialects?: string[];
}

/**
Expand Down
2 changes: 2 additions & 0 deletions packages/core/tests/types/types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ const testRule: RuleDefinition<{
badFoo: "change this foo",
wrongBar: "fix this bar",
},
language: "javascript",
dialects: ["javascript", "typescript"],
},

create(context: TestRuleContext): TestRuleVisitor {
Expand Down

0 comments on commit dac0387

Please sign in to comment.