@putout/plugin-putout 23.16.0 → 24.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/README.md +28 -0
  2. package/lib/add-await-to-progress/index.js +4 -5
  3. package/lib/add-index-to-import/index.js +6 -10
  4. package/lib/add-path-arg-to-fix/index.js +4 -5
  5. package/lib/add-path-arg-to-visitors/index.js +4 -5
  6. package/lib/add-places-to-compare-places/index.js +2 -4
  7. package/lib/add-test-args/index.js +12 -3
  8. package/lib/add-track-file/index.js +12 -3
  9. package/lib/add-traverse-args/index.js +6 -7
  10. package/lib/apply-async-formatter/index.js +3 -4
  11. package/lib/apply-create-nested-directory/index.js +4 -5
  12. package/lib/apply-create-test/index.js +2 -4
  13. package/lib/apply-declare/index.js +2 -4
  14. package/lib/apply-exports-to-add-args/index.js +12 -0
  15. package/lib/apply-fixture-name-to-message/index.js +4 -5
  16. package/lib/apply-for-of-to-track-file/index.js +2 -4
  17. package/lib/apply-insert-after/index.js +2 -4
  18. package/lib/apply-insert-before/index.js +2 -4
  19. package/lib/apply-lowercase-to-node-builders/index.js +4 -5
  20. package/lib/apply-namespace-specifier/index.js +5 -7
  21. package/lib/apply-parens/index.js +2 -4
  22. package/lib/apply-processors-destructuring/index.js +2 -4
  23. package/lib/apply-remove/index.js +2 -4
  24. package/lib/apply-rename/index.js +2 -4
  25. package/lib/apply-report/index.js +3 -4
  26. package/lib/apply-short-processors/index.js +4 -6
  27. package/lib/apply-vars/index.js +4 -5
  28. package/lib/check-declare/index.js +5 -8
  29. package/lib/check-match/index.js +4 -6
  30. package/lib/check-replace-code/generate-code/index.js +5 -8
  31. package/lib/check-replace-code/generate-code/plugin-generate.js +4 -6
  32. package/lib/check-replace-code/index.js +7 -9
  33. package/lib/convert-add-argument-to-add-args/index.js +3 -4
  34. package/lib/convert-babel-types/index.js +4 -6
  35. package/lib/convert-destructuring-to-identifier/index.js +5 -5
  36. package/lib/convert-dirname-to-url/index.js +4 -5
  37. package/lib/convert-find-to-traverse/index.js +4 -6
  38. package/lib/convert-get-rule-to-require/index.js +9 -11
  39. package/lib/convert-include-to-traverse/index.js +4 -5
  40. package/lib/convert-match-to-function/index.js +2 -4
  41. package/lib/convert-method-to-property/index.js +5 -7
  42. package/lib/convert-node-to-path-in-get-template-values/index.js +4 -6
  43. package/lib/convert-number-to-numeric/index.js +4 -5
  44. package/lib/convert-process-to-find/index.js +4 -4
  45. package/lib/convert-progress-to-track-file/index.js +4 -6
  46. package/lib/convert-putout-test-to-create-test/index.js +5 -6
  47. package/lib/convert-replace-to-function/index.js +2 -4
  48. package/lib/convert-replace-with/index.js +6 -8
  49. package/lib/convert-replace-with-multiple/index.js +5 -7
  50. package/lib/convert-report-to-function/index.js +4 -5
  51. package/lib/convert-to-no-transform-code/index.js +4 -5
  52. package/lib/convert-traverse-to-include/index.js +5 -7
  53. package/lib/convert-traverse-to-replace/index.js +4 -5
  54. package/lib/convert-traverse-to-scan/index.js +5 -7
  55. package/lib/convert-url-to-dirname/index.js +4 -5
  56. package/lib/create-test/index.js +5 -6
  57. package/lib/declare/get-rule.js +4 -4
  58. package/lib/declare/index.js +4 -6
  59. package/lib/declare/operator/filesystem.js +1 -3
  60. package/lib/declare/operator/index.js +5 -7
  61. package/lib/declare/operator/json.js +1 -3
  62. package/lib/declare/operator/keyword.js +1 -3
  63. package/lib/declare/operator/parens.js +1 -3
  64. package/lib/declare/types.js +1179 -0
  65. package/lib/declare-path-variable/index.js +4 -5
  66. package/lib/declare-template-variables/index.js +4 -5
  67. package/lib/includer/index.js +2 -4
  68. package/lib/index.js +68 -68
  69. package/lib/move-require-on-top-level/index.js +5 -7
  70. package/lib/remove-empty-array-from-process/index.js +2 -4
  71. package/lib/remove-unused-get-properties-argument/index.js +4 -5
  72. package/lib/remove-useless-printer-option/index.js +4 -5
  73. package/lib/rename-operate-to-operator/index.js +5 -6
  74. package/lib/replace-operate-with-operator/index.js +2 -4
  75. package/lib/replace-test-message/index.js +4 -5
  76. package/lib/shorten-imports/index.js +2 -4
  77. package/lib/simplify-replace-template/index.js +5 -6
  78. package/package.json +7 -7
  79. package/lib/declare/types.json +0 -1179
