-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Fix prefer-object-spread in src/config
#7354
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
Fix prefer-object-spread in src/config
#7354
Conversation
src/config/resolve-config.js
Outdated
| function mergeOverrides(configResult, filePath) { | ||
| const options = Object.assign({}, configResult.config); | ||
| if (filePath && options.overrides) { | ||
| const { overrides, ...options } = { ...configResult.config }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notice: little refactor here.
prefer-object-spread in /src/configprefer-object-spread in src/config
src/config/resolve-config.js
Outdated
| ); | ||
| const merged = { | ||
| ...editorConfigured, | ||
| ...mergeOverrides({ ...result }, filePath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ...mergeOverrides({ ...result }, filePath) | |
| ...mergeOverrides(result, filePath) |
mergeOverrides doesn't modify this argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
ca81364 to
998985b
Compare
src/config/resolve-config.js
Outdated
| ); | ||
| for (const override of options.overrides) { | ||
| const { config } = configResult || {}; | ||
| const { overrides, filepath: configPath, ...options } = config || {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was configResult.filepath, not configResult.config.filepath.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, thanks.
998985b to
be11403
Compare
Part of #7339