Skip to content

Conversation

@fisker
Copy link
Member

@fisker fisker commented Jan 16, 2020

Part of #7339

@fisker fisker mentioned this pull request Jan 16, 2020
44 tasks
function mergeOverrides(configResult, filePath) {
const options = Object.assign({}, configResult.config);
if (filePath && options.overrides) {
const { overrides, ...options } = { ...configResult.config };
Copy link
Member Author

Choose a reason for hiding this comment

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

Notice: little refactor here.

@fisker fisker changed the title Fix prefer-object-spread in /src/config Fix prefer-object-spread in src/config Jan 16, 2020
);
const merged = {
...editorConfigured,
...mergeOverrides({ ...result }, filePath)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
...mergeOverrides({ ...result }, filePath)
...mergeOverrides(result, filePath)

mergeOverrides doesn't modify this argument.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Co-authored-by: thorn0
@fisker fisker force-pushed the style/prefer-object-spread-config branch from ca81364 to 998985b Compare January 19, 2020 02:20
);
for (const override of options.overrides) {
const { config } = configResult || {};
const { overrides, filepath: configPath, ...options } = config || {};
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed, thanks.

@fisker fisker force-pushed the style/prefer-object-spread-config branch from 998985b to be11403 Compare January 19, 2020 02:27
@thorn0 thorn0 merged commit 00d2299 into prettier:next Jan 19, 2020
@fisker fisker deleted the style/prefer-object-spread-config branch January 19, 2020 12:22
@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Apr 18, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Apr 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants