Skip to content

fix(assist): resolve oxlint violations instead of suppressing rules#659

Draft
Copilot wants to merge 6 commits intomainfrom
copilot/fix-oxlint-rule-disables
Draft

fix(assist): resolve oxlint violations instead of suppressing rules#659
Copilot wants to merge 6 commits intomainfrom
copilot/fix-oxlint-rule-disables

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 6, 2026

Audit all oxlint/eslint disable comments in plugins/@sanity/assist and fix the underlying issues where possible. Removed 32 suppression comments across 20 files.

Performance & correctness

  • prefer-set-has: inlineTypes array → Set in serializeSchema.ts
  • no-accumulating-spread: Refactored reduce + spread → for/push in conditionalMembers.ts, helpers.ts, paths.ts
  • no-map-spread: Object.assign() or restructured away from spreading in .map() across 5 files

Deprecated API migrations

  • @sanity/ui theme: theme.sanity.color.base.*useTheme_v2() + theme.color.* in ConnectorPath.tsx
  • rgba: @sanity/ui@sanity/ui/theme
  • useClickOutsideuseClickOutsideEvent with ref-based API in InstructionTaskHistoryButton.tsx
  • React.FormEventSyntheticEvent/ChangeEvent (deprecated in React 19)
  • marker.item.messagemarker.message in validation components
  • throwError(new Error(...))throwError(() => new Error(...)) (RxJS factory form)

React hooks & compiler compatibility

  • react-hooks/exhaustive-deps: Added missing deps (getUserInput, addSyntheticTask, removeSyntheticTask); used refs for mount-only effects in PromptInput.tsx
  • react-hooks-js/todo: Removed unnecessary ?. after array spread; replaced try/finally with try/catch for React Compiler HIR compatibility
  • react-hooks-js/set-state-in-effect: Replaced state tracking with useRef in ImageContext.tsx

Type & lint fixes

  • no-redundant-type-constituents: ElementType | ReactNodeElementType
  • no-base-to-string: String(type.type)type.type?.name ?? 'unknown'
  • react/no-array-index-key: Content-based keys using path strings and messages
  • no-await-in-loop/await-thenable: Separated createOrReplace (sync builder) from commit (async) in batch loop

Remaining 83 suppressions

Mostly no-unsafe-type-assertion (73) — inherent to Sanity's loosely-typed schema/form APIs. The rest are intentional patterns: forced re-renders via setState in effects, usePrevious ref reads during render, dynamic hook calls from user config, and a side-effect module augmentation import.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • sanity-cdn.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/plugins/plugins/dev/test-studio/node_modules/.bin/../sanity/bin/sanity build grep modules/.bin/../@sanity/pkg-utils/bin/pkg-utils.js -report-unused-d--clean gins nfig/composer/vendor/bin/git useTheme_v2 _react-is@_868e2/home/REDACTED/work/_temp/ghcca-node/node/bin/pnpm tnet/tools/grep grep bin/�� rd node_modules/.pnpm/@sanity+ui@3.1.13_@emotion+is-prop-valid@1.4.0_react-dom@19.2.4_react@19.2.4_--service=0.27.3 de/node/bin/sh useTheme_v2 .4_react@19.2.4_-c ep grep (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
plugins-studio Ready Ready Preview, Comment Mar 6, 2026 10:26am

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 6, 2026

🦋 Changeset detected

Latest commit: 6861d2e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sanity/assist Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

…pread, no-map-spread, no-base-to-string

Co-authored-by: pedrobonamin <46196328+pedrobonamin@users.noreply.github.com>
…ted (FormEvent, marker.item, throwError)

Co-authored-by: pedrobonamin <46196328+pedrobonamin@users.noreply.github.com>
…Event), no-await-in-loop in SchemTypeTool

Co-authored-by: pedrobonamin <46196328+pedrobonamin@users.noreply.github.com>
…ontext, AssistDocumentPresence

Co-authored-by: pedrobonamin <46196328+pedrobonamin@users.noreply.github.com>
Co-authored-by: pedrobonamin <46196328+pedrobonamin@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issues instead of disabling oxlint rules fix(assist): resolve oxlint violations instead of suppressing rules Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants