@putout/plugin-types 3.0.0 → 4.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.
package/README.md CHANGED
@@ -43,6 +43,8 @@ Supported assertions:
43
43
  - `isSymbol`;
44
44
  - `isNull`;
45
45
  - `isBigInt`;
46
+ - `isArray`;
47
+ - `isEmptyArray`;
46
48
 
47
49
  #### ❌ Example of incorrect code
48
50
 
@@ -117,17 +119,15 @@ const a = [1].includes(1);
117
119
  #### ❌ Example of incorrect code
118
120
 
119
121
  ```js
120
- if (!!a) {
122
+ if (!!a)
121
123
  console.log('hi');
122
- }
123
124
  ```
124
125
 
125
126
  #### ✅ Example of correct code
126
127
 
127
128
  ```js
128
- if (a) {
129
+ if (a)
129
130
  console.log('hi');
130
- }
131
131
  ```
132
132
 
133
133
  ### remove-useless-typeof
@@ -11,4 +11,6 @@ module.exports.declare = () => ({
11
11
  isSymbol: `const isSymbol = (a) => typeof a === 'symbol'`,
12
12
  isBigInt: `const isBigInt = (a) => typeof a === 'bigint'`,
13
13
  isNull: `const isNull = (a) => !a && typeof a === 'object'`,
14
+ isArray: 'const {isArray} = Array',
15
+ isEmptyArray: 'const isEmptyArray = (a) => isArray(a) && !a.length',
14
16
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-types",
3
- "version": "3.0.0",
3
+ "version": "4.0.0",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout plugin adds ability to transform code related to types assertions",
@@ -32,22 +32,22 @@
32
32
  ],
33
33
  "devDependencies": {
34
34
  "@putout/plugin-putout": "*",
35
- "@putout/test": "^7.0.0",
36
- "c8": "^8.0.0",
37
- "eslint": "^8.0.1",
38
- "eslint-plugin-n": "^16.0.0",
39
- "eslint-plugin-putout": "^19.0.0",
35
+ "@putout/test": "^9.0.0",
36
+ "c8": "^9.0.0",
37
+ "eslint": "^9.0.0",
38
+ "eslint-plugin-n": "^17.0.0",
39
+ "eslint-plugin-putout": "^22.0.0",
40
40
  "lerna": "^6.0.1",
41
- "madrun": "^9.0.0",
41
+ "madrun": "^10.0.0",
42
42
  "montag": "^1.2.1",
43
43
  "nodemon": "^3.0.1"
44
44
  },
45
45
  "peerDependencies": {
46
- "putout": ">=31"
46
+ "putout": ">=35"
47
47
  },
48
48
  "license": "MIT",
49
49
  "engines": {
50
- "node": ">=16"
50
+ "node": ">=18"
51
51
  },
52
52
  "publishConfig": {
53
53
  "access": "public"