Skip to content

Commit

Permalink
Removes trailing whitespace from file-header (palantir#3802)
Browse files Browse the repository at this point in the history
  • Loading branch information
cwgorman authored and suchanlee committed Apr 2, 2018
1 parent f1b0896 commit 01cf478
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/rules/fileHeaderRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ export class Rule extends Lint.Rules.AbstractRule {
"/*",
// 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}`),
// Trim trailing spaces to play nice with `no-trailing-whitespace` rule
...commentText.split(/\r?\n/g).map((line) => ` * ${line}`.replace(/\s+$/, "")),
" */",
].join(lineEnding) + lineEnding.repeat(trailingNewlines);
}
Expand Down

0 comments on commit 01cf478

Please sign in to comment.