Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[manager-components]: Typescript strict mode is not enabled #12662

Open
1 of 3 tasks
fredericvilcot opened this issue Aug 7, 2024 · 1 comment
Open
1 of 3 tasks

[manager-components]: Typescript strict mode is not enabled #12662

fredericvilcot opened this issue Aug 7, 2024 · 1 comment
Labels
bug Something isn't working manager-components

Comments

@fredericvilcot
Copy link
Contributor

fredericvilcot commented Aug 7, 2024

On which entity, you would like to report a bug?

The whole package

Description

In the tsconfig.json file, there is no strict mode enabled, and in a lesser extent the strictNullChecks mode.
There are two main issues with that:

  • we do not type check null | undefined assertions, so that may lead to TypeErrors @runtime
  • if we want to enable the strict mode in another package / app that consumes the lib by importing the @ovhcloud/manager-components, this causes errors during the build phase by the tsc engine because the local "skipLibCheck": true has no effect on it.

I'll suggest to enable the strict mode (or at least the strictNullCheck mode) in the tsconfig.json file and to fix all related TypeErrors so that we improve global performance and limit bugs.

Steps to reproduce

  1. yarn install
  2. add "strict: true" to tsconfig.json
  3. yarn build

Browser

Firefox

Operating System

  • macOS
  • Windows
  • Linux

Additional Information

Capture d’écran 2024-08-07 à 11 01 36
Capture d’écran 2024-08-07 à 11 01 56

@fredericvilcot fredericvilcot added bug Something isn't working manager-components labels Aug 7, 2024
@aboungnaseng-ovhcloud
Copy link
Contributor

I have seen the issues with Frederic, if we want to switch strict mode option in tsconfig file of the manager component lib, we have to correct all the typescript errors in the lib.

After that, react apps that import manager component lib can switch to strict mode too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working manager-components
Projects
None yet
Development

No branches or pull requests

2 participants