aboutsummaryrefslogtreecommitdiff
path: root/node_modules/tslint/lib/rules/indentRule.js
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/rules/indentRule.js
parent003fb34971cf63466184351b4db5f7c67df4f444 (diff)
update packages
Diffstat (limited to 'node_modules/tslint/lib/rules/indentRule.js')
-rw-r--r--node_modules/tslint/lib/rules/indentRule.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/node_modules/tslint/lib/rules/indentRule.js b/node_modules/tslint/lib/rules/indentRule.js
index 599ec98c3..13ebe62ad 100644
--- a/node_modules/tslint/lib/rules/indentRule.js
+++ b/node_modules/tslint/lib/rules/indentRule.js
@@ -41,8 +41,8 @@ var Rule = /** @class */ (function (_super) {
Rule.metadata = {
ruleName: "indent",
description: "Enforces indentation with tabs or spaces.",
- rationale: (_a = ["\n Using only one of tabs or spaces for indentation leads to more consistent editor behavior,\n cleaner diffs in version control, and easier programmatic manipulation."], _a.raw = ["\n Using only one of tabs or spaces for indentation leads to more consistent editor behavior,\n cleaner diffs in version control, and easier programmatic manipulation."], Lint.Utils.dedent(_a)),
- optionsDescription: (_b = ["\n One of the following arguments must be provided:\n\n * `", "` enforces consistent spaces.\n * `", "` enforces consistent tabs.\n\n A second optional argument specifies indentation size:\n\n * `", "` enforces 2 space indentation.\n * `", "` enforces 4 space indentation.\n\n Indentation size is required for auto-fixing, but not for rule checking.\n "], _b.raw = ["\n One of the following arguments must be provided:\n\n * \\`", "\\` enforces consistent spaces.\n * \\`", "\\` enforces consistent tabs.\n\n A second optional argument specifies indentation size:\n\n * \\`", "\\` enforces 2 space indentation.\n * \\`", "\\` enforces 4 space indentation.\n\n Indentation size is required for auto-fixing, but not for rule checking.\n "], Lint.Utils.dedent(_b, OPTION_USE_SPACES, OPTION_USE_TABS, OPTION_INDENT_SIZE_2.toString(), OPTION_INDENT_SIZE_4.toString())),
+ rationale: Lint.Utils.dedent(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n Using only one of tabs or spaces for indentation leads to more consistent editor behavior,\n cleaner diffs in version control, and easier programmatic manipulation."], ["\n Using only one of tabs or spaces for indentation leads to more consistent editor behavior,\n cleaner diffs in version control, and easier programmatic manipulation."]))),
+ optionsDescription: Lint.Utils.dedent(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n One of the following arguments must be provided:\n\n * `", "` enforces consistent spaces.\n * `", "` enforces consistent tabs.\n\n A second optional argument specifies indentation size:\n\n * `", "` enforces 2 space indentation.\n * `", "` enforces 4 space indentation.\n\n Indentation size is **required** for auto-fixing, but not for rule checking.\n\n **NOTE**: auto-fixing will only convert invalid indent whitespace to the desired type, it will not fix invalid whitespace sizes.\n "], ["\n One of the following arguments must be provided:\n\n * \\`", "\\` enforces consistent spaces.\n * \\`", "\\` enforces consistent tabs.\n\n A second optional argument specifies indentation size:\n\n * \\`", "\\` enforces 2 space indentation.\n * \\`", "\\` enforces 4 space indentation.\n\n Indentation size is **required** for auto-fixing, but not for rule checking.\n\n **NOTE**: auto-fixing will only convert invalid indent whitespace to the desired type, it will not fix invalid whitespace sizes.\n "])), OPTION_USE_SPACES, OPTION_USE_TABS, OPTION_INDENT_SIZE_2.toString(), OPTION_INDENT_SIZE_4.toString()),
options: {
type: "array",
items: [
@@ -63,6 +63,7 @@ var Rule = /** @class */ (function (_super) {
[true, OPTION_USE_SPACES, OPTION_INDENT_SIZE_4],
[true, OPTION_USE_TABS, OPTION_INDENT_SIZE_2],
],
+ hasFix: true,
type: "maintainability",
typescriptOnly: false,
};
@@ -114,6 +115,7 @@ function createFix(lineStart, fullLeadingWhitespace, tabs, size) {
return undefined;
}
var replaceRegExp = tabs
+ // we want to find every group of `size` spaces, plus up to one 'incomplete' group
? new RegExp("^( {" + size + "})+( {1," + (size - 1) + "})?", "g")
: /\t/g;
var replacement = fullLeadingWhitespace.replace(replaceRegExp, function (match) {
@@ -121,4 +123,4 @@ function createFix(lineStart, fullLeadingWhitespace, tabs, size) {
});
return new Lint.Replacement(lineStart, fullLeadingWhitespace.length, replacement);
}
-var _a, _b;
+var templateObject_1, templateObject_2;