-
Notifications
You must be signed in to change notification settings - Fork 27
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
Add codemod to replace object-keys
#5
Conversation
codemods/object-keys/index.js
Outdated
@@ -1,5 +1,6 @@ | |||
import jscodeshift from "jscodeshift"; | |||
import { removeImport } from "../shared.js"; | |||
import { log } from "console"; |
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.
Was this intentional? 🤔 I don't see it used anywhere, shall we remove it? 🙂
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.
I just went ahead and removed it :)
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.
Oh it definitely was not, thanks 😅
|
||
// Return the identifier name, e.g. 'fn' in `import { fn } from 'is-boolean-object'` | ||
// or `var fn = require('is-boolean-object')` | ||
const identifier = |
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.
nice 👍
LGTM! Thanks for the PR! One small comment, I think an accidental import made its way into the code. If we remove that, this is good to merge :) Nice work! |
This adds a codemod replacement for the
object-keys
module. This is my first time writing a codemod, so let me know if there's anything I can do to improve this code.I've also added some improvements to the codebase that I think will be generally useful:
removeImport
so that it will work even if the import is renamed to something than what is conventionalremoveImport