Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
Remove 'external module' wording from rules (#340)
Browse files Browse the repository at this point in the history
The term now is just 'module'. I improved the wording while I was here.
  • Loading branch information
sandersn authored Aug 12, 2021
1 parent fc56160 commit cd084e8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/rules/noDeclareCurrentPackageRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { failure, getCommonDirectoryName } from "../util";
export class Rule extends Lint.Rules.TypedRule {
static metadata: Lint.IRuleMetadata = {
ruleName: "no-declare-current-package",
description: "Don't use an ambient module declaration of the current package; use an external module.",
description: "Don't use an ambient module declaration of the current package; use a normal module.",
optionsDescription: "Not configurable.",
options: null,
type: "functionality",
Expand Down
4 changes: 2 additions & 2 deletions src/rules/noSingleDeclareModuleRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { failure } from "../util";
export class Rule extends Lint.Rules.AbstractRule {
static metadata: Lint.IRuleMetadata = {
ruleName: "no-single-declare-module",
description: "Don't use an ambient module declaration if you can use an external module file.",
description: "Don't use an ambient module declaration if there's just one -- write it as a normal module.",
rationale: "Cuts down on nesting",
optionsDescription: "Not configurable.",
options: null,
Expand All @@ -16,7 +16,7 @@ export class Rule extends Lint.Rules.AbstractRule {

static FAILURE_STRING = failure(
Rule.metadata.ruleName,
"File has only 1 module declaration — write it as an external module.");
"File has only 1 ambient module declaration. Move the contents outside the ambient module block, rename the file to match the ambient module name, and remove the block.");

apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] {
return this.applyWithFunction(sourceFile, walk);
Expand Down
2 changes: 1 addition & 1 deletion test/no-single-declare-module/wrong.d.ts.lint
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
declare module "foo" {}
~~~~~~~~~~~~~~~~~~~~~~~ [File has only 1 module declaration — write it as an external module. See: https://github.com/Microsoft/dtslint/blob/master/docs/no-single-declare-module.md]
~~~~~~~~~~~~~~~~~~~~~~~ [File has only 1 ambient module declaration. Move the contents outside the ambient module block, rename the file to match the ambient module name, and remove the block. See: https://github.com/Microsoft/dtslint/blob/master/docs/no-single-declare-module.md]

// Other global declarations don't affect this. They should go in "declare global".
interface I {}

0 comments on commit cd084e8

Please sign in to comment.