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

Add default project check #307

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/rules/dtHeaderRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ function walk(ctx: Lint.WalkContext<void>): 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) {
Expand Down
5 changes: 5 additions & 0 deletions test/dt-header/wrong/types/default-project/index.d.ts.lint
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/janedoe>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped