-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Labels
@asgardeo/browserIssues related to the browser wrapper of the Asgardeo JavaScript SDKIssues related to the browser wrapper of the Asgardeo JavaScript SDK@asgardeo/javascriptIssues related to the core of the Asgardeo JavaScript SDKsIssues related to the core of the Asgardeo JavaScript SDKs@asgardeo/nextjsIssues related to the `Next.js` wrapper of Asgardeo JavaScript SDKIssues related to the `Next.js` wrapper of Asgardeo JavaScript SDK@asgardeo/nodeIssues related to the `Node.js` runtime wrapper of Asgardeo JavaScript SDKIssues related to the `Node.js` runtime wrapper of Asgardeo JavaScript SDK@asgardeo/reactIssues related to the `React.js` wrapper of Asgardeo JavaScript SDKIssues related to the `React.js` wrapper of Asgardeo JavaScript SDKComplexity/MediumIssues with the implementation complexity flagged as `Medium`Issues with the implementation complexity flagged as `Medium`Credits/45HacktoberfestOpen for Hacktoberfest contributors.Open for Hacktoberfest contributors.Type/ImprovementtypingsIssues related to Type definitionsIssues related to Type definitions
Description
Current Limitation
Currently, TypeScript strict mode is not consistently enabled across all packages in the monorepo. This leads to:
- Potential runtime errors that could be caught at compile time
- Implicit
any
types that reduce type safety - Missing null/undefined checks that could cause runtime issues
- Inconsistent type checking standards across different packages
- Reduced developer experience due to less precise type inference
Without strict mode enabled, the codebase may contain:
- Functions with implicit return type
any
- Variables that could be
null
orundefined
without proper checks - Less strict function parameter checking
- Weaker type checking for object property access
Suggested Improvement
Enable TypeScript strict mode across all packages and fix related type issues:
Implementation Plan
Note
Start with the following order:
- @asgardeo/javascript
- @asgardeo/browser
- @asgardeo/react
- @asgardeo/node
- @asgardeo/nextjs
-
Enable strict mode in tsconfig.json files
- Add
"strict": true
to all package-leveltsconfig.json
files - Ensure consistent strict mode configuration across the monorepo
- Add
-
Fix type errors systematically
- Address implicit
any
types by adding proper type annotations - Add null/undefined checks where needed using optional chaining and nullish coalescing
- Fix function return type annotations
- Resolve strict property initialization issues
- Address implicit
-
Update build process
- Ensure CI/CD pipeline fails on strict mode violations
- Update lint rules to complement strict mode checks
-
Documentation updates
- Update contributing guidelines to mention strict mode requirements
- Add examples of proper typing patterns
Files to be updated
packages/*/tsconfig.json
- Enable strict mode- Various
*.ts
and*.tsx
files - Fix type issues - CI configuration - Ensure strict checking in build pipeline]
Please select the package issue is related to
@asgardeo/express, @asgardeo/browser, @asgardeo/javascript, @asgardeo/nextjs, @asgardeo/node, @asgardeo/nuxt, @asgardeo/react, @asgardeo/react-router, @asgardeo/vue
Version
current
Reporter Checklist
- I have searched the existing issues and this is not a duplicate.
- I have provided all the necessary information.
- I have verified the improvement is not available in the latest version of the package.
Metadata
Metadata
Assignees
Labels
@asgardeo/browserIssues related to the browser wrapper of the Asgardeo JavaScript SDKIssues related to the browser wrapper of the Asgardeo JavaScript SDK@asgardeo/javascriptIssues related to the core of the Asgardeo JavaScript SDKsIssues related to the core of the Asgardeo JavaScript SDKs@asgardeo/nextjsIssues related to the `Next.js` wrapper of Asgardeo JavaScript SDKIssues related to the `Next.js` wrapper of Asgardeo JavaScript SDK@asgardeo/nodeIssues related to the `Node.js` runtime wrapper of Asgardeo JavaScript SDKIssues related to the `Node.js` runtime wrapper of Asgardeo JavaScript SDK@asgardeo/reactIssues related to the `React.js` wrapper of Asgardeo JavaScript SDKIssues related to the `React.js` wrapper of Asgardeo JavaScript SDKComplexity/MediumIssues with the implementation complexity flagged as `Medium`Issues with the implementation complexity flagged as `Medium`Credits/45HacktoberfestOpen for Hacktoberfest contributors.Open for Hacktoberfest contributors.Type/ImprovementtypingsIssues related to Type definitionsIssues related to Type definitions