aboutsummaryrefslogtreecommitdiff
path: root/node_modules/tslint/lib/rules/noNamespaceRule.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/tslint/lib/rules/noNamespaceRule.js')
-rw-r--r--node_modules/tslint/lib/rules/noNamespaceRule.js44
1 files changed, 22 insertions, 22 deletions
diff --git a/node_modules/tslint/lib/rules/noNamespaceRule.js b/node_modules/tslint/lib/rules/noNamespaceRule.js
index a930e3034..381a211d9 100644
--- a/node_modules/tslint/lib/rules/noNamespaceRule.js
+++ b/node_modules/tslint/lib/rules/noNamespaceRule.js
@@ -31,30 +31,30 @@ var Rule = (function (_super) {
allowDeclarations: this.ruleArguments.indexOf(OPTION_ALLOW_DECLARATIONS) !== -1,
});
};
+ /* tslint:disable:object-literal-sort-keys */
+ Rule.metadata = {
+ ruleName: "no-namespace",
+ description: "Disallows use of internal \`module\`s and \`namespace\`s.",
+ descriptionDetails: "This rule still allows the use of `declare module ... {}`",
+ rationale: (_a = ["\n ES6-style external modules are the standard way to modularize code.\n Using `module {}` and `namespace {}` are outdated ways to organize TypeScript code."], _a.raw = ["\n ES6-style external modules are the standard way to modularize code.\n Using \\`module {}\\` and \\`namespace {}\\` are outdated ways to organize TypeScript code."], Lint.Utils.dedent(_a)),
+ optionsDescription: (_b = ["\n One argument may be optionally provided:\n\n * `", "` allows `declare namespace ... {}` to describe external APIs."], _b.raw = ["\n One argument may be optionally provided:\n\n * \\`", "\\` allows \\`declare namespace ... {}\\` to describe external APIs."], Lint.Utils.dedent(_b, OPTION_ALLOW_DECLARATIONS)),
+ options: {
+ type: "array",
+ items: {
+ type: "string",
+ enum: [OPTION_ALLOW_DECLARATIONS],
+ },
+ minLength: 0,
+ maxLength: 1,
+ },
+ optionExamples: [true, [true, OPTION_ALLOW_DECLARATIONS]],
+ type: "typescript",
+ typescriptOnly: true,
+ };
+ /* tslint:enable:object-literal-sort-keys */
+ Rule.FAILURE_STRING = "'namespace' and 'module' are disallowed";
return Rule;
}(Lint.Rules.AbstractRule));
-/* tslint:disable:object-literal-sort-keys */
-Rule.metadata = {
- ruleName: "no-namespace",
- description: "Disallows use of internal \`module\`s and \`namespace\`s.",
- descriptionDetails: "This rule still allows the use of `declare module ... {}`",
- rationale: (_a = ["\n ES6-style external modules are the standard way to modularize code.\n Using `module {}` and `namespace {}` are outdated ways to organize TypeScript code."], _a.raw = ["\n ES6-style external modules are the standard way to modularize code.\n Using \\`module {}\\` and \\`namespace {}\\` are outdated ways to organize TypeScript code."], Lint.Utils.dedent(_a)),
- optionsDescription: (_b = ["\n One argument may be optionally provided:\n\n * `", "` allows `declare namespace ... {}` to describe external APIs."], _b.raw = ["\n One argument may be optionally provided:\n\n * \\`", "\\` allows \\`declare namespace ... {}\\` to describe external APIs."], Lint.Utils.dedent(_b, OPTION_ALLOW_DECLARATIONS)),
- options: {
- type: "array",
- items: {
- type: "string",
- enum: [OPTION_ALLOW_DECLARATIONS],
- },
- minLength: 0,
- maxLength: 1,
- },
- optionExamples: [true, [true, OPTION_ALLOW_DECLARATIONS]],
- type: "typescript",
- typescriptOnly: true,
-};
-/* tslint:enable:object-literal-sort-keys */
-Rule.FAILURE_STRING = "'namespace' and 'module' are disallowed";
exports.Rule = Rule;
function walk(ctx) {
// Ignore all .d.ts files by returning and not walking their ASTs.