Any difference between these 2 in tsconfig.json
?
"include": ["src"]
"include": ["src/**/*"]
Every example I can find uses the second version, but I'm seeing in my repo that there is no difference. Is there?
Any difference between these 2 in tsconfig.json
?
"include": ["src"]
"include": ["src/**/*"]
Every example I can find uses the second version, but I'm seeing in my repo that there is no difference. Is there?
The documentation says:
include
Specifies an array of filenames or patterns to include in the program. These filenames are resolved relative to the directory containing the tsconfig.json file.
Source: https://www.typescriptlang.org/tsconfig#include
So, according to the docs it is an array of files and not files or directories.
Even if it also works for directories because of some undocumented way of using that value by the compiler (which I am not even sure it does, see the comments to you question) I would not use just the directory name to save five characters, because if you are using an undocumented functionality then you always risk that some new version will go out that removes this undocumented functionality, technically not even being a breaking change.
In other words, the shorter version may work, but if it is not compatible with the official documentation then it should not be relied upon in the long term.