0.3.4 • Published 2 years ago

refactorer v0.3.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Refactorer

Basic code refactors with the help of ChatGPT

To use:

  1. Create a OPENAI_KEY in your .env file
  2. Create a config file, called refactorer.js in your project root.

The content of the file should look something like this:

module.exports = {
  globPatterns: ['./components/**/*.tsx', './pages/**/*.tsx', './lib/**/*.ts'],
  refactorReasons: [
    "'import useTranslation from 'next-translate/useTranslation'",
  ],
  instructions: [
    "Remove `import useTranslation from 'next-translate/useTranslation';` if it exists",
    'Remove `const { t } = useTranslation();` if it exists',
    'Add `t: (key: string) => string` to the props of the component',
    'Add `t` to the destructured props of the component',
  ],
};

then just run:

npx refactorer [command]

refactor

Starts the refactoring

0.3.4

2 years ago

0.3.3

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago