File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change 1- 'use strict ';
1+ import { types , operator } from 'putout ';
22
3- const { types, operator} = require ( 'putout' ) ;
43const {
54 objectExpression,
65 isLabeledStatement,
98
109const { replaceWith} = operator ;
1110
12- module . exports . report = ( ) => `Convert 'label' to 'object'` ;
11+ export const report = ( ) => `Convert 'label' to 'object'` ;
1312
14- module . exports . match = ( ) => ( {
13+ export const match = ( ) => ( {
1514 '(__args) => __body' : ( { __body} ) => {
1615 if ( ! __body . body . length )
1716 return false ;
@@ -25,7 +24,7 @@ module.exports.match = () => ({
2524 } ,
2625} ) ;
2726
28- module . exports . replace = ( ) => ( {
27+ export const replace = ( ) => ( {
2928 '(__args) => __body' : ( { __body} , path ) => {
3029 const properties = [ ] ;
3130
Original file line number Diff line number Diff line change 1- 'use strict' ;
1+ import { createTest } from '@putout/test' ;
2+ import * as plugin from './index.js' ;
23
3- const { createTest} = require ( '@putout/test' ) ;
4- const plugin = require ( '.' ) ;
5-
6- const test = createTest ( __dirname , {
4+ const test = createTest ( import . meta. url , {
75 plugins : [
86 [ 'convert-to-object' , plugin ] ,
97 ] ,
Original file line number Diff line number Diff line change 1- 'use strict' ;
1+ import * as convertToObject from './convert-to-object/index.js' ;
2+ import * as removeUnused from './remove-unused/index.js' ;
23
3- const convertToObject = require ( './convert-to-object' ) ;
4- const removeUnused = require ( './remove-unused' ) ;
5-
6- module . exports . rules = {
4+ export const rules = {
75 'convert-to-object' : convertToObject ,
86 'remove-unused' : removeUnused ,
97} ;
Original file line number Diff line number Diff line change 1- 'use strict ';
1+ import { operator , types } from 'putout ';
22
3- const { operator, types} = require ( 'putout' ) ;
43const { isReturnStatement} = types ;
5- const { traverse , replaceWith} = operator ;
4+ const { replaceWith} = operator ;
65
7- module . exports . report = ( { name} ) => `Label '${ name } ' is defined but never used` ;
6+ export const report = ( { name} ) => `Label '${ name } ' is defined but never used` ;
87
9- module . exports . fix = ( { path} ) => {
8+ export const fix = ( { path} ) => {
109 replaceWith ( path , path . node . body ) ;
1110} ;
1211
13- module . exports . traverse = ( { push} ) => ( {
12+ export const traverse = ( { push} ) => ( {
1413 LabeledStatement ( path ) {
1514 const { label} = path . node ;
1615 const { name} = label ;
@@ -42,7 +41,7 @@ function usedLabel({path, name}) {
4241 currentPath . stop ( ) ;
4342 } ;
4443
45- traverse ( path , {
44+ path . traverse ( {
4645 ContinueStatement : checkLabel ,
4746 BreakStatement : checkLabel ,
4847 } ) ;
Original file line number Diff line number Diff line change 1- 'use strict' ;
1+ import { createTest } from '@putout/test' ;
2+ import * as plugin from './index.js' ;
23
3- const { createTest} = require ( '@putout/test' ) ;
4- const plugin = require ( '.' ) ;
5-
6- const test = createTest ( __dirname , {
4+ const test = createTest ( import . meta. url , {
75 plugins : [
86 [ 'remove-unused' , plugin ] ,
97 ] ,
Original file line number Diff line number Diff line change 11{
22 "name" : " @putout/plugin-labels" ,
33 "version" : " 1.0.0" ,
4- "type" : " commonjs " ,
4+ "type" : " module " ,
55 "author" : " coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)" ,
66 "description" : " 🐊Putout plugin helps with labels" ,
77 "homepage" : " https://github.com/coderaiser/putout/tree/master/packages/plugin-labels#readme" ,
3434 " commonjs"
3535 ],
3636 "devDependencies" : {
37- "@putout/eslint-flat" : " ^3.0.0" ,
3837 "@putout/test" : " ^13.0.0" ,
3938 "c8" : " ^10.0.0" ,
4039 "eslint" : " ^9.0.0" ,
4443 "nodemon" : " ^3.0.1"
4544 },
4645 "peerDependencies" : {
47- "putout" : " >=37 "
46+ "putout" : " >=40 "
4847 },
4948 "license" : " MIT" ,
5049 "engines" : {
51- "node" : " >=18 "
50+ "node" : " >=20 "
5251 },
5352 "publishConfig" : {
5453 "access" : " public"
Original file line number Diff line number Diff line change 1- 'use strict' ;
1+ import { createTest } from '@putout/test' ;
2+ import * as labels from '../lib/index.js' ;
23
3- const { createTest} = require ( '@putout/test' ) ;
4- const labels = require ( '..' ) ;
5-
6- const test = createTest ( __dirname , {
4+ const test = createTest ( import . meta. url , {
75 plugins : [
86 [ 'labels' , labels ] ,
97 ] ,
You can’t perform that action at this time.
0 commit comments