DEV Community

j1ngzoue
j1ngzoue

Posted on

Easily validate tsconfig.json, Use the 'tsconf-checker' package

Introduce

Wouldn"t it be convenient if you could easily check the settings of tsconfig.json you are using?
Introducing tsconf-checker, a package that can solve such problems.

Usage

{
    "compilerOptions": {
        "target": "esnext",
        "module": "commonjs",
        "baseUrl": "./src",
        "resolveJsonModule": true,
        "outDir": "./dist",
        "esModuleInterop": true,
        "forceConsistentCasingInFileNames": true,
        "strict": true,
        "strictFunctionTypes": true,
        "skipLibCheck": true
    }
}
Enter fullscreen mode Exit fullscreen mode

Specify the typescript file that targets tsconfig.json you want to check and execute the following command.

npx tsconf-checker index.ts
Enter fullscreen mode Exit fullscreen mode

The result of the check is displayed.

Warning: "strictFunctionTypes" is implicitly true because "strict" option is true.
Warning: "skipLibCheck" option is officially recommended to be false.
Warning: "esModuleInterop" option is officially recommended to be false.
Warning: "forceConsistentCasingInFileNames" option is officially recommended to be false.
Enter fullscreen mode Exit fullscreen mode

This function is perfect for you who want to have fun.

Top comments (0)