Skip to content

Conversation

@fisker
Copy link
Member

@fisker fisker commented Jan 11, 2020

  • I’ve added tests to confirm my change works.
  • (If changing the API or CLI) I’ve documented the changes I’ve made (in the docs/ directory)
  • (If the change is user-facing) I’ve added my changes to changelog_unreleased/*/pr-XXXX.md file following changelog_unreleased/TEMPLATE.md.
  • I’ve read the contributing guidelines.

Try the playground for this PR

delete newObject.deprecated;
delete newObject.redirect;
// eslint-disable-next-line no-unused-vars
const { deprecated, redirect, ...newObject } = Object.assign({}, object);
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought about it, but I thought this case

const {a, ...b} = c

if a and b both not used, it will not report an error.

But I'm not sure now.. not near my laptop.

Copy link
Member

Choose a reason for hiding this comment

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

BTW, Object.assign is not needed here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops, missed this one.

Copy link
Member Author

@fisker fisker Jan 11, 2020

Choose a reason for hiding this comment

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

Fixed.

Also enabled ignoreRestSiblings, works as expected

const {a, ...b} = c

If a&b not used, report b is not used.
If a used b not used, report b is not used.
If b used a not used, no error.

@fisker fisker mentioned this pull request Jan 15, 2020
4 tasks
.filter(option => filterSince(option) && filterDeprecated(option))
.map(mapDeprecated)
.map(mapInternal)
.sort((a, b) => (a.name === b.name ? 0 : a.name < b.name ? -1 : 1))
Copy link
Member Author

Choose a reason for hiding this comment

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

I changed filter and sort order, so array for sort could be smaller.

@fisker fisker mentioned this pull request Jan 16, 2020
44 tasks
@alexander-akait alexander-akait merged commit 2041a0d into prettier:next Jan 16, 2020
@fisker fisker deleted the simplify-support branch January 16, 2020 10:27
@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Apr 15, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Apr 15, 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.

4 participants