From f54b71654772d2e02f2dd85d14bb2dc5f9e4fb91 Mon Sep 17 00:00:00 2001 From: Jack Bates Date: Thu, 3 Sep 2020 08:32:01 -0700 Subject: [PATCH 1/2] Add default project check --- src/rules/dtHeaderRule.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rules/dtHeaderRule.ts b/src/rules/dtHeaderRule.ts index 82d306ee..9651895c 100644 --- a/src/rules/dtHeaderRule.ts +++ b/src/rules/dtHeaderRule.ts @@ -34,6 +34,9 @@ function walk(ctx: Lint.WalkContext): void { return; } + lookFor( + "// Project: https://github.com/baz/foo", + "Project should be a link to the project's source code repository, not the default."); lookFor("// Definitions by: My Self", "Author name should be your name, not the default."); const error = validate(text); if (error) { From 569cb5d37780a7c9599a437097c9725cbbb1ecac Mon Sep 17 00:00:00 2001 From: Jack Bates Date: Thu, 3 Sep 2020 08:31:37 -0700 Subject: [PATCH 2/2] Add tests --- test/dt-header/wrong/types/default-project/index.d.ts.lint | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 test/dt-header/wrong/types/default-project/index.d.ts.lint diff --git a/test/dt-header/wrong/types/default-project/index.d.ts.lint b/test/dt-header/wrong/types/default-project/index.d.ts.lint new file mode 100644 index 00000000..d2082ad1 --- /dev/null +++ b/test/dt-header/wrong/types/default-project/index.d.ts.lint @@ -0,0 +1,5 @@ +// Type definitions for dt-header 1.0 +// Project: https://github.com/baz/foo (Does not have to be to GitHub, but prefer linking to a source code repository rather than to a project website.) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [Project should be a link to the project's source code repository, not the default. See: https://github.com/Microsoft/dtslint/blob/master/docs/dt-header.md] +// Definitions by: Jane Doe +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped