This repository has been archived by the owner on Aug 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #395 from AtomLinter/export-directly
- Loading branch information
Showing
12 changed files
with
911 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import type * as Tslint from "tslint"; | ||
|
||
/** | ||
* Shim for TSLint v3 interoperability | ||
* @param {Function} Linter TSLint v3 linter | ||
* @return {Function} TSLint v4-compatible linter | ||
*/ | ||
export function shim(Linter: Function): typeof Tslint.Linter { | ||
function LinterShim(options) { | ||
this.options = options; | ||
this.results = {}; | ||
} | ||
|
||
// Assign class properties | ||
Object.assign(LinterShim, Linter); | ||
|
||
// Assign instance methods | ||
LinterShim.prototype = { | ||
...Linter.prototype, | ||
lint(filePath, text, configuration) { | ||
const options = { ...this.options, configuration }; | ||
const linter = new Linter(filePath, text, options); | ||
this.results = linter.lint(); | ||
}, | ||
getResult() { | ||
return this.results; | ||
}, | ||
}; | ||
|
||
return LinterShim; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
declare module "consistent-path" { | ||
const getPath: { | ||
(): string; | ||
async(): Promise<string>; | ||
} | ||
export = getPath; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.