core icon indicating copy to clipboard operation
core copied to clipboard

Build failure with `exactOptionalPropertyTypes` enabled

Open jhasuraj01 opened this issue 2 years ago • 5 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.

jhasuraj01 avatar Feb 17 '24 20:02 jhasuraj01

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.

github-actions[bot] avatar Apr 05 '24 02:04 github-actions[bot]

This is still something I'm interested in

WikiRik avatar Apr 05 '24 06:04 WikiRik

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.

github-actions[bot] avatar May 06 '24 02:05 github-actions[bot]

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 avatar May 06 '24 05:05 WikiRik

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

mdonnalley avatar May 06 '24 14:05 mdonnalley