Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Add "format" rule category #2832

Merged
merged 3 commits into from
Feb 23, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/rules/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,9 @@ _These rules make code maintenance easier_:
_These rules enforce consistent style across your codebase_:

{% include rule_list.html ruleType="style" %}

### Format

_These rules enforce consistent use of whitespace and punctuation_:

{% include rule_list.html ruleType="format" %}
2 changes: 1 addition & 1 deletion src/language/rule/rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export interface IRuleMetadata {
codeExamples?: ICodeExample[];
}

export type RuleType = "functionality" | "maintainability" | "style" | "typescript";
export type RuleType = "functionality" | "maintainability" | "style" | "typescript" | "format";

export type RuleSeverity = "warning" | "error" | "off";

Expand Down
2 changes: 1 addition & 1 deletion src/rules/alignRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class Rule extends Lint.Rules.AbstractRule {
maxLength: 5,
},
optionExamples: [[true, "parameters", "statements"]],
type: "style",
type: "format",
typescriptOnly: false,
};
/* tslint:enable:object-literal-sort-keys */
Expand Down
2 changes: 1 addition & 1 deletion src/rules/arrowParensRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class Rule extends Lint.Rules.AbstractRule {
enum: [BAN_SINGLE_ARG_PARENS],
},
optionExamples: [true, [true, BAN_SINGLE_ARG_PARENS]],
type: "style",
type: "format",
typescriptOnly: false,
};
/* tslint:enable:object-literal-sort-keys */
Expand Down
2 changes: 1 addition & 1 deletion src/rules/eoflineRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class Rule extends Lint.Rules.AbstractRule {
options: null,
optionExamples: [true],
hasFix: true,
type: "maintainability",
type: "format",
typescriptOnly: false,
};
/* tslint:enable:object-literal-sort-keys */
Expand Down
2 changes: 1 addition & 1 deletion src/rules/importSpacingRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class Rule extends Lint.Rules.AbstractRule {
optionsDescription: "Not configurable.",
options: null,
optionExamples: [true],
type: "style",
type: "format",
typescriptOnly: false,
};

Expand Down
2 changes: 1 addition & 1 deletion src/rules/indentRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class Rule extends Lint.Rules.AbstractRule {
[true, OPTION_USE_TABS, OPTION_INDENT_SIZE_2],
],
hasFix: true,
type: "maintainability",
type: "format",
typescriptOnly: false,
};
/* tslint:enable:object-literal-sort-keys */
Expand Down
2 changes: 1 addition & 1 deletion src/rules/jsdocFormatRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class Rule extends Lint.Rules.AbstractRule {
},
},
optionExamples: [true, [true, OPTION_CHECK_MULTILINE_START]],
type: "style",
type: "format",
typescriptOnly: false,
};
/* tslint:enable:object-literal-sort-keys */
Expand Down
2 changes: 1 addition & 1 deletion src/rules/linebreakStyleRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class Rule extends Lint.Rules.AbstractRule {
enum: [OPTION_LINEBREAK_STYLE_LF, OPTION_LINEBREAK_STYLE_CRLF],
},
optionExamples: [[true, OPTION_LINEBREAK_STYLE_LF], [true, OPTION_LINEBREAK_STYLE_CRLF]],
type: "maintainability",
type: "format",
typescriptOnly: false,
hasFix: true,
};
Expand Down
2 changes: 1 addition & 1 deletion src/rules/maxLineLengthRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class Rule extends Lint.Rules.AbstractRule {
optionExamples: [[true, 120], [true, {
"limit": 120,
"ignore-pattern": "^import |^export \{(.*?)\}"}]],
type: "maintainability",
type: "format",
typescriptOnly: false,
};
/* tslint:enable:object-literal-sort-keys */
Expand Down
2 changes: 1 addition & 1 deletion src/rules/newParensRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class Rule extends Lint.Rules.AbstractRule {
optionsDescription: "Not configurable.",
options: null,
optionExamples: [true],
type: "style",
type: "format",
typescriptOnly: false,
};
/* tslint:enable:object-literal-sort-keys */
Expand Down
2 changes: 1 addition & 1 deletion src/rules/newlineBeforeReturnRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class Rule extends Lint.Rules.AbstractRule {
optionsDescription: "Not configurable.",
options: {},
optionExamples: [true],
type: "style",
type: "format",
typescriptOnly: false,
};
/* tslint:enable:object-literal-sort-keys */
Expand Down
2 changes: 1 addition & 1 deletion src/rules/noConsecutiveBlankLinesRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class Rule extends Lint.Rules.AbstractRule {
minimum: "1",
},
optionExamples: [true, [true, 2]],
type: "style",
type: "format",
typescriptOnly: false,
};
/* tslint:enable:object-literal-sort-keys */
Expand Down
2 changes: 1 addition & 1 deletion src/rules/noIrregularWhitespaceRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class Rule extends Lint.Rules.AbstractRule {
optionsDescription: "Not configurable.",
options: null,
optionExamples: [true],
type: "style",
type: "format",
typescriptOnly: false,
};
/* tslint:enable:object-literal-sort-keys */
Expand Down
2 changes: 1 addition & 1 deletion src/rules/noTrailingWhitespaceRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class Rule extends Lint.Rules.AbstractRule {
[true, OPTION_IGNORE_COMMENTS],
[true, OPTION_IGNORE_JSDOC],
],
type: "style",
type: "format",
typescriptOnly: false,
};
/* tslint:enable:object-literal-sort-keys */
Expand Down
2 changes: 1 addition & 1 deletion src/rules/numberLiteralFormatRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class Rule extends Lint.Rules.AbstractRule {
Helps keep a consistent style with numeric literals.
Non-standard literals are more difficult to scan through and can be a symptom of typos.
`,
type: "style",
type: "format",
typescriptOnly: false,
};
/* tslint:enable:object-literal-sort-keys */
Expand Down
2 changes: 1 addition & 1 deletion src/rules/quotemarkRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class Rule extends Lint.Rules.AbstractRule {
[true, OPTION_SINGLE, OPTION_AVOID_ESCAPE, OPTION_AVOID_TEMPLATE],
[true, OPTION_SINGLE, OPTION_JSX_DOUBLE],
],
type: "style",
type: "format",
typescriptOnly: false,
};
/* tslint:enable:object-literal-sort-keys */
Expand Down
2 changes: 1 addition & 1 deletion src/rules/semicolonRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class Rule extends Lint.Rules.AbstractRule {
[true, OPTION_ALWAYS, OPTION_IGNORE_INTERFACES],
[true, OPTION_ALWAYS, OPTION_IGNORE_BOUND_CLASS_METHODS],
],
type: "style",
type: "format",
typescriptOnly: false,
};
/* tslint:enable:object-literal-sort-keys */
Expand Down
2 changes: 1 addition & 1 deletion src/rules/trailingCommaRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export class Rule extends Lint.Rules.AbstractRule {
},
],
],
type: "maintainability",
type: "format",
typescriptOnly: false,
};
/* tslint:enable:object-literal-sort-keys */
Expand Down
2 changes: 1 addition & 1 deletion src/rules/typedefWhitespaceRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class Rule extends Lint.Rules.AbstractRule {
},
],
],
type: "typescript",
type: "format",
typescriptOnly: true,
hasFix: true,
};
Expand Down
2 changes: 1 addition & 1 deletion src/rules/whitespaceRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class Rule extends Lint.Rules.AbstractRule {
maxLength: 10,
},
optionExamples: [[true, "check-branch", "check-operator", "check-typecast"]],
type: "style",
type: "format",
typescriptOnly: false,
hasFix: true,
};
Expand Down