Commit 9dce671
fix: Add ESLint rules for type safety and fix violations (#46)
* Add ESLint rules for type safety and fix violations
- Add @typescript-eslint/no-floating-promises: error
- Add @typescript-eslint/no-non-null-assertion: error
- Add @typescript-eslint/prefer-nullish-coalescing: error
- Change @typescript-eslint/no-explicit-any from off to error
Fixes:
- Fix floating promise in NotebookPicker constructor by adding .catch()
- Fix non-null assertion in NotebookPicker.onAfterAttach with null check
- Fix prefer-nullish-coalescing in handler.ts by using ?? instead of ||
- Add inline eslint-disable comments for legitimate any usage in handler.ts
* Add test for error handling in NotebookPicker constructor
Improves test coverage for the .catch() error handler added to handle
promise rejections in the constructor.
* Add comprehensive test coverage for NotebookPicker
- Add test for null model in handleChange
- Add test for invalid metadata in handleChange
- Add test for onAfterAttach without parent
- Import Message type for test
Coverage improved from 84.09% to 97.72% for NotebookPicker.tsx
* Merge test coverage from PR #45
Added comprehensive test suites for core transformation functions:
- convert-deepnote-block-to-jupyter-cell.spec.ts (13 tests)
- transform-deepnote-yaml-to-notebook-content.spec.ts (11 tests)
Overall coverage improved from 31.03% to 57.24%
Both transformation files now have 100% line coverage
* fix: remove mocks, test real implementation
* chore: format
* chore: remove out of scope tests
* chore: remove out of scope test
* refactor: fix test and format
* chore: remove out of scope test
* fix: address violations
* refactor: improve test
* refactor: TypeError
* fix: drop unnecessary property
* refactor: simplify promise
* chore: improve "dirty" test
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: dinohamzic <dino@subtlebits.com>1 parent 1fbb3d2 commit 9dce671
File tree
5 files changed
+296
-97
lines changed- src
- __tests__
- components
5 files changed
+296
-97
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | | - | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
| 164 | + | |
165 | 165 | | |
166 | 166 | | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
167 | 170 | | |
168 | 171 | | |
169 | 172 | | |
| |||
0 commit comments