oclif / core

Node.js Open CLI Framework. Built by Salesforce.

Home Page:https://oclif.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build failure with `exactOptionalPropertyTypes` enabled

jhasuraj01 opened this issue · comments

Is your feature request related to a problem? Please describe.

Building the project using this library fails when exactOptionalPropertyTypes is enabled in project's tsconfig.json unless skipLibCheck is also set to true. skipLibCheck bypasses type checking for third-party libraries, compromising type safety.

Describe the solution you'd like

  • Add the exactOptionalPropertyTypes property to oclif/core's tsconfig.json.
  • Make any necessary code changes to ensure successful build with this option enabled.

Example rc/config/plugin.ts#L85:

From To
{ 
    parent: Plugin | undefined;    
}
{
    parent?: Plugin;
}

Additional context

  • This change will improve type safety, leading to fewer potential runtime errors.
  • It demonstrates adherence to best practices for TypeScript projects.

I would be happy to come up with a PR or collaborate on a potential solution.

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

This is still something I'm interested in

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

Just like last month, this still is something I'd like to see. @mdonnalley you marked this as unlikely, while the creator of the issue mentioned that they are willing to come up with a PR. What's holding us back?

@WikiRik Sorry, I forgot to update the labels on this. We're planning on addressing this in the next major