aboutsummaryrefslogtreecommitdiff
path: root/node_modules/tslint/lib/language/rule
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2018-09-20 02:56:13 +0200
committerFlorian Dold <florian.dold@gmail.com>2018-09-20 02:56:13 +0200
commitbbff7403fbf46f9ad92240ac213df8d30ef31b64 (patch)
treec58400ec5124da1c7d56b01aea83309f80a56c3b /node_modules/tslint/lib/language/rule
parent003fb34971cf63466184351b4db5f7c67df4f444 (diff)
update packages
Diffstat (limited to 'node_modules/tslint/lib/language/rule')
-rw-r--r--node_modules/tslint/lib/language/rule/abstractRule.d.ts2
-rw-r--r--node_modules/tslint/lib/language/rule/rule.d.ts32
2 files changed, 22 insertions, 12 deletions
diff --git a/node_modules/tslint/lib/language/rule/abstractRule.d.ts b/node_modules/tslint/lib/language/rule/abstractRule.d.ts
index a5c2b82ac..65ed4a1b9 100644
--- a/node_modules/tslint/lib/language/rule/abstractRule.d.ts
+++ b/node_modules/tslint/lib/language/rule/abstractRule.d.ts
@@ -21,7 +21,7 @@ export declare type NoInfer<T> = T & {
[K in keyof T]: T[K];
};
export declare abstract class AbstractRule implements IRule {
- private options;
+ private readonly options;
static metadata: IRuleMetadata;
protected readonly ruleArguments: any[];
protected readonly ruleSeverity: RuleSeverity;
diff --git a/node_modules/tslint/lib/language/rule/rule.d.ts b/node_modules/tslint/lib/language/rule/rule.d.ts
index d1ba8ac58..e37861c36 100644
--- a/node_modules/tslint/lib/language/rule/rule.d.ts
+++ b/node_modules/tslint/lib/language/rule/rule.d.ts
@@ -73,9 +73,19 @@ export interface IRuleMetadata {
* Whether or not the rule use for TypeScript only. If `false`, this rule may be used with .js files.
*/
typescriptOnly: boolean;
+ /**
+ * Examples demonstrating what the lint rule will pass and fail
+ */
+ codeExamples?: ICodeExample[];
}
export declare type RuleType = "functionality" | "maintainability" | "style" | "typescript";
export declare type RuleSeverity = "warning" | "error" | "off";
+export interface ICodeExample {
+ config: string;
+ description: string;
+ pass: string;
+ fail?: string;
+}
export interface IOptions {
ruleArguments: any[];
ruleSeverity: RuleSeverity;
@@ -141,8 +151,8 @@ export declare class Replacement {
toJson(): ReplacementJson;
}
export declare class RuleFailurePosition {
- private position;
- private lineAndCharacter;
+ private readonly position;
+ private readonly lineAndCharacter;
constructor(position: number, lineAndCharacter: ts.LineAndCharacter);
getPosition(): number;
getLineAndCharacter(): ts.LineAndCharacter;
@@ -152,14 +162,14 @@ export declare class RuleFailurePosition {
export declare type Fix = Replacement | Replacement[];
export declare type FixJson = ReplacementJson | ReplacementJson[];
export declare class RuleFailure {
- private sourceFile;
- private failure;
- private ruleName;
- private fix;
- private fileName;
- private startPosition;
- private endPosition;
- private rawLines;
+ private readonly sourceFile;
+ private readonly failure;
+ private readonly ruleName;
+ private readonly fix?;
+ private readonly fileName;
+ private readonly startPosition;
+ private readonly endPosition;
+ private readonly rawLines;
private ruleSeverity;
static compare(a: RuleFailure, b: RuleFailure): number;
constructor(sourceFile: ts.SourceFile, start: number, end: number, failure: string, ruleName: string, fix?: Replacement | Replacement[] | undefined);
@@ -175,5 +185,5 @@ export declare class RuleFailure {
setRuleSeverity(value: RuleSeverity): void;
toJson(): IRuleFailureJson;
equals(ruleFailure: RuleFailure): boolean;
- private createFailurePosition(position);
+ private createFailurePosition;
}