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

Enable strictNullChecks in API tsconfig.json #514

Open
marrouchi opened this issue Jan 3, 2025 · 0 comments · Fixed by #493 or #510
Open

Enable strictNullChecks in API tsconfig.json #514

marrouchi opened this issue Jan 3, 2025 · 0 comments · Fixed by #493 or #510
Assignees

Comments

@marrouchi
Copy link
Contributor

marrouchi commented Jan 3, 2025

Currently, the strictNullChecks flag in the tsconfig.json file for the API is not enabled. This means that null and undefined are treated as assignable to other types, which can potentially lead to bugs that are only caught at runtime.

By enabling strictNullChecks: true, we can enforce more robust type safety in the codebase by explicitly handling null and undefined cases. This will improve code quality, reduce runtime errors, and align with TypeScript best practices.


Acceptance Criteria:

  1. Update the tsconfig.json file to enable the strictNullChecks flag:
    {
        "compilerOptions": {
            "strictNullChecks": true
        }
    }
  2. Ensure all TypeScript files in the API codebase comply with this new setting by updating types and adding null/undefined handling where required.
  3. Verify that the application compiles successfully with no TypeScript errors.
  4. Run all tests to confirm no functionality is broken after enabling this setting.

Modules

WebSocket

Analytics

bot-stats

Settings

i18n


CMS

  • ContentType
  • Content
  • Menu

Chat

  • Category
  • Label
  • ContextVar
  • Block
  • Message
  • Conversation
  • Bot
  • Subscriber

Attachment


Channels

  • base-web-channel
  • slack
  • messenger
  • whatsapp

Plugins

  • pluginService/helper
  • nlp/nlu
  • external repos

Utils

  • Generics
  • utils

User Module

  • auth
  • permission
  • role
  • invitation
  • model
  • password

Generic

  • base-controller
  • base-seeder

Errors

  • "does not exist on type 'unknown'" (14 occurrences)
This was linked to pull requests Jan 3, 2025
@marrouchi marrouchi reopened this Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants