@sanity/tsconfig
v2.1.0
Published
Shared tsconfig.json presets following best practices at Sanity.io
Maintainers
Readme
@sanity/tsconfig
Shared tsconfig.json presets following best practices at Sanity.io
Installation
Add the package to your "devDependencies":
npm install --save-dev @sanity/tsconfig
# or
pnpm add --save-dev @sanity/tsconfig
# or
yarn add --dev @sanity/tsconfigUsage
Choose one of the presets as your base:
You can optionally combine your base with @sanity/tsconfig/isolated-declarations if you're using build tools (like rolldown or tsdown) that can generate .d.ts files significantly faster when TypeScript is constrained with "isolatedDeclarations": true.
Recommended tsconfig.json
Add to your tsconfig.json:
{
"extends": "@sanity/tsconfig/recommended"
}Strict tsconfig.json
Add to your tsconfig.json:
{
"extends": "@sanity/tsconfig/strict"
}Strictest tsconfig.json
Add to your tsconfig.json:
{
"extends": "@sanity/tsconfig/strictest"
}Isolated Declarations tsconfig.json
Extend the isolated-declarations.json preset in addition to your base.
If your tsconfig.json previously looked like this:
{
"extends": "@sanity/tsconfig/strict"
}Then change extends to an array and isolated-declarations to the end:
{
"extends": ["@sanity/tsconfig/strict", "@sanity/tsconfig/isolated-declarations"]
}