For instance:
/**
* A boolean value.
* @typedef {boolean} BoolType
*
* Another dummy type definition.
* @typedef {(number|string)} SomeType
*/
/**
* Set the boolean flag.
* @param {BoolType} flag - The bool flag value.
*/
function setFlag(flag) {
}
In this code snippet, we have defined BoolType
for boolean values, but the SomeType
type is not used anywhere in our project. I am interested in identifying and removing such unused type definitions systematically. Our project is based on Node.js with TypeScript integration.
Below is our configuration file named tsconfig.json
:
{
"compilerOptions": {
"baseUrl": ".",
"jsx": "react",
"allowJs": true,
"checkJs": true,
"target": "ESNext",
"noEmit": true,
"moduleResolution": "node",
"isolatedModules": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"strictNullChecks": true,
},
}