-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Conversation
βοΈ Deploy Preview for nuxt3-docs ready! π¨ Explore the source changes: 36580e3 π Inspect the deploy log: https://app.netlify.com/sites/nuxt3-docs/deploys/6192adb4bc6d3a000854fc0f π Browse the preview: https://deploy-preview-1940--nuxt3-docs.netlify.app |
|
||
/** | ||
* You can extend generated `.nuxt/tsconfig.json` using this option | ||
* @typedef {Awaited<ReturnType<typeof import('pkg-types')['readPackageJSON']>>} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/cc @danielroe This was only possible could find to type with the current version of untyped :D typeof import('pkg-types).TSConfig
apparently is not working since is a type-only export
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not type this as TSConfig
from import type { TSConfig } from 'pkg-types'
with typescript?
Then @typedef
isn't even that important anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not for internally typing. We use untyped to auto-generate docs and type definitions out of the source like this: https://unpkg.com/browse/@nuxt/kit-edge@3.0.0-27284440.b16cfea/schema/config.d.ts -- Currently untyped cannot generate import type { }
statements on top of the file.
compilerOptions: { | ||
target: 'ESNext', | ||
module: 'ESNext', | ||
moduleResolution: 'Node', | ||
skipLibCheck: true, | ||
strict: true, | ||
strict: nuxt.options.typescript.strict, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hidden fix: I tried to put it as defaults in typescript.compilerOptions
in schema but untyped had strange behavior with $resolve
. Have to check more in-depth making reproduction (this can potentially make unwanted behavior on other resolve fns)
I know it's a bit late to the party but I think the default |
While I understand your perspective, this does apply to the majority of users that use typescript. Strict mode is disabled in typescript itself for a good reason allowing users to "Adopt TypeScript Gradually" by design (https://www.typescriptlang.org/). Most of the users can get much more type-safety than js when using ts and an advanced section of users can opt-in. Also with strict mode enabled, upgrading the typescript version is more likely of having breaking changes. Disabling by default also makes Nuxt ensure DX-related futures are not hard on strict mode assumption and always work of all ts users. |
π Linked issue
β Type of change
π Description
options.typescript
strict
(default is false)tsConfig
(allow overriding generated tsconfig defaults)typeCheck
(#1818)π Checklist