File tree Expand file tree Collapse file tree
packages/plugin-apply-arrow Expand file tree Collapse file tree File renamed without changes.
Original file line number Diff line number Diff line change 44 "apply-arrow" : " off" ,
55 "putout/check-replace-code" : " off"
66 }
7+ },
8+ "rules" : {
9+ "apply-arrow" : " off"
710 }
8- }
11+ }
File renamed without changes.
Original file line number Diff line number Diff line change 1- 'use strict ';
1+ import { print , types } from 'putout ';
22
3- const { print, types} = require ( 'putout' ) ;
43const {
54 isFunction,
65 isProgram,
@@ -11,9 +10,9 @@ const {
1110
1211const isTopScope = ( a ) => isFunction ( a ) || isProgram ( a ) ;
1312
14- module . exports . report = ( ) => `Use 'Arrow Function' instead of 'Function Declaration` ;
13+ export const report = ( ) => `Use 'Arrow Function' instead of 'Function Declaration` ;
1514
16- module . exports . match = ( { options} ) => ( {
15+ export const match = ( { options} ) => ( {
1716 'function __a(__args) {return __b}' : ( { __a, __b} , path ) => {
1817 const { maxSize = 30 } = options ;
1918
@@ -45,7 +44,7 @@ module.exports.match = ({options}) => ({
4544 } ,
4645} ) ;
4746
48- module . exports . replace = ( ) => ( {
47+ export const replace = ( ) => ( {
4948 'function __a(__args) {return __b}' : 'const __a = (__args) => __b' ,
5049} ) ;
5150
Original file line number Diff line number Diff line change 11{
22 "name" : " @putout/plugin-apply-arrow" ,
33 "version" : " 2.0.0" ,
4- "type" : " commonjs " ,
4+ "type" : " module " ,
55 "author" : " coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)" ,
66 "description" : " 🐊Putout plugin adds ability to convert Function Declaration to Arrow Function" ,
77 "homepage" : " https://github.com/coderaiser/putout/tree/master/packages/plugin-apply-arrow#readme" ,
4141 "nodemon" : " ^3.0.1"
4242 },
4343 "peerDependencies" : {
44- "putout" : " >=38 "
44+ "putout" : " >=40 "
4545 },
4646 "license" : " MIT" ,
4747 "engines" : {
48- "node" : " >=18 "
48+ "node" : " >=20 "
4949 },
5050 "publishConfig" : {
5151 "access" : " public"
Original file line number Diff line number Diff line change 1- 'use strict' ;
1+ import { createTest } from '@putout/test' ;
2+ import { operator } from 'putout' ;
3+ import * as plugin from '../lib/apply-arrow.js' ;
24
3- const { createTest} = require ( '@putout/test' ) ;
4- const { operator} = require ( 'putout' ) ;
5-
6- const plugin = require ( '..' ) ;
75const {
86 compare,
97 getTemplateValues,
108} = operator ;
119
12- const test = createTest ( __dirname , {
10+ const test = createTest ( import . meta . url , {
1311 plugins : [
1412 [ 'apply-arrow' , plugin ] ,
1513 ] ,
You can’t perform that action at this time.
0 commit comments