framework
framework copied to clipboard
chore: enable ts strict for packages/nuxt
🔗 Linked issue
❓ Type of change
- [ ] 📖 Documentation (updates to the documentation or readme)
- [ ] 🐞 Bug fix (a non-breaking change that fixes an issue)
- [x] 👌 Enhancement (improving an existing functionality like performance)
- [ ] ✨ New feature (a non-breaking change that adds functionality)
- [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to change)
📚 Description
The first step migrating the entire repo to strict: true
- Added temporary
tsconfig.jsonto mark the scope of strict - later after we migrate all modules to strict, we could then remove all the sub tsconfig and turn the root levelstrict: true wrapInRefis redundant - ref already does that: https://github.com/vuejs/core/blob/4d7803ed28fb67d45a83d3500f5407754e65bf64/packages/reactivity/src/ref.ts#L90-L95- Not only would the strictness help us internally, but also for the generated types consumed by users. Previously the return type of
AsyncDatadoes not indicate the data could possibly benull, this PR also catches that.
📝 Checklist
- [ ] I have linked an issue or discussion.
- [ ] I have updated the documentation accordingly.
Deploy Preview for nuxt3-docs canceled.
| Name | Link |
|---|---|
| Latest commit | 2a045109538a245e3488568a1efc785ec9970e6a |
| Latest deploy log | https://app.netlify.com/sites/nuxt3-docs/deploys/62f68fe0e4bdba0009e1f9a5 |
This is a nice initiative 🚀 Merging to avoid stalling PR. There has been some leftovers also in packages/nuxt which we can improve type coverage and fix errors.
I've triple checked but there might be regressions with changes. /cc @danielroe heads up
@antfu Can we please allow unplugin define to make input options mandatory? It can help to properly type them. 🙏🏼
@pi0 Published [email protected] support required options