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

feat: add object shorthand property mutator #2175

Conversation

brody4hire
Copy link

@brody4hire brody4hire commented May 4, 2020

As I said before, I have been using Stryker pretty heavily and happily in my create-react-native-module utility. I have discovered a few cases over the past year where there were object properties that were simply not needed, sometimes because of functionality removed and sometimes for other reasons. Yes I am the one to be held responsible but think it should be possible for Stryker to help find cases like this.

In short, this is a proposal to try removing shorthand object properties, for example:

  • { bar, baz: "quz" } --> { baz: "quz" }

Here are a couple of cleanup fixes that could have been discovered by using this proposal:

I made this proposal on the JavaScript mutator only, would be happy to take a look into the TypeScript version in case there is any interest. I do think it would be ideal to consider using @typescript/eslint-parser which should let us work with the TypeScript parser without having to maintain multiple implementations of the ES mutators.

TODO items updated:

  • ensure the CI build is green (yes I did check lint & test in my workarea)
  • consider looking for a more succinct name
  • consider if and how this could potentially overlap with other mutations and what we can do
  • add implementation for TypeScript mutator
  • update Stryker Handbook

P.S. I would highly recommend a squash commit merge in case this proposal is accepted.

@simondel
Copy link
Member

See #2172

@simondel simondel closed this May 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants