Skip to content

Fix prefer-object-spread in src/config#7354

Merged
thorn0 merged 4 commits intoprettier:nextfrom
fisker:style/prefer-object-spread-config
Jan 19, 2020
Merged

Fix prefer-object-spread in src/config#7354
thorn0 merged 4 commits intoprettier:nextfrom
fisker:style/prefer-object-spread-config

Conversation

@fisker
Copy link
Copy Markdown
Member

@fisker fisker commented Jan 16, 2020

Part of #7339

@fisker fisker mentioned this pull request Jan 16, 2020
44 tasks
Comment thread 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 };
Copy link
Copy Markdown
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
Comment thread src/config/resolve-config.js Outdated
);
const merged = {
...editorConfigured,
...mergeOverrides({ ...result }, filePath)
Copy link
Copy Markdown
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
Copy Markdown
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
Comment thread src/config/resolve-config.js Outdated
);
for (const override of options.overrides) {
const { config } = configResult || {};
const { overrides, filepath: configPath, ...options } = config || {};
Copy link
Copy Markdown
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
Copy Markdown
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