Skip to content

Commit 48898e4

Browse files
jamesbhobbsdevin-ai-integration[bot]dinohamzic
authored
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 ef0931b commit 48898e4

File tree

5 files changed

+296
-97
lines changed

5 files changed

+296
-97
lines changed

jest.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ const esModules = [
44
'@codemirror',
55
'@jupyter',
66
'@microsoft',
7+
'@deepnote',
78
'exenv-es6',
89
'lib0',
910
'nanoid',
1011
'vscode-ws-jsonrpc',
1112
'y-protocols',
1213
'y-websocket',
13-
'yjs'
14+
'yjs',
15+
'yaml'
1416
].join('|');
1517

1618
const baseConfig = jestJupyterLab(__dirname);

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,12 @@
161161
"args": "none"
162162
}
163163
],
164-
"@typescript-eslint/no-explicit-any": "off",
164+
"@typescript-eslint/no-explicit-any": "error",
165165
"@typescript-eslint/no-namespace": "off",
166166
"@typescript-eslint/no-use-before-define": "off",
167+
"@typescript-eslint/no-floating-promises": "error",
168+
"@typescript-eslint/no-non-null-assertion": "error",
169+
"@typescript-eslint/prefer-nullish-coalescing": "error",
167170
"@typescript-eslint/quotes": [
168171
"error",
169172
"single",

0 commit comments

Comments
 (0)