-
Notifications
You must be signed in to change notification settings - Fork 885
[Breaking] don't exclude *.d.ts files when using --project #3314
Comments
program.getCompilerOptions().skipLibCheck === true && file.fileName.endsWith(".d.ts")
|| program.isSourceFileFromExternalLibrary(file)
? undefined
: file.fileName |
@mpal9000 I don't thing Declaration files of dependencies are excluded anyway. To exclude declaration files in your project, you can simply add |
The code above is from linter.ts -> getFileNames(). So you propose to remove the endsWith() check and use the -e cli option or do the filtering manually when using the api? That would be ok. Does a program configured with skipLibCheck provides the required type information to lint .d.ts files of a "project" (for rules that require type information)? |
The linter simply ignores the flag. It's only relevant for Be aware that those declarations might have errors without you noticing. That could confuse the linter, but it will also confuse |
Yes, I'm using skipLibCheck for incremental building. So .d.ts files of a "project" cannot be reliably linted when the compiler option is enabled. Nevertheless I agree that it would be better to allow the user control the .d.ts exclusion separately. Waiting for this change.. Thanks |
I agree with this breaking change for 6.0 |
💀 It's time! 💀TSLint is being deprecated and no longer accepting pull requests for major new changes or features. See #4534. 😱 If you'd like to see this change implemented, you have two choices:
👋 It was a pleasure open sourcing with you! If you believe this message was posted here in error, please comment so we can re-open the issue! |
Currently when using
--project
CLI option without explicitly specifying files, TSLint lints all files in the project except *.d.ts files.I guess it was implemented that way to avoid linting external dependencies from mode_modules.
Unfortunately this also excludes declaration files that are located within the project.
Starting from typescript@2.6.0 we can use an API to determine if a file comes from
node_modules
(#2827).That makes excluding *.d.ts files unnecessary. I propose we change that behavior in the next major version.
The text was updated successfully, but these errors were encountered: