aboutsummaryrefslogtreecommitdiff
path: root/node_modules/tslint/lib/rules/variableNameRule.js
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-08-14 05:01:11 +0200
committerFlorian Dold <florian.dold@gmail.com>2017-08-14 05:02:09 +0200
commit363723fc84f7b8477592e0105aeb331ec9a017af (patch)
tree29f92724f34131bac64d6a318dd7e30612e631c7 /node_modules/tslint/lib/rules/variableNameRule.js
parent5634e77ad96bfe1818f6b6ee70b7379652e5487f (diff)
node_modules
Diffstat (limited to 'node_modules/tslint/lib/rules/variableNameRule.js')
-rw-r--r--node_modules/tslint/lib/rules/variableNameRule.js51
1 files changed, 25 insertions, 26 deletions
diff --git a/node_modules/tslint/lib/rules/variableNameRule.js b/node_modules/tslint/lib/rules/variableNameRule.js
index 23528202b..7e0af2daa 100644
--- a/node_modules/tslint/lib/rules/variableNameRule.js
+++ b/node_modules/tslint/lib/rules/variableNameRule.js
@@ -38,33 +38,33 @@ var Rule = (function (_super) {
Rule.prototype.apply = function (sourceFile) {
return this.applyWithFunction(sourceFile, walk, parseOptions(this.ruleArguments));
};
+ Rule.metadata = {
+ ruleName: "variable-name",
+ description: "Checks variable names for various errors.",
+ optionsDescription: (_a = ["\n Five arguments may be optionally provided:\n\n * `\"", "\"`: allows only lowerCamelCased or UPPER_CASED variable names\n * `\"", "\"` allows underscores at the beginning (only has an effect if \"check-format\" specified)\n * `\"", "\"` allows underscores at the end. (only has an effect if \"check-format\" specified)\n * `\"", "\"` allows PascalCase in addition to lowerCamelCase.\n * `\"", "\"` allows snake_case in addition to lowerCamelCase.\n * `\"", "\"`: disallows the use of certain TypeScript keywords as variable or parameter names.\n * These are: ", ""], _a.raw = ["\n Five arguments may be optionally provided:\n\n * \\`\"", "\"\\`: allows only lowerCamelCased or UPPER_CASED variable names\n * \\`\"", "\"\\` allows underscores at the beginning (only has an effect if \"check-format\" specified)\n * \\`\"", "\"\\` allows underscores at the end. (only has an effect if \"check-format\" specified)\n * \\`\"", "\"\\` allows PascalCase in addition to lowerCamelCase.\n * \\`\"", "\"\\` allows snake_case in addition to lowerCamelCase.\n * \\`\"", "\"\\`: disallows the use of certain TypeScript keywords as variable or parameter names.\n * These are: ", ""], Lint.Utils.dedent(_a, OPTION_CHECK_FORMAT, OPTION_LEADING_UNDERSCORE, OPTION_TRAILING_UNDERSCORE, OPTION_ALLOW_PASCAL_CASE, OPTION_ALLOW_SNAKE_CASE, OPTION_BAN_KEYWORDS, bannedKeywordsStr)),
+ options: {
+ type: "array",
+ items: {
+ type: "string",
+ enum: [
+ OPTION_CHECK_FORMAT,
+ OPTION_LEADING_UNDERSCORE,
+ OPTION_TRAILING_UNDERSCORE,
+ OPTION_ALLOW_PASCAL_CASE,
+ OPTION_ALLOW_SNAKE_CASE,
+ OPTION_BAN_KEYWORDS,
+ ],
+ },
+ minLength: 0,
+ maxLength: 5,
+ },
+ optionExamples: [[true, "ban-keywords", "check-format", "allow-leading-underscore"]],
+ type: "style",
+ typescriptOnly: false,
+ };
+ Rule.KEYWORD_FAILURE = "variable name clashes with keyword/type";
return Rule;
}(Lint.Rules.AbstractRule));
-Rule.metadata = {
- ruleName: "variable-name",
- description: "Checks variable names for various errors.",
- optionsDescription: (_a = ["\n Five arguments may be optionally provided:\n\n * `\"", "\"`: allows only lowerCamelCased or UPPER_CASED variable names\n * `\"", "\"` allows underscores at the beginning (only has an effect if \"check-format\" specified)\n * `\"", "\"` allows underscores at the end. (only has an effect if \"check-format\" specified)\n * `\"", "\"` allows PascalCase in addition to lowerCamelCase.\n * `\"", "\"` allows snake_case in addition to lowerCamelCase.\n * `\"", "\"`: disallows the use of certain TypeScript keywords as variable or parameter names.\n * These are: ", ""], _a.raw = ["\n Five arguments may be optionally provided:\n\n * \\`\"", "\"\\`: allows only lowerCamelCased or UPPER_CASED variable names\n * \\`\"", "\"\\` allows underscores at the beginning (only has an effect if \"check-format\" specified)\n * \\`\"", "\"\\` allows underscores at the end. (only has an effect if \"check-format\" specified)\n * \\`\"", "\"\\` allows PascalCase in addition to lowerCamelCase.\n * \\`\"", "\"\\` allows snake_case in addition to lowerCamelCase.\n * \\`\"", "\"\\`: disallows the use of certain TypeScript keywords as variable or parameter names.\n * These are: ", ""], Lint.Utils.dedent(_a, OPTION_CHECK_FORMAT, OPTION_LEADING_UNDERSCORE, OPTION_TRAILING_UNDERSCORE, OPTION_ALLOW_PASCAL_CASE, OPTION_ALLOW_SNAKE_CASE, OPTION_BAN_KEYWORDS, bannedKeywordsStr)),
- options: {
- type: "array",
- items: {
- type: "string",
- enum: [
- OPTION_CHECK_FORMAT,
- OPTION_LEADING_UNDERSCORE,
- OPTION_TRAILING_UNDERSCORE,
- OPTION_ALLOW_PASCAL_CASE,
- OPTION_ALLOW_SNAKE_CASE,
- OPTION_BAN_KEYWORDS,
- ],
- },
- minLength: 0,
- maxLength: 5,
- },
- optionExamples: [[true, "ban-keywords", "check-format", "allow-leading-underscore"]],
- type: "style",
- typescriptOnly: false,
-};
-Rule.KEYWORD_FAILURE = "variable name clashes with keyword/type";
exports.Rule = Rule;
function parseOptions(ruleArguments) {
var banKeywords = hasOption(OPTION_BAN_KEYWORDS);
@@ -114,7 +114,6 @@ function walk(ctx) {
handleVariableNameKeyword(name);
}
}
- break;
}
}
return ts.forEachChild(node, cb);