Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 15, 2025

oxlint 1.33.0 introduces the no-map-spread rule, which flags object spreading in map callbacks as inefficient.

Changes

  • Replace ({_path, ...exp}) with Object.assign({}, exp, {_path}) in:
    • resolveBuildTasks.ts
    • resolveWatchTasks.ts
// Before
const exports = Object.entries(ctx.exports || {}).map(
  ([_path, exp]) => ({_path, ...exp}) as PkgExport & {_path: string},
)

// After
const exports = Object.entries(ctx.exports || {}).map(
  ([_path, exp]) => Object.assign({}, exp, {_path}) as PkgExport & {_path: string},
)

The implementation uses Object.assign({}, exp, {_path}) to:

  • Satisfy the oxlint no-map-spread rule by using Object.assign instead of spread
  • Create a new object without mutating the original exp objects from ctx.exports
  • Ensure _path is correctly added to the result

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@changeset-bot
Copy link

changeset-bot bot commented Dec 15, 2025

⚠️ No Changeset found

Latest commit: 50278bc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copilot AI changed the title [WIP] Update oxlint dependency to version 1.33.0 fix: replace object spread with Object.assign in map calls Dec 15, 2025
Copilot AI requested a review from stipsan December 15, 2025 13:22

const exports = Object.entries(ctx.exports || {}).map(
([_path, exp]) => ({_path, ...exp}) as PkgExport & {_path: string},
([_path, exp]) => Object.assign({_path}, exp) as PkgExport & {_path: string},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Isn't it better to do Object.assign(exp, {_path})?

Suggested change
([_path, exp]) => Object.assign({_path}, exp) as PkgExport & {_path: string},
([_path, exp]) => Object.assign(exp, {_path}) as PkgExport & {_path: string},

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I initially used Object.assign(exp, {_path}) as you suggested, but the code review tool flagged a potential issue: mutating the original exp objects from ctx.exports could cause side effects since those objects are also used in check.ts.

Instead, I used Object.assign({}, exp, {_path}) which:

  • Satisfies the oxlint rule by using Object.assign
  • Creates a new object (avoiding mutation)
  • Ensures _path is correctly added

See commit b8514b8.


const exports = Object.entries(ctx.exports || {}).map(
([_path, exp]) => ({_path, ...exp}) as PkgExport & {_path: string},
([_path, exp]) => Object.assign({_path}, exp) as PkgExport & {_path: string},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Isn't it better to do Object.assign(exp, {_path})?

Suggested change
([_path, exp]) => Object.assign({_path}, exp) as PkgExport & {_path: string},
([_path, exp]) => Object.assign(exp, {_path}) as PkgExport & {_path: string},

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I initially used Object.assign(exp, {_path}) as you suggested, but the code review tool flagged a potential issue: mutating the original exp objects from ctx.exports could cause side effects since those objects are also used in check.ts.

Instead, I used Object.assign({}, exp, {_path}) which:

  • Satisfies the oxlint rule by using Object.assign
  • Creates a new object (avoiding mutation)
  • Ensures _path is correctly added

See commit b8514b8.

Copilot AI requested a review from stipsan December 15, 2025 13:36
@stipsan stipsan marked this pull request as ready for review December 15, 2025 14:19
@stipsan stipsan changed the base branch from renovate/oxlint-monorepo to main December 15, 2025 14:19
@socket-security
Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​oxlint@​1.32.0 ⏵ 1.33.0931008996 +1100

View full report

@stipsan stipsan merged commit 73022b3 into main Dec 15, 2025
8 checks passed
@stipsan stipsan deleted the copilot/sub-pr-2400 branch December 15, 2025 15:56
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