@@ -1,11 +1,10 @@
1
- 'use strict';
1
+ import {operator} from 'putout';
2
2
 
3
- const {operator} = require('putout');
4
3
  const {getBindingPath} = operator;
5
4
 
6
- module.exports.report = () => `Declare 'path' variable`;
5
+ export const report = () => `Declare 'path' variable`;
7
6
 
8
- module.exports.match = () => ({
7
+ export const match = () => ({
9
8
  '(__a) => __body': (vars, path) => {
10
9
  let is = false;
11
10
 
@@ -26,6 +25,6 @@ module.exports.match = () => ({
26
25
  },
27
26
  });
28
27
 
29
- module.exports.replace = () => ({
28
+ export const replace = () => ({
30
29
  '(__a) => __body': '(__a, path) => __body',
31
30
  });
@@ -1,6 +1,5 @@
1
- 'use strict';
1
+ import {types, operator} from 'putout';
2
2
 
3
- const {types, operator} = require('putout');
4
3
  const {
5
4
  objectPattern,
6
5
  isIdentifier,
@@ -12,12 +11,12 @@ const {getBindingPath} = operator;
12
11
  const SHORTHAND = true;
13
12
  const COMPUTED = false;
14
13
 
15
- module.exports.report = ({node}) => {
14
+ export const report = ({node}) => {
16
15
  const {name} = node;
17
16
  return `Declare template variable '${name}'`;
18
17
  };
19
18
 
20
- module.exports.fix = ({path, node}) => {
19
+ export const fix = ({path, node}) => {
21
20
  const [first] = path.node.params;
22
21
  const property = objectProperty(node, node, COMPUTED, SHORTHAND);
23
22
 
@@ -29,7 +28,7 @@ module.exports.fix = ({path, node}) => {
29
28
  path.node.params[0].properties.push(property);
30
29
  };
31
30
 
32
- module.exports.traverse = ({push}) => ({
31
+ export const traverse = ({push}) => ({
33
32
  '(__a, path) => __body': process(push),
34
33
  '(__a) => __body': process(push),
35
34
  });
@@ -1,8 +1,6 @@
1
- 'use strict';
1
+ export const report = () => 'Includer functions should return array (https://git.io/Jyndl)';
2
2
 
3
- module.exports.report = () => 'Includer functions should return array (https://git.io/Jyndl)';
4
-
5
- module.exports.replace = () => ({
3
+ export const replace = () => ({
6
4
  'module.exports.include = () => "__a"': 'module.exports.include = ["__a"]',
7
5
  'module.exports.exclude = () => "__a"': 'module.exports.exclude = ["__a"]',
8
6
  'module.exports.include = __array': 'module.exports.include = () => __array',
package/lib/index.js CHANGED
@@ -1,72 +1,71 @@
1
- 'use strict';
1
+ import * as applyProcessorsDestructuring from './apply-processors-destructuring/index.js';
2
+ import * as applyAsyncFormatter from './apply-async-formatter/index.js';
3
+ import * as applyCreateTest from './apply-create-test/index.js';
4
+ import * as applyRemove from './apply-remove/index.js';
5
+ import * as applyInsertBefore from './apply-insert-before/index.js';
6
+ import * as applyInsertAfter from './apply-insert-after/index.js';
7
+ import * as applyDeclare from './apply-declare/index.js';
8
+ import * as checkDeclare from './check-declare/index.js';
9
+ import * as checkReplaceCode from './check-replace-code/index.js';
10
+ import * as checkMatch from './check-match/index.js';
11
+ import * as convertPutoutTestToCreateTest from './convert-putout-test-to-create-test/index.js';
12
+ import * as convertToNoTransformCode from './convert-to-no-transform-code/index.js';
13
+ import * as convertFindToTraverse from './convert-find-to-traverse/index.js';
14
+ import * as convertDestructuringToIdentifier from './convert-destructuring-to-identifier/index.js';
15
+ import * as convertNumberToNumeric from './convert-number-to-numeric/index.js';
16
+ import * as convertReplaceWith from './convert-replace-with/index.js';
17
+ import * as convertReplaceWithMultiple from './convert-replace-with-multiple/index.js';
18
+ import * as convertReplaceToFunction from './convert-replace-to-function/index.js';
19
+ import * as convertMatchToFunction from './convert-match-to-function/index.js';
20
+ import * as convertBabelTypes from './convert-babel-types/index.js';
21
+ import * as convertNodeToPathInGetTemplateValues from './convert-node-to-path-in-get-template-values/index.js';
22
+ import * as convertTraverseToInclude from './convert-traverse-to-include/index.js';
23
+ import * as convertTraverseToReplace from './convert-traverse-to-replace/index.js';
24
+ import * as convertTraverseToScan from './convert-traverse-to-scan/index.js';
25
+ import * as convertProcessToFind from './convert-process-to-find/index.js';
26
+ import * as convertMethodToProperty from './convert-method-to-property/index.js';
27
+ import * as convertAddArgumentToAddArgs from './convert-add-argument-to-add-args/index.js';
28
+ import * as convertDirnameToUrl from './convert-dirname-to-url/index.js';
29
+ import * as convertUrlToDirname from './convert-url-to-dirname/index.js';
30
+ import * as convertReportToFunction from './convert-report-to-function/index.js';
31
+ import * as replaceTestMessage from './replace-test-message/index.js';
32
+ import * as renameOperateToOperator from './rename-operate-to-operator/index.js';
33
+ import * as replaceOperateWithOperator from './replace-operate-with-operator/index.js';
34
+ import * as shortenImports from './shorten-imports/index.js';
35
+ import * as declare from './declare/index.js';
36
+ import * as addTestArgs from './add-test-args/index.js';
37
+ import * as addTraverseArgs from './add-traverse-args/index.js';
38
+ import * as moveRequireOnTopLevel from './move-require-on-top-level/index.js';
39
+ import * as includer from './includer/index.js';
40
+ import * as createTest from './create-test/index.js';
41
+ import * as applyNamespaceSpecifier from './apply-namespace-specifier/index.js';
42
+ import * as convertGetRuleToRequire from './convert-get-rule-to-require/index.js';
43
+ import * as addIndexToImport from './add-index-to-import/index.js';
44
+ import * as applyRename from './apply-rename/index.js';
45
+ import * as applyShortProcessors from './apply-short-processors/index.js';
46
+ import * as addTrackFile from './add-track-file/index.js';
47
+ import * as convertProgressToTrackFile from './convert-progress-to-track-file/index.js';
48
+ import * as addAwaitToProgress from './add-await-to-progress/index.js';
49
+ import * as applyForOfToTrackFile from './apply-for-of-to-track-file/index.js';
50
+ import * as removeUnusedGetPropertiesArgument from './remove-unused-get-properties-argument/index.js';
51
+ import * as simplifyReplaceTemplate from './simplify-replace-template/index.js';
52
+ import * as removeEmptyArrayFromProcess from './remove-empty-array-from-process/index.js';
53
+ import * as addPlacesToComparePlaces from './add-places-to-compare-places/index.js';
54
+ import * as addPathArgToFix from './add-path-arg-to-fix/index.js';
55
+ import * as convertIncludeToTraverse from './convert-include-to-traverse/index.js';
56
+ import * as removeUselessPrinterOption from './remove-useless-printer-option/index.js';
57
+ import * as addPathArgToVisitors from './add-path-arg-to-visitors/index.js';
58
+ import * as applyFixtureNameToMessage from './apply-fixture-name-to-message/index.js';
59
+ import * as applyVars from './apply-vars/index.js';
60
+ import * as declareTemplateVariables from './declare-template-variables/index.js';
61
+ import * as declarePathVariable from './declare-path-variable/index.js';
62
+ import * as applyParens from './apply-parens/index.js';
63
+ import * as applyLowercaseToNodeBuilders from './apply-lowercase-to-node-builders/index.js';
64
+ import * as applyCreateNestedDirectory from './apply-create-nested-directory/index.js';
65
+ import * as applyReport from './apply-report/index.js';
66
+ import * as applyExportsToAddArgs from './apply-exports-to-add-args/index.js';
2
67
 
3
- const applyProcessorsDestructuring = require('./apply-processors-destructuring');
4
- const applyAsyncFormatter = require('./apply-async-formatter');
5
- const applyCreateTest = require('./apply-create-test');
6
- const applyRemove = require('./apply-remove');
7
- const applyInsertBefore = require('./apply-insert-before');
8
- const applyInsertAfter = require('./apply-insert-after');
9
- const applyDeclare = require('./apply-declare');
10
- const checkDeclare = require('./check-declare');
11
- const checkReplaceCode = require('./check-replace-code');
12
- const checkMatch = require('./check-match');
13
- const convertPutoutTestToCreateTest = require('./convert-putout-test-to-create-test');
14
- const convertToNoTransformCode = require('./convert-to-no-transform-code');
15
- const convertFindToTraverse = require('./convert-find-to-traverse');
16
- const convertDestructuringToIdentifier = require('./convert-destructuring-to-identifier');
17
- const convertNumberToNumeric = require('./convert-number-to-numeric');
18
- const convertReplaceWith = require('./convert-replace-with');
19
- const convertReplaceWithMultiple = require('./convert-replace-with-multiple');
20
- const convertReplaceToFunction = require('./convert-replace-to-function');
21
- const convertMatchToFunction = require('./convert-match-to-function');
22
- const convertBabelTypes = require('./convert-babel-types');
23
- const convertNodeToPathInGetTemplateValues = require('./convert-node-to-path-in-get-template-values');
24
- const convertTraverseToInclude = require('./convert-traverse-to-include');
25
- const convertTraverseToReplace = require('./convert-traverse-to-replace');
26
- const convertTraverseToScan = require('./convert-traverse-to-scan');
27
- const convertProcessToFind = require('./convert-process-to-find');
28
- const convertMethodToProperty = require('./convert-method-to-property');
29
- const convertAddArgumentToAddArgs = require('./convert-add-argument-to-add-args');
30
- const convertDirnameToUrl = require('./convert-dirname-to-url');
31
- const convertUrlToDirname = require('./convert-url-to-dirname');
32
- const convertReportToFunction = require('./convert-report-to-function');
33
- const replaceTestMessage = require('./replace-test-message');
34
- const renameOperateToOperator = require('./rename-operate-to-operator');
35
- const replaceOperateWithOperator = require('./replace-operate-with-operator');
36
- const shortenImports = require('./shorten-imports');
37
- const declare = require('./declare');
38
- const addTestArgs = require('./add-test-args');
39
- const addTraverseArgs = require('./add-traverse-args');
40
- const moveRequireOnTopLevel = require('./move-require-on-top-level');
41
- const includer = require('./includer');
42
- const createTest = require('./create-test');
43
- const applyNamespaceSpecifier = require('./apply-namespace-specifier');
44
- const convertGetRuleToRequire = require('./convert-get-rule-to-require');
45
- const addIndexToImport = require('./add-index-to-import');
46
- const applyRename = require('./apply-rename');
47
- const applyShortProcessors = require('./apply-short-processors');
48
- const addTrackFile = require('./add-track-file');
49
- const convertProgressToTrackFile = require('./convert-progress-to-track-file');
50
- const addAwaitToProgress = require('./add-await-to-progress');
51
- const applyForOfToTrackFile = require('./apply-for-of-to-track-file');
52
- const removeUnusedGetPropertiesArgument = require('./remove-unused-get-properties-argument');
53
- const simplifyReplaceTemplate = require('./simplify-replace-template');
54
- const removeEmptyArrayFromProcess = require('./remove-empty-array-from-process');
55
- const addPlacesToComparePlaces = require('./add-places-to-compare-places');
56
- const addPathArgToFix = require('./add-path-arg-to-fix');
57
- const convertIncludeToTraverse = require('./convert-include-to-traverse');
58
- const removeUselessPrinterOption = require('./remove-useless-printer-option');
59
- const addPathArgToVisitors = require('./add-path-arg-to-visitors');
60
- const applyFixtureNameToMessage = require('./apply-fixture-name-to-message');
61
- const applyVars = require('./apply-vars');
62
- const declareTemplateVariables = require('./declare-template-variables');
63
- const declarePathVariable = require('./declare-path-variable');
64
- const applyParens = require('./apply-parens');
65
- const applyLowercaseToNodeBuilders = require('./apply-lowercase-to-node-builders');
66
- const applyCreateNestedDirectory = require('./apply-create-nested-directory');
67
- const applyReport = require('./apply-report');
68
-
69
- module.exports.rules = {
68
+ export const rules = {
70
69
  'apply-processors-destructuring': applyProcessorsDestructuring,
71
70
  'apply-async-formatter': applyAsyncFormatter,
72
71
  'apply-create-test': applyCreateTest,
@@ -74,6 +73,7 @@ module.exports.rules = {
74
73
  'apply-insert-before': applyInsertBefore,
75
74
  'apply-insert-after': applyInsertAfter,
76
75
  'apply-declare': applyDeclare,
76
+ 'apply-exports-to-add-args': applyExportsToAddArgs,
77
77
  'check-declare': checkDeclare,
78
78
  'check-replace-code': checkReplaceCode,
79
79
  'check-match': checkMatch,
@@ -1,7 +1,5 @@
1
- 'use strict';
2
-
3
- const justCamelCase = require('just-camel-case');
4
- const {types, template} = require('putout');
1
+ import justCamelCase from 'just-camel-case';
2
+ import {types, template} from 'putout';
5
3
 
6
4
  const TEST = `
7
5
  const test = require('@putout/test')(__dirname, {
@@ -22,14 +20,14 @@ const {
22
20
  identifier,
23
21
  } = types;
24
22
 
25
- module.exports.report = () => 'Move require on top level';
23
+ export const report = () => 'Move require on top level';
26
24
 
27
- module.exports.match = () => ({
25
+ export const match = () => ({
28
26
  [TEST]: ({__b}) => !isIdentifier(__b),
29
27
  [TRANSFORM]: ({__b}) => !isIdentifier(__b) && !isObjectExpression(__b) && !isMemberExpression(__b),
30
28
  });
31
29
 
32
- module.exports.replace = () => ({
30
+ export const replace = () => ({
33
31
  [TEST]: (vars, path) => {
34
32
  const name = declareRequire(vars, path);
35
33
  const {__a} = vars;
@@ -1,7 +1,5 @@
1
- 'use strict';
1
+ export const report = () => `Avoid empty array used as 'process()' argument`;
2
2
 
3
- module.exports.report = () => `Avoid empty array used as 'process()' argument`;
4
-
5
- module.exports.replace = () => ({
3
+ export const replace = () => ({
6
4
  'await process(__a, [])': 'await process(__a)',
7
5
  });
@@ -1,6 +1,5 @@
1
- 'use strict';
1
+ import {operator, types} from 'putout';
2
2
 
3
- const {operator, types} = require('putout');
4
3
  const {isObjectPattern} = types;
5
4
  const {
6
5
  getTemplateValues,
@@ -9,13 +8,13 @@ const {
9
8
 
10
9
  const GET_PROPERTIES = 'const __a = getProperties(__b, __c)';
11
10
 
12
- module.exports.report = ({name}) => `Remove unused property '${name}' from 'getProperties()' arguments`;
11
+ export const report = ({name}) => `Remove unused property '${name}' from 'getProperties()' arguments`;
13
12
 
14
- module.exports.fix = ({path}) => {
13
+ export const fix = ({path}) => {
15
14
  remove(path);
16
15
  };
17
16
 
18
- module.exports.traverse = ({push}) => ({
17
+ export const traverse = ({push}) => ({
19
18
  [GET_PROPERTIES]: (path) => {
20
19
  const {__a} = getTemplateValues(path, GET_PROPERTIES);
21
20
 
@@ -1,6 +1,5 @@
1
- 'use strict';
1
+ import {operator, types} from 'putout';
2
2
 
3
- const {operator, types} = require('putout');
4
3
  const {
5
4
  isCallExpression,
6
5
  isIdentifier,
@@ -8,13 +7,13 @@ const {
8
7
 
9
8
  const {remove} = operator;
10
9
 
11
- module.exports.report = () => `Avoid useless 'printer' option`;
10
+ export const report = () => `Avoid useless 'printer' option`;
12
11
 
13
- module.exports.fix = (path) => {
12
+ export const fix = (path) => {
14
13
  remove(path);
15
14
  };
16
15
 
17
- module.exports.traverse = ({push}) => ({
16
+ export const traverse = ({push}) => ({
18
17
  ObjectProperty(path) {
19
18
  const {value} = path.node;
20
19
 
@@ -1,19 +1,18 @@
1
- 'use strict';
1
+ import {operator} from 'putout';
2
2
 
3
- const {operator} = require('putout');
4
3
  const {rename} = operator;
5
4
 
6
- module.exports.report = () => '"operator" should be used instead of "operate"';
5
+ export const report = () => '"operator" should be used instead of "operate"';
7
6
 
8
- module.exports.include = () => ['Program'];
7
+ export const include = () => ['Program'];
9
8
 
10
- module.exports.filter = (path) => {
9
+ export const filter = (path) => {
11
10
  const noOperator = !path.scope.bindings.operator;
12
11
  const yesOperate = path.scope.bindings.operate;
13
12
 
14
13
  return noOperator && yesOperate;
15
14
  };
16
15
 
17
- module.exports.fix = (path) => {
16
+ export const fix = (path) => {
18
17
  rename(path, 'operate', 'operator');
19
18
  };
@@ -1,7 +1,5 @@
1
- 'use strict';
1
+ export const report = () => '"operator" should be used instead of "operate"';
2
2
 
3
- module.exports.report = () => '"operator" should be used instead of "operate"';
4
-
5
- module.exports.replace = () => ({
3
+ export const replace = () => ({
6
4
  'const __object = require("putout").operate': 'const __object = require("putout").operator',
7
5
  });
@@ -1,14 +1,13 @@
1
- 'use strict';
1
+ import {types} from 'putout';
2
2
 
3
- const {types} = require('putout');
4
3
  const {isCallExpression} = types;
5
4
 
6
- module.exports.report = ({correct, operatorPath}) => {
5
+ export const report = ({correct, operatorPath}) => {
7
6
  const calleePath = operatorPath.get('callee');
8
7
  return `Use '${correct}' in test message when using '${calleePath}()'`;
9
8
  };
10
9
 
11
- module.exports.fix = ({path, incorrect, correct}) => {
10
+ export const fix = ({path, incorrect, correct}) => {
12
11
  path.node.value = path.node.value.replace(incorrect, correct);
13
12
  path.node.raw = path.node.raw.replace(incorrect, correct);
14
13
  };
@@ -20,7 +19,7 @@ const INCORRECT = {
20
19
  NO_REPORT: /: (report|transform|no transform)/,
21
20
  };
22
21
 
23
- module.exports.traverse = ({push}) => ({
22
+ export const traverse = ({push}) => ({
24
23
  't.transform(__a)': convert({
25
24
  push,
26
25
  incorrect: INCORRECT.TRANSFORM,
@@ -1,8 +1,6 @@
1
- 'use strict';
1
+ export const report = () => 'Shorten require path to putout exports';
2
2
 
3
- module.exports.report = () => 'Shorten require path to putout exports';
4
-
5
- module.exports.replace = () => ({
3
+ export const replace = () => ({
6
4
  'require("putout/lib/cli/process-file")': 'require("putout/process-file")',
7
5
  'require("putout/lib/parse-options")': 'require("putout/parse-options")',
8
6
  });
@@ -1,6 +1,5 @@
1
- 'use strict';
1
+ import {operator} from 'putout';
2
2
 
3
- const {operator} = require('putout');
4
3
  const {compareAny, replaceWith} = operator;
5
4
 
6
5
  const parentNodesList = [
@@ -8,18 +7,18 @@ const parentNodesList = [
8
7
  'export const replace = __',
9
8
  ];
10
9
 
11
- module.exports.report = () => `Simplify replace template`;
10
+ export const report = () => `Simplify replace template`;
12
11
 
13
- module.exports.fix = (path) => {
12
+ export const fix = (path) => {
14
13
  const {body} = path.node;
15
14
  replaceWith(path, body);
16
15
  };
17
16
 
18
- module.exports.include = () => [
17
+ export const include = () => [
19
18
  '() => "__a"',
20
19
  ];
21
20
 
22
- module.exports.filter = (path) => {
21
+ export const filter = (path) => {
23
22
  return path.find(isReplace);
24
23
  };
25
24
 
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@putout/plugin-putout",
3
- "version": "23.16.0",
4
- "type": "commonjs",
3
+ "version": "24.0.0",
4
+ "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout plugin helps with plugins development",
7
7
  "homepage": "https://github.com/coderaiser/putout/tree/master/packages/plugin-putout#readme",
8
8
  "main": "lib/index.js",
9
9
  "exports": {
10
10
  ".": "./lib/index.js",
11
- "./declare/types": "./lib/declare/types.json"
11
+ "./declare/types": "./lib/declare/types.js"
12
12
  },
13
13
  "release": false,
14
14
  "tag": false,
@@ -42,7 +42,7 @@
42
42
  "plugin"
43
43
  ],
44
44
  "devDependencies": {
45
- "@putout/eslint-flat": "^2.0.0",
45
+ "@putout/eslint-flat": "^3.0.0",
46
46
  "@putout/plugin-nodejs": "*",
47
47
  "@putout/plugin-tape": "*",
48
48
  "@putout/test": "^12.0.0",
@@ -50,18 +50,18 @@
50
50
  "chalk": "^5.3.0",
51
51
  "eslint": "^9.0.0",
52
52
  "eslint-plugin-n": "^17.0.0",
53
- "eslint-plugin-putout": "^25.0.1",
53
+ "eslint-plugin-putout": "^26.0.0",
54
54
  "madrun": "^10.0.0",
55
55
  "montag": "^1.2.1",
56
56
  "nodemon": "^3.0.1",
57
57
  "supertape": "^10.0.0"
58
58
  },
59
59
  "peerDependencies": {
60
- "putout": ">=38"
60
+ "putout": ">=39"
61
61
  },
62
62
  "license": "MIT",
63
63
  "engines": {
64
- "node": ">=18"
64
+ "node": ">=20"
65
65
  },
66
66
  "publishConfig": {
67
67
  "access": "public"