sanity-io / plugin-kit

Enhanced Sanity.io plugin development experience.
MIT License
76 stars 7 forks source link

Verify TypeScript version #259

Open rexxars opened 4 months ago

rexxars commented 4 months ago

Describe the bug

If your project has an older version of typescript, some of the TS Config checks fail. For instance, checking for module: 'preserve' only works in TypeScript 5.4 and above. If you're running something below that, you'll get module: undefined. This is hard to debug, as the error message simply says:

The following fields had unexpected values: [module]
Expected to find these values:
"module": "preserve",

Please update your tsconfig.lib.json accordingly.

…even though your config does have this as the value.

To Reproduce

Steps to reproduce the behavior:

  1. Install/downgrade to TypeScript < 5.4
  2. Ensure you have module: 'preserve' in your tsconfig
  3. Run plugin-kit verify-package
  4. See error

Expected behavior

Should show error about TypeScript version not being sufficient for the suggested option.