@putout/plugin-nodejs 20.0.0 → 20.1.1

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.
@@ -1,6 +1,9 @@
1
1
  export const report = () => '';
2
2
  export const replace = ({options}) => {
3
- const {from = '', to = ''} = options;
3
+ const {
4
+ from = '',
5
+ to = '',
6
+ } = options;
4
7
 
5
8
  if (!from || !to)
6
9
  return {};
@@ -2,12 +2,14 @@ import {types} from 'putout';
2
2
 
3
3
  const {isFunction} = types;
4
4
 
5
- export const report = () => `"process.exit" should be used instead of top-level return`;
5
+ export const report = () => `Use 'process.exit()' instead of top-level 'return'`;
6
6
 
7
7
  export const filter = (path) => !path.findParent(isFunction);
8
8
 
9
9
  export const replace = () => ({
10
- 'return __a()': '{__a(); process.exit()}',
11
- 'return __a': 'process.exit()',
12
10
  'return': 'process.exit()',
11
+ 'return __a': `{
12
+ __a;
13
+ process.exit();
14
+ }`,
13
15
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-nodejs",
3
- "version": "20.0.0",
3
+ "version": "20.1.1",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout plugin adds ability to transform code to new API of Node.js",