Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Used bang in file-header #3741

Merged
merged 1 commit into from
Apr 9, 2018
Merged
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
2 changes: 1 addition & 1 deletion src/rules/fileHeaderRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class Rule extends Lint.Rules.AbstractRule {
const maybeCarriageReturn = sourceFile.text[sourceFile.getLineEndOfPosition(0)] === "\r" ? "\r" : "";
const lineEnding = `${maybeCarriageReturn}\n`;
return lineEnding.repeat(leadingNewlines) + [
"/*",
"/*!",
// split on both types of line endings in case users just typed "\n" in their configs
// but are working in files with \r\n line endings
...commentText.split(/\r?\n/g).map((line) => ` * ${line}`),
Expand Down
2 changes: 1 addition & 1 deletion test/rules/file-header/bad-shebang/test.ts.fix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node

/*
/*!
* Good header 2
*/

Expand Down
2 changes: 1 addition & 1 deletion test/rules/file-header/bad-single-line/test.ts.fix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*!
* Good header 2
*/

Expand Down
2 changes: 1 addition & 1 deletion test/rules/file-header/bad-use-strict/test.ts.fix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*!
* Good header 2
*/

Expand Down
2 changes: 1 addition & 1 deletion test/rules/file-header/bad/test.ts.fix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*!
* Good header 2
*/

Expand Down