@putout/plugin-package-json 2.0.0 β†’ 4.1.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.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-package-json.svg?style=flat&longCache=true
4
4
  [NPMURL]: https://npmjs.org/package/@putout/plugin-package-json"npm"
5
5
 
6
- 🐊[`Putout`](https://github.com/coderaiser/putout) plugin helps to automate fixing `package-json` config.
6
+ 🐊[**Putout**](https://github.com/coderaiser/putout) plugin helps to automate fixing `package.json`.
7
7
 
8
8
  ## Install
9
9
 
@@ -27,9 +27,9 @@ npm i @putout/plugin-package-json -D
27
27
  - additional fields in `package.json` produces more traffic then users of your package really need;
28
28
  - [c8](https://github.com/bcoe/c8) uses [same config name and format](https://github.com/bcoe/c8/blob/v7.3.5/lib/parse-args.js#L8) so transition between tools will be much easier;
29
29
 
30
- ### ❌ Incorrect code example
30
+ ### ❌ Example of incorrect code
31
31
 
32
- `nyc` section in "package.json":
32
+ `nyc` section in `package.json`:
33
33
 
34
34
  ```json
35
35
  {
@@ -50,7 +50,7 @@ npm i @putout/plugin-package-json -D
50
50
  }
51
51
  ```
52
52
 
53
- ### βœ… Correct code Example
53
+ ### βœ… Example of correct code
54
54
 
55
55
  File `.nycrc.json`:
56
56
 
@@ -10,14 +10,14 @@ const {
10
10
  StringLiteral,
11
11
  } = types;
12
12
 
13
- const {findProperties} = operator;
13
+ const {getProperties} = operator;
14
14
 
15
15
  module.exports.report = () => `Add 'type' of module to 'package.json'`;
16
16
 
17
17
  module.exports.traverse = ({push}) => ({
18
18
  '__putout_processor_json(__a)': (path) => {
19
19
  const __aPath = path.get('arguments.0');
20
- const {versionPath, typePath} = findProperties(__aPath, ['version', 'type']);
20
+ const {versionPath, typePath} = getProperties(__aPath, ['version', 'type']);
21
21
 
22
22
  if (typePath)
23
23
  return;
@@ -1,17 +1,21 @@
1
1
  'use strict';
2
2
 
3
- const {findProperties} = require('putout').operator;
3
+ const {operator} = require('putout');
4
+ const {
5
+ remove,
6
+ getProperties,
7
+ } = operator;
4
8
 
5
9
  module.exports.report = () => `Remove 'nyc' section of 'package.json', use file '.nycrc.json' intead`;
6
10
 
7
11
  module.exports.fix = (path) => {
8
- path.remove();
12
+ remove(path);
9
13
  };
10
14
 
11
15
  module.exports.traverse = ({push}) => ({
12
16
  '__putout_processor_json(__a)': (path) => {
13
17
  const __aPath = path.get('arguments.0');
14
- const {nycPath} = findProperties(__aPath, ['nyc']);
18
+ const {nycPath} = getProperties(__aPath, ['nyc']);
15
19
 
16
20
  if (!nycPath)
17
21
  return;
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@putout/plugin-package-json",
3
- "version": "2.0.0",
3
+ "version": "4.1.0",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
- "description": "putout plugin for package.json",
6
+ "description": "🐊Putout plugin for package.json",
7
7
  "homepage": "https://github.com/coderaiser/putout/tree/master/packages/plugin-package-json#readme",
8
8
  "main": "lib/index.js",
9
9
  "release": false,
@@ -31,21 +31,21 @@
31
31
  "package-json"
32
32
  ],
33
33
  "devDependencies": {
34
- "@putout/test": "^4.0.0",
34
+ "@putout/test": "^5.0.0",
35
35
  "c8": "^7.5.0",
36
36
  "eslint": "^8.0.1",
37
37
  "eslint-plugin-node": "^11.0.0",
38
- "eslint-plugin-putout": "^12.0.0",
38
+ "eslint-plugin-putout": "^14.0.0",
39
39
  "lerna": "^4.0.0",
40
- "madrun": "^8.0.1",
40
+ "madrun": "^9.0.0",
41
41
  "nodemon": "^2.0.1"
42
42
  },
43
43
  "peerDependencies": {
44
- "putout": ">=23"
44
+ "putout": ">=25"
45
45
  },
46
46
  "license": "MIT",
47
47
  "engines": {
48
- "node": ">=14"
48
+ "node": ">=16"
49
49
  },
50
50
  "publishConfig": {
51
51
  "access": "public"