asgardeo / asgardeo/javascript

chore: add TypeScript `Strict Mode` Support for the packages

オープン
#142 コメント 17 件 リアクション 0 件 担当者 0 名 GitHub で見る
@asgardeo/browser @asgardeo/javascript @asgardeo/nextjs @asgardeo/node @asgardeo/react Complexity/Medium Type/Improvement typings
主要言語
TypeScript
スター
18
フォーク
67
平均マージ
4時間 6分
マージ済み PR(30日)
13

説明

### 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` or `undefined` 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:
> 1. @asgardeo/javascript
> 2. @asgardeo/browser
> 3. @asgardeo/react
> 4. @asgardeo/node
> 5. @asgardeo/nextjs

1. **Enable strict mode in tsconfig.json files**
- Add `"strict": true` to all package-level `tsconfig.json` files
- Ensure consistent strict mode configuration across the monorepo

2. **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

3. **Update build process**
- Ensure CI/CD pipeline fails on strict mode violations
- Update lint rules to complement strict mode checks

4. **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

- [x] I have searched the existing issues and this is not a duplicate.
- [x] I have provided all the necessary information.
- [x] I have verified the improvement is not available in the latest version of the package.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

@asgardeo/javascript のパッケージレベルの tsconfig.json から始め、次に記載されたパッケージ順に従って、影響を受ける *.ts および *.tsx ファイルを調査します。strict モードを有効にし、それによって発生する型の問題を解決し、CI とコントリビューションに関するドキュメントを更新して、すべてのパッケージが strict チェックに合格することを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
typescript
領域
build-system, ci-cd, developer-experience, tooling
issue の種類
リファクタリング
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。