You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Putout does something similar to eslint but with more transforms, and it's better then jscodeshift because it supports plugins, and can be used in a day-to-day basis.
Your codemod can be integrated to any project with:
npm i https://github.com/sgilroy/async-await-codemod.git
(such a long path, because you don't use main entry of package.json)
Also user can provide custom message with help of such modifications of .putout.json:
{
"jscodeshiftPlugins": [
["async-await-codemod/async-await", "async-await should be used instead of Promises"]
]
}
And then just run putout lib test or putout lib test --fix for fixing.
async-await-codemod already works good, but would be great if you publish it to npm and add main section. And will be amazing if you convert your codemod to putout plugin 😉 (it will have ability to report problem parts, and to use a rich babel infrastructure).
Anyways even without converting your codemod already can be used with putout in more pleasant way then with jscodeshift, and here is why:
ability to use in a day-to-day basis, as an addition to lint
Here is how it looks like for such code:
functionpromise(){returnhello().then(world);}
$ putout jscodeshift.js
/home/coderaiser/putout/packages/putout/jscodeshift.js
2:0 error async-await should be used instead of Promises jscodeshift/async-await-codemod/async-await
✖ 1 errors in 1 files
fixable with the `--fix` option
Hi, thank you, for such a useful codemod :).
I just added support of jscodeshift to a
pluggable code transformer
putout, and used yourcodemod
for tests.Putout
does something similar toeslint
but with more transforms, and it's better thenjscodeshift
because it supports plugins, and can be used in a day-to-day basis.Your
codemod
can be integrated to any project with:And updating
.putout.json
with:(such a long path, because you don't use
main
entry ofpackage.json
)Also user can provide custom message with help of such modifications of
.putout.json
:And then just run
putout lib test
orputout lib test --fix
for fixing.async-await-codemod
already works good, but would be great if you publish it tonpm
and addmain
section. And will be amazing if you convert yourcodemod
to putout plugin 😉 (it will have ability to report problem parts, and to use a rich babel infrastructure).Anyways even without converting your
codemod
already can be used withputout
in more pleasant way then withjscodeshift
, and here is why:IDE
that haseslint
extensionsHere is how it looks like for such code:
By the way,
async-await-codemod
is in the list of recommendedjscodeshift
codemods that is recommended to be used withputout
🙂.The text was updated successfully, but these errors were encountered: