Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/twelve-ideas-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sanity/pkg-utils': patch
---

Fix noCheck warning when extract.checkTypes is false
6 changes: 3 additions & 3 deletions packages/@sanity/pkg-utils/src/node/resolveBuildContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ export async function resolveBuildContext(options: {
const strictOptions = parseStrictOptions(config?.strictOptions ?? {})

if (strictOptions.noCheckTypes !== 'off' && tsconfig?.options && config?.dts !== 'rolldown') {
if (tsconfig.options.noCheck !== false && !tsconfig.options.noCheck) {
if (tsconfig.options.noCheck !== false && !tsconfig.options.noCheck && config?.extract?.checkTypes !== false) {
if (strictOptions.noCheckTypes === 'error') {
throw new Error(
'`noCheck` is not set to `true` in the tsconfig.json file used by `package.config.ts`. This makes generating dts files slower than it needs to be, as it will perform type checking on the dts files while at it.',
'`noCheck` is not set to `true` in the tsconfig.json file used by `package.config.ts`. This makes generating dts files slower than it needs to be, as it will perform type checking on the dts files while at it. You can set `noCheck: true` in tsconfig.json or set `extract: { checkTypes: false }` in package.config.ts to disable type checking.',
)
} else {
logger.warn(
'`noCheck` is not set to `true` in the tsconfig.json file used by `package.config.ts`. This makes generating dts files slower than it needs to be, as it will perform type checking on the dts files while at it.',
'`noCheck` is not set to `true` in the tsconfig.json file used by `package.config.ts`. This makes generating dts files slower than it needs to be, as it will perform type checking on the dts files while at it. You can set `noCheck: true` in tsconfig.json or set `extract: { checkTypes: false }` in package.config.ts to disable type checking.',
)
}
}
Expand Down