fix: miscellaneous minor SonarCloud issues (S7755, S4325, S3863, S7748, S7778)#448
Merged
fix: miscellaneous minor SonarCloud issues (S7755, S4325, S3863, S7748, S7778)#448
Conversation
S7755: prefer .at() over bracket index (9 fixes) S4325: remove unnecessary type assertions (7 fixes) S3863: merge duplicate imports (6 fixes) S7748: remove zero fractions (6 fixes) S7778: combine consecutive push calls (5 fixes) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Readable.push() does not accept multiple arguments like Array.push(). The null signals end-of-stream and must be a separate call. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Resolve 33 minor SonarCloud issues across 5 linting rules:
.at()over bracket index (9 fixes)Changes
S7755: Use
.at()for negative indexingsrc/core/indexing.ts: ReplaceheadingStack[headingStack.length - 1]withheadingStack.at(-1)S4325: Remove unnecessary type assertions
src/core/url-fetcher.ts: Remove explicitReadableStreamDefaultReader<Uint8Array> | undefinedcastsrc/web/server.ts: Remove non-null assertion fromserver!tests/unit/watcher.test.ts: Replaceas ReturnType<typeof vi.fn>with propervi.mocked()callstests/unit/reindex.test.ts: Removeas EmbeddingProvider["embedBatch"]andas ReturnType<typeof vi.fn>S3863: Consolidate duplicate imports
tests/unit/batch-search.test.ts: Merge two imports fromfixtures/helpers.jssrc/cli/index.ts: Consolidate imports fromconnectors/index.jstests/unit/obsidian.test.ts: Merge imports fromconnectors/obsidian.jsS7748: Remove zero fractions
src/core/search.ts:1.0→1,0.0→0src/core/tags.ts:2.0→2,1.0→1src/core/dedup.ts:1.0→1tests/unit/dedup.test.ts:1.0→1S7778: Combine consecutive push calls
src/core/search.ts: Combine three pairs ofparams.push()callssrc/core/parsers/csv.ts: Combine twolines.push()callstests/unit/api.test.ts: Combinereq.push()callsTest Results
All tests pass (1324 passed, 27 pre-existing timeouts in api.test.ts). Code quality checks passing: format, lint, and typecheck all green.
Closes #443