File tree Expand file tree Collapse file tree 13 files changed +39
-55
lines changed
convert-node-to-resolve-fallback
convert-query-loader-to-use Expand file tree Collapse file tree 13 files changed +39
-55
lines changed File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change 1- 'use strict ';
1+ import { types } from 'putout ';
22
3- const { types} = require ( 'putout' ) ;
43const { objectProperty, objectPattern} = types ;
54const COMPUTED = false ;
65const SHORTHAND = true ;
76
8- module . exports . report = ( ) => `Use 'externals({context, request}, callback){...}'` ;
7+ export const report = ( ) => `Use 'externals({context, request}, callback){...}'` ;
98
10- module . exports . match = ( ) => ( {
9+ export const match = ( ) => ( {
1110 'function externals(__args) {}' : ( { __args} ) => __args . length === 3 ,
1211} ) ;
1312
14- module . exports . replace = ( ) => ( {
13+ export const replace = ( ) => ( {
1514 'function externals(__args) {}' : ( { __args} , path ) => {
1615 const node = objectPattern ( [ ] ) ;
1716
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 [ 'webpack/apply-externals' , plugin ] ,
97 ] ,
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 arrayExpression,
65 isStringLiteral,
109
1110const { replaceWith} = operator ;
1211
13- module . exports . report = ( ) => `"use" should be used instead of exclamation mark in loaders` ;
12+ export const report = ( ) => `"use" should be used instead of exclamation mark in loaders` ;
1413
15- module . exports . fix = ( path ) => {
14+ export const fix = ( path ) => {
1615 const { node} = path ;
1716
1817 node . key . name = 'use' ;
@@ -28,7 +27,7 @@ module.exports.fix = (path) => {
2827 replaceWith ( valuePath , arrayExpression ( elements ) ) ;
2928} ;
3029
31- module . exports . traverse = ( { push} ) => ( {
30+ export const traverse = ( { push} ) => ( {
3231 ObjectExpression ( path ) {
3332 const properties = path . get ( 'properties' ) ;
3433
Original file line number Diff line number Diff line change 1- 'use strict' ;
1+ import { createTest } from '@putout/test' ;
2+ import * as convertLoaderToUse from './index.js' ;
23
3- const { createTest} = require ( '@putout/test' ) ;
4- const convertLoaderToUse = require ( '.' ) ;
5-
6- const test = createTest ( __dirname , {
4+ const test = createTest ( import . meta. url , {
75 plugins : [
86 [ 'webpack/convert-loader-to-use' , convertLoaderToUse ] ,
97 ] ,
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 identifier,
65 objectProperty,
109
1110const { replaceWith} = operator ;
1211
13- module . exports . report = ( ) => '"resolve.fallback" should be used instead of "node"' ;
12+ export const report = ( ) => '"resolve.fallback" should be used instead of "node"' ;
1413
15- module . exports . fix = ( path ) => {
14+ export const fix = ( path ) => {
1615 const valuePath = path . get ( 'value' ) ;
1716 const valueNode = valuePath . node ;
1817
@@ -27,7 +26,7 @@ module.exports.fix = (path) => {
2726 ] ) ) ;
2827} ;
2928
30- module . exports . traverse = ( { push} ) => ( {
29+ export const traverse = ( { push} ) => ( {
3130 'module.exports = __object' ( path ) {
3231 const properties = path . get ( 'right.properties' ) ;
3332
Original file line number Diff line number Diff line change 1- 'use strict' ;
1+ import { createTest } from '@putout/test' ;
2+ import * as convertNodeToResolveFallback from './index.js' ;
23
3- const { createTest} = require ( '@putout/test' ) ;
4- const convertNodeToResolveFallback = require ( '.' ) ;
5-
6- const test = createTest ( __dirname , {
4+ const test = createTest ( import . meta. url , {
75 plugins : [
86 [ 'webpack/convert-node-to-resolve-fallback' , convertNodeToResolveFallback ] ,
97 ] ,
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 identifier,
@@ -14,9 +13,9 @@ const {
1413
1514const { replaceWith} = operator ;
1615
17- module . exports . report = ( ) => `"use" should be used instead of query in loaders` ;
16+ export const report = ( ) => `"use" should be used instead of query in loaders` ;
1817
19- module . exports . fix = ( path ) => {
18+ export const fix = ( path ) => {
2019 const { node} = path ;
2120
2221 node . key . name = 'use' ;
@@ -28,7 +27,7 @@ module.exports.fix = (path) => {
2827 replaceWith ( valuePath , arrayExpression ( [ object ] ) ) ;
2928} ;
3029
31- module . exports . traverse = ( { push} ) => ( {
30+ export const traverse = ( { push} ) => ( {
3231 ObjectExpression ( path ) {
3332 const properties = path . get ( 'properties' ) ;
3433
Original file line number Diff line number Diff line change 1- 'use strict' ;
1+ import { createTest } from '@putout/test' ;
2+ import * as convertQueryLoaderToUse from './index.js' ;
23
3- const { createTest} = require ( '@putout/test' ) ;
4- const convertQueryLoaderToUse = require ( '.' ) ;
5-
6- const test = createTest ( __dirname , {
4+ const test = createTest ( import . meta. url , {
75 plugins : [
86 [ 'webpack/convert-query-loader-to-use' , convertQueryLoaderToUse ] ,
97 ] ,
You can’t perform that action at this time.
0 commit comments