1.0.3 • Published 4 years ago
refactored v1.0.3
refactored
┌─────────┬────────────────────────────┬──────────┬──────────────────────────┐
│ (index) │ name │ progress │ visualized │
├─────────┼────────────────────────────┼──────────┼──────────────────────────┤
│ 0 │ 'Introduce Shebang' │ '2/10' │ '[|||| ]' │
│ 1 │ 'Remove import statements' │ '9/10' │ '[|||||||||||||||||| ]' │
└─────────┴────────────────────────────┴──────────┴──────────────────────────┘refactored is a utility that shows how many tasks are done while you are on a huge refactoring.
Install
$ npm install -g refactoredUsage
Move into your working directory and run:
$ refactoredor specify the project directory:
$ refactored --prefix ./my-projectYou can obtain a whole file path list of those refactored, and those not:
$ refactored --verboseUsage without installation
You can run it using npx command without installation.
$ npx refactoredConfigurations
refactored requires a configuration file named .refactoredrc placed in the working directory.
Here's a full example of .refactoredrc:
{
"tasks": [
{
"name": "Remove import statements",
"filePatterns": [
"**/*"
],
"ignorePatterns": [
"node_modules",
".git",
".idea",
"package-lock.json"
],
"test": {
"file-not-includes": "import"
}
}
]
}For more info, I've brought you a JSON schema for the .refactoredrc.
Test expressions
refactored currently supports two operators(rules):
file-includes: file should contain given string.file-not-includes: file should not contain given string.