Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Commit

Permalink
chore: add types for tslint-rule-documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Apr 5, 2021
1 parent fe1cd90 commit ff5e6b2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions lib/module_types/tslint-rule-documentation.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
declare module "tslint-rule-documentation" {
export interface IRuleResult {
found: boolean; // true if the rule is a TSLint core rule, or a known plugin rule, false otherwise
uri: string; // If found is true, uri of the documentation of the rule. If found is false, uri of the contribution guidelines
}
/** Find the url for the documentation of a TSLint rule
* @param {string} ruleID The ID of a TSLint rule such as `no-var-keyword` or `__example/foo`
*/
export function getRuleUri(ruleID: string): IRuleResult
}
2 changes: 1 addition & 1 deletion lib/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ async function lint(content: string, filePath: string, options: Tslint.ILinterOp
return [];
}

return lintResult["failures"].map((failure: Tslint.RuleFailure) => {
return lintResult.failures.map((failure: Tslint.RuleFailure) => {
const ruleUri = getRuleUri(failure.getRuleName());
const startPosition = failure.getStartPosition().getLineAndCharacter();
const endPosition = failure.getEndPosition().getLineAndCharacter();
Expand Down

0 comments on commit ff5e6b2

Please sign in to comment.