Skip to content

chore: resolve oxlint warnings across web and SDK#34540

Merged
asukaminato0721 merged 2 commits intolanggenius:mainfrom
agenthaulk:fix/issue-25189-oxlint-warnings
Apr 21, 2026
Merged

chore: resolve oxlint warnings across web and SDK#34540
asukaminato0721 merged 2 commits intolanggenius:mainfrom
agenthaulk:fix/issue-25189-oxlint-warnings

Conversation

@agenthaulk
Copy link
Copy Markdown
Contributor

Summary

Fixes #25189

Resolves all npx oxlint warnings by addressing the following patterns across 16 files:

  • Redundant nullish coalescing in spread...(foo ?? {})...foo (spread of undefined is a no-op)
  • Unnecessary backslash escapes — removed \" inside single-quoted strings where " is valid
  • Unused destructured parameter — renamed testCode_testCode to satisfy no-unused-vars
  • Ternary used as statement — converted to if/else in embed.js
  • Regex where .endsWith() suffices — simpler and more readable
  • Unsafe optional chaining — added ?? {} fallback where .at(-1)?.[2] could be undefined before destructuring

Verification

  • npx oxlint — 0 warnings, 0 errors on all 16 files
  • SDK unit tests — 104/104 passed
  • ESLint + TypeScript type-check via pre-commit hooks — clean

Files Changed

sdks/nodejs-client/ (3 files), web/app/components/ (7 files), web/context/ (1 file), web/public/ (1 file), web/scripts/ (3 files), web/app/components/workflow/ (1 file)

Note: No functional behavior changed. All modifications are lint-level cleanups with no runtime impact.

@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Apr 3, 2026
@github-actions github-actions Bot added the web This relates to changes on the web. label Apr 3, 2026
@dosubot dosubot Bot added the javascript Pull requests that update javascript code label Apr 3, 2026
…sed vars, and unnecessary escapes

Fixes langgenius#25189

Changes:
- Remove redundant `?? {}` / `|| {}` in spread operators (spread undefined is safe)
- Remove unnecessary backslash escapes in single-quoted strings
- Rename unused parameter `testCode` → `_testCode`
- Convert ternary statement to if/else in embed.js
- Replace regex with `.endsWith()` for simpler string matching
- Add safe optional chaining in test file

16 files changed, 30 insertions, 28 deletions
@agenthaulk agenthaulk force-pushed the fix/issue-25189-oxlint-warnings branch from 62f8305 to 3402e7d Compare April 3, 2026 17:20
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Apr 21, 2026
@github-actions github-actions Bot removed the web This relates to changes on the web. label Apr 21, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Apr 21, 2026
@asukaminato0721 asukaminato0721 added this pull request to the merge queue Apr 21, 2026
Merged via the queue into langgenius:main with commit dc83e8a Apr 21, 2026
23 checks passed
HanqingZ pushed a commit to HanqingZ/dify that referenced this pull request Apr 23, 2026
Co-authored-by: Asuka Minato <i@asukaminato.eu.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update javascript code lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Chore/Refactor] fix warnings by npx oxlint

2 participants