@hint/hint-typescript-config
Version:
hint that that checks if the TypeScript configuration is valid.
67 lines (49 loc) • 1.4 kB
Markdown
is enabled in your TypeScript configuration file (i.e. `tsconfig.json`).
**Note:** This hint is no longer enabled by default. Removing comments as
part of a separate minification step is recommended instead. See
[this webhint issue][no-comments issue] for more details.
## Why is this important?
Removing the comments will make your final JavaScript files smaller. If you
are delivering these files over the Internet, you want them to be a small as
possible.
## What does the hint check?
This hint checks if the `compilerOptions` property `removeComments` is enabled.
### Examples that **trigger** the hint
By default, TypeScript doesn't strip the comments:
```json
{
...
"compilerOptions": {
"target": "es5",
},
...
}
```
Also setting the value to `false` will fail:
```json
{
...
"compilerOptions": {
"removeComments": false,
...
},
...
}
```
`removeComments` value is `true`:
```json
{
"compilerOptions": {
"removeComments": true,
...
},
...
}
```
* [TypeScript Documentation][typescript docs]
[ ]: https://www.typescriptlang.org/docs/home.html
[ ]: https://github.com/webhintio/hint/issues/4839
`typescript-config/no-comments` checks that the property `removeComments`