framework icon indicating copy to clipboard operation
framework copied to clipboard

chore: enable ts strict for packages/nuxt

Open antfu opened this issue 3 years ago • 1 comments

🔗 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.json to 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 level strict: true
  • wrapInRef is 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 AsyncData does not indicate the data could possibly be null, this PR also catches that.

📝 Checklist

  • [ ] I have linked an issue or discussion.
  • [ ] I have updated the documentation accordingly.

antfu avatar Aug 04 '22 16:08 antfu

Deploy Preview for nuxt3-docs canceled.

Name Link
Latest commit 2a045109538a245e3488568a1efc785ec9970e6a
Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/62f68fe0e4bdba0009e1f9a5

netlify[bot] avatar Aug 04 '22 16:08 netlify[bot]

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 avatar Aug 12 '22 17:08 pi0

@pi0 Published [email protected] support required options

antfu avatar Aug 15 '22 03:08 antfu