javascript icon indicating copy to clipboard operation
javascript copied to clipboard

Stricter tsconfig.json options generate tsc errors in @clerk/backend-core

Open mkitt opened this issue 3 years ago • 0 comments

  • [x] Review the documentation: https://docs.clerk.dev/
  • [x] Search for existing issues: https://github.com/clerkinc/javascript/issues
  • [x] Go through package changelog files.
  • [ ] ~Provide the Frontend API key from your application dashboard.~

Package + Version

  • [ ] @clerk/clerk-js
  • [ ] @clerk/clerk-react
  • [ ] @clerk/nextjs
  • [x] @clerk/remix
  • [ ] @clerk/clerk-expo
  • [x] @clerk/backend-core
  • [ ] @clerk/clerk-sdk-node
  • [ ] @clerk/edge
  • [ ] other:

Version:

@clerk/remix: 0.5.13
@clerk/remix: 1.1.0

Browser/OS

GitHub Actions — ubuntu-latest, macOS locally in development

Description

Following the setup instructions from the "Getting started" section in the clerkinc/remix-auth-starter repository and adding the following stricter settings to the tsconfig.json file:

    "exactOptionalPropertyTypes": true,
    "noImplicitOverride": true,
    "noPropertyAccessFromIndexSignature": true,
    "noUncheckedIndexedAccess": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "skipLibCheck": true,

Then run:

npx tsc

This will produce a number of errors originating from:

node_modules/@clerk/backend-core/

It seems like we should be able to apply these stricter options in our application's tsconfig.json without it leaking into the Clerk library to produce these errors? I haven't seen this in other libraries our application consumes with these same options applied. The only workaround I've found is to remove these options to match the standards set by the Clerk library.

The addition of skipLibCheck is the workaround from #155 which also feels like an option we also shouldn't have to supply in the tsconfig.json.

Related or Similar:

🙌 Thanks in advance and let me know if I can provide any other information.

mkitt avatar Aug 05 '22 13:08 mkitt