aboutsummaryrefslogtreecommitdiff
path: root/node_modules/tslint/lib/rules/objectLiteralKeyQuotesRule.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/objectLiteralKeyQuotesRule.js
parent5634e77ad96bfe1818f6b6ee70b7379652e5487f (diff)
node_modules
Diffstat (limited to 'node_modules/tslint/lib/rules/objectLiteralKeyQuotesRule.js')
-rw-r--r--node_modules/tslint/lib/rules/objectLiteralKeyQuotesRule.js34
1 files changed, 17 insertions, 17 deletions
diff --git a/node_modules/tslint/lib/rules/objectLiteralKeyQuotesRule.js b/node_modules/tslint/lib/rules/objectLiteralKeyQuotesRule.js
index 073bdf035..5ab8bfa3a 100644
--- a/node_modules/tslint/lib/rules/objectLiteralKeyQuotesRule.js
+++ b/node_modules/tslint/lib/rules/objectLiteralKeyQuotesRule.js
@@ -40,25 +40,25 @@ var Rule = (function (_super) {
option: this.ruleArguments.length === 0 ? "always" : this.ruleArguments[0],
}));
};
+ /* tslint:disable:object-literal-sort-keys */
+ Rule.metadata = {
+ ruleName: "object-literal-key-quotes",
+ description: "Enforces consistent object literal property quote style.",
+ descriptionDetails: (_a = ["\n Object literal property names can be defined in two ways: using literals or using strings.\n For example, these two objects are equivalent:\n\n var object1 = {\n property: true\n };\n\n var object2 = {\n \"property\": true\n };\n\n In many cases, it doesn\u2019t matter if you choose to use an identifier instead of a string\n or vice-versa. Even so, you might decide to enforce a consistent style in your code.\n\n This rules lets you enforce consistent quoting of property names. Either they should always\n be quoted (default behavior) or quoted only as needed (\"as-needed\")."], _a.raw = ["\n Object literal property names can be defined in two ways: using literals or using strings.\n For example, these two objects are equivalent:\n\n var object1 = {\n property: true\n };\n\n var object2 = {\n \"property\": true\n };\n\n In many cases, it doesn\u2019t matter if you choose to use an identifier instead of a string\n or vice-versa. Even so, you might decide to enforce a consistent style in your code.\n\n This rules lets you enforce consistent quoting of property names. Either they should always\n be quoted (default behavior) or quoted only as needed (\"as-needed\")."], Lint.Utils.dedent(_a)),
+ hasFix: true,
+ optionsDescription: (_b = ["\n Possible settings are:\n\n * `\"", "\"`: Property names should always be quoted. (This is the default.)\n * `\"", "\"`: Only property names which require quotes may be quoted (e.g. those with spaces in them).\n * `\"", "\"`: Property names should either all be quoted or unquoted.\n * `\"", "\"`: If any property name requires quotes, then all properties must be quoted. Otherwise, no\n property names may be quoted.\n\n For ES6, computed property names (`{[name]: value}`) and methods (`{foo() {}}`) never need\n to be quoted."], _b.raw = ["\n Possible settings are:\n\n * \\`\"", "\"\\`: Property names should always be quoted. (This is the default.)\n * \\`\"", "\"\\`: Only property names which require quotes may be quoted (e.g. those with spaces in them).\n * \\`\"", "\"\\`: Property names should either all be quoted or unquoted.\n * \\`\"", "\"\\`: If any property name requires quotes, then all properties must be quoted. Otherwise, no\n property names may be quoted.\n\n For ES6, computed property names (\\`{[name]: value}\\`) and methods (\\`{foo() {}}\\`) never need\n to be quoted."], Lint.Utils.dedent(_b, OPTION_ALWAYS, OPTION_AS_NEEDED, OPTION_CONSISTENT, OPTION_CONSISTENT_AS_NEEDED)),
+ options: {
+ type: "string",
+ enum: [OPTION_ALWAYS, OPTION_AS_NEEDED, OPTION_CONSISTENT, OPTION_CONSISTENT_AS_NEEDED],
+ },
+ optionExamples: [[true, OPTION_AS_NEEDED], [true, OPTION_ALWAYS]],
+ type: "style",
+ typescriptOnly: false,
+ };
+ /* tslint:enable:object-literal-sort-keys */
+ Rule.INCONSISTENT_PROPERTY = "All property names in this object literal must be consistently quoted or unquoted.";
return Rule;
}(Lint.Rules.AbstractRule));
-/* tslint:disable:object-literal-sort-keys */
-Rule.metadata = {
- ruleName: "object-literal-key-quotes",
- description: "Enforces consistent object literal property quote style.",
- descriptionDetails: (_a = ["\n Object literal property names can be defined in two ways: using literals or using strings.\n For example, these two objects are equivalent:\n\n var object1 = {\n property: true\n };\n\n var object2 = {\n \"property\": true\n };\n\n In many cases, it doesn\u2019t matter if you choose to use an identifier instead of a string\n or vice-versa. Even so, you might decide to enforce a consistent style in your code.\n\n This rules lets you enforce consistent quoting of property names. Either they should always\n be quoted (default behavior) or quoted only as needed (\"as-needed\")."], _a.raw = ["\n Object literal property names can be defined in two ways: using literals or using strings.\n For example, these two objects are equivalent:\n\n var object1 = {\n property: true\n };\n\n var object2 = {\n \"property\": true\n };\n\n In many cases, it doesn\u2019t matter if you choose to use an identifier instead of a string\n or vice-versa. Even so, you might decide to enforce a consistent style in your code.\n\n This rules lets you enforce consistent quoting of property names. Either they should always\n be quoted (default behavior) or quoted only as needed (\"as-needed\")."], Lint.Utils.dedent(_a)),
- hasFix: true,
- optionsDescription: (_b = ["\n Possible settings are:\n\n * `\"", "\"`: Property names should always be quoted. (This is the default.)\n * `\"", "\"`: Only property names which require quotes may be quoted (e.g. those with spaces in them).\n * `\"", "\"`: Property names should either all be quoted or unquoted.\n * `\"", "\"`: If any property name requires quotes, then all properties must be quoted. Otherwise, no\n property names may be quoted.\n\n For ES6, computed property names (`{[name]: value}`) and methods (`{foo() {}}`) never need\n to be quoted."], _b.raw = ["\n Possible settings are:\n\n * \\`\"", "\"\\`: Property names should always be quoted. (This is the default.)\n * \\`\"", "\"\\`: Only property names which require quotes may be quoted (e.g. those with spaces in them).\n * \\`\"", "\"\\`: Property names should either all be quoted or unquoted.\n * \\`\"", "\"\\`: If any property name requires quotes, then all properties must be quoted. Otherwise, no\n property names may be quoted.\n\n For ES6, computed property names (\\`{[name]: value}\\`) and methods (\\`{foo() {}}\\`) never need\n to be quoted."], Lint.Utils.dedent(_b, OPTION_ALWAYS, OPTION_AS_NEEDED, OPTION_CONSISTENT, OPTION_CONSISTENT_AS_NEEDED)),
- options: {
- type: "string",
- enum: [OPTION_ALWAYS, OPTION_AS_NEEDED, OPTION_CONSISTENT, OPTION_CONSISTENT_AS_NEEDED],
- },
- optionExamples: [[true, OPTION_AS_NEEDED], [true, OPTION_ALWAYS]],
- type: "style",
- typescriptOnly: false,
-};
-/* tslint:enable:object-literal-sort-keys */
-Rule.INCONSISTENT_PROPERTY = "All property names in this object literal must be consistently quoted or unquoted.";
exports.Rule = Rule;
var ObjectLiteralKeyQuotesWalker = (function (_super) {
tslib_1.__extends(ObjectLiteralKeyQuotesWalker, _super);