Skip to content

Commit

Permalink
feat(js): allow linting only a single rule at once
Browse files Browse the repository at this point in the history
required for eslint interoperability
  • Loading branch information
charislam committed Oct 30, 2024
1 parent 1da86ce commit f4afa78
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/supa-mdx-lint/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ export class Linter {
this.linter = linterBuilder.configure(options).build();
}

lint(target: LintTarget): Promise<LintError[]> {
return this.linter.lint(target);
lint(target: LintTarget, rule?: string): Promise<LintError[]> {
return rule
? this.linter.lint_only_rule(rule, target)
: this.linter.lint(target);
}
}

Expand Down

0 comments on commit f4afa78

Please sign in to comment.