File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed
packages/plugin-nodejs/lib/convert-promisify-to-fs-promises Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change 3232 }
3333 },
3434 "rules" : {
35- "putout/apply-lowercase-to-node-builders" : " off" ,
36- "putout/declare" : " off" ,
35+ "putout/apply-lowercase-to-node-builders" : " on" ,
3736 "remove-useless-spread/object" : [" off" , {
3837 "exclude" : " module.exports.rules = __"
3938 }],
Original file line number Diff line number Diff line change 1- import {
2- types as t ,
3- operator ,
4- } from 'putout' ;
1+ import { types , operator } from 'putout' ;
2+
3+ const {
4+ objectProperty,
5+ identifier,
6+ objectPattern,
7+ } = types ;
58
69const { replaceWith, remove} = operator ;
710
@@ -17,9 +20,9 @@ export const fix = ({path, promisified}) => {
1720 const [ declarator ] = path . node . declarations ;
1821 const { name} = declarator . id ;
1922
20- props . push ( t . ObjectProperty (
21- t . Identifier ( name ) ,
22- t . Identifier ( name ) ,
23+ props . push ( objectProperty (
24+ identifier ( name ) ,
25+ identifier ( name ) ,
2326 NOT_COMPUTED ,
2427 SHORTHAND ,
2528 ) ) ;
@@ -30,7 +33,7 @@ export const fix = ({path, promisified}) => {
3033
3134 init . arguments [ 0 ] . value = 'fs/promises' ;
3235
33- replaceWith ( path . get ( 'id' ) , t . ObjectPattern ( props ) ) ;
36+ replaceWith ( path . get ( 'id' ) , objectPattern ( props ) ) ;
3437} ;
3538
3639export const find = ( ast , { push, traverse} ) => {
You can’t perform that action at this time.
0 commit comments