@putout/plugin-types 1.7.0 → 2.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.
@@ -1,10 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const {operator} = require('putout');
4
- const {
5
- compare,
6
- getBindingPath,
7
- } = operator;
4
+ const {compare, getBindingPath} = operator;
8
5
 
9
6
  const NAMES = {
10
7
  function: 'isFn',
@@ -13,6 +10,7 @@ const NAMES = {
13
10
  boolean: 'isBool',
14
11
  undefined: 'isUndefined',
15
12
  symbol: 'isSymbol',
13
+ bigint: 'isBigInt',
16
14
  };
17
15
 
18
16
  const GENERAL = 'typeof __a === "__b"';
@@ -24,6 +22,7 @@ const BODIES = {
24
22
  boolean: `typeof __a === 'boolean'`,
25
23
  undefined: `typeof __a === 'undefined'`,
26
24
  symbol: `typeof __a === 'symbol'`,
25
+ bigint: `typeof __a === 'bigint'`,
27
26
  };
28
27
 
29
28
  module.exports.report = () => `Use function to check type instead of 'typeof'`;
@@ -49,6 +48,7 @@ module.exports.replace = () => ({
49
48
  [BODIES.boolean]: 'isBool(__a)',
50
49
  [BODIES.undefined]: 'isUndefined(__a)',
51
50
  [BODIES.symbol]: 'isSymbol(__a)',
51
+ [BODIES.bigint]: 'isBigInt(__a)',
52
52
  });
53
53
 
54
54
  function isBind(path, name) {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- module.exports.report = () => `Useless typeof should be avoided`;
3
+ module.exports.report = () => `Avoid useless 'typeof'`;
4
4
 
5
5
  module.exports.replace = () => ({
6
6
  'typeof typeof __a': 'typeof __a',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-types",
3
- "version": "1.7.0",
3
+ "version": "2.1.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,18 +32,18 @@
32
32
  ],
33
33
  "devDependencies": {
34
34
  "@putout/plugin-putout": "*",
35
- "@putout/test": "^6.0.0",
36
- "c8": "^7.5.0",
35
+ "@putout/test": "^7.0.0",
36
+ "c8": "^8.0.0",
37
37
  "eslint": "^8.0.1",
38
38
  "eslint-plugin-n": "^16.0.0",
39
- "eslint-plugin-putout": "^17.0.0",
39
+ "eslint-plugin-putout": "^18.0.0",
40
40
  "lerna": "^6.0.1",
41
41
  "madrun": "^9.0.0",
42
42
  "montag": "^1.2.1",
43
- "nodemon": "^2.0.1"
43
+ "nodemon": "^3.0.1"
44
44
  },
45
45
  "peerDependencies": {
46
- "putout": ">=29"
46
+ "putout": ">=30"
47
47
  },
48
48
  "license": "MIT",
49
49
  "engines": {