You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
Rule file-header is not working. Even if particular header in a file like Copyright \d{4} didn't add in the file or any wrong text adds, No Lint errors are getting.
TSLint version: ~5.3.2
TypeScript version: ~2.3.3
Running TSLint via: angular CLI
TypeScript code being linted
"file-header": [true,"Copyright \\d{4}"]
with tslint.json configuration: tried in 2 different ways
I think this is due to #2525 which used to check if the given text was present in the entire file text range, but now only checks the first comment in the file.
For example, the header in the file may look like this...
// **********************************
// Copyright 2017 Company
// **********************************
And the first comment it parses is // **********************************, which does not match the regular expression that expects a multiline header.
However, the following works though, because a multi-line comment is just one comment:
/***********************************
* Copyright 2017 Company
***********************************/
Sounds like the rule could be given an option to consider consecutive // comments as one long file header. We can take that as a PR; modifying issue title to make this more discoverable.
Rule file-header is not working. Even if particular header in a file like Copyright \d{4} didn't add in the file or any wrong text adds, No Lint errors are getting.
TypeScript code being linted
with
tslint.json
configuration: tried in 2 different waysActual behavior
TS lint is not validating wheather the header text is present or not present
Expected behavior
TSLint is failing to validate the file header text
The text was updated successfully, but these errors were encountered: