Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rule fix: no-extend: Only fix if first arg is object literal #330

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

edg2s
Copy link
Member

@edg2s edg2s commented Jun 21, 2024

If the first argument is a variable which could be null
or undefined, then Object.assign will throw.

We could convert to Object.assign( foo || {}, ... ) but in
most cases this is unnecessary, so probably better to leave
it to users to fix manually.

Copy link

codecov bot commented Jun 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (master@f3e29be). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff             @@
##             master      #330   +/-   ##
==========================================
  Coverage          ?   100.00%           
==========================================
  Files             ?       103           
  Lines             ?       608           
  Branches          ?         0           
==========================================
  Hits              ?       608           
  Misses            ?         0           
  Partials          ?         0           
Files Coverage Δ
src/rules/no-extend.js 100.00% <100.00%> (ø)

If the first argument is a variable which could be null
or undefined, then Object.assign will throw.

We could convert to `Object.assign( foo || {}, ... )` but in
most cases this is unnecessary, so probably better to leave
it to users to fix manually.
@jdforrester jdforrester merged commit 35d4489 into master Jun 24, 2024
8 checks passed
@edg2s edg2s deleted the no-extend-fix branch June 24, 2024 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants