Warning
This tool is not intended for public consumption, so we may break the API whenever convenient for us.
To get started with dtslint
, follow these steps to set up your development environment:
Begin by creating a folder named dtslint
. This folder will be the home for your TypeScript declaration files (.d.ts
) and configuration.
Inside the dtslint
folder, create a tsconfig.json
file. Here's an example of what it should contain:
{
"compilerOptions": {
"skipLibCheck": true,
"noEmit": true,
"strict": true
}
}
This configuration file is essential for TypeScript to understand how to handle your declaration files during linting.
Place your TypeScript declaration files that you want to lint inside the dtslint
folder. These files will be checked for correct TypeScript typings.
Finally, update your project's package.json
file with the following scripts:
{
"scripts": {
"dtslint": "dtslint",
"dtslint-clean": "dtslint --clean"
}
}
These scripts allow you to run dtslint
and perform necessary linting checks on your TypeScript declaration files.
Flags:
--clean
: Clears all installations, ensuring a clean slate for subsequent operations.