eslint-plugin-putout 16.9.0 → 16.10.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.
@@ -9,6 +9,7 @@ const {
9
9
 
10
10
  const isString = (a) => typeof a === 'string';
11
11
  const isBool = (a) => typeof a === 'boolean';
12
+ const isNumber = (a) => typeof a === 'number';
12
13
 
13
14
  module.exports.category = 'array';
14
15
  module.exports.report = () => 'Add newlines between array elements';
@@ -94,6 +95,7 @@ function differentTypes({elements}) {
94
95
  let hasIdentifier = false;
95
96
  let hasBool = false;
96
97
  let hasStr = false;
98
+ let hasNumber = false;
97
99
 
98
100
  for (const {type, value} of elements) {
99
101
  if (type === 'Literal') {
@@ -105,8 +107,14 @@ function differentTypes({elements}) {
105
107
  if (isBool(value))
106
108
  hasBool = true;
107
109
 
110
+ if (isNumber(value))
111
+ hasNumber = true;
112
+
108
113
  if (hasStr && hasBool)
109
114
  return true;
115
+
116
+ if (hasStr && hasNumber)
117
+ return true;
110
118
  }
111
119
 
112
120
  if (type === 'Identifier')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-putout",
3
- "version": "16.9.0",
3
+ "version": "16.10.0",
4
4
  "type": "commonjs",
5
5
  "description": "ESLint plugin for 🐊Putout",
6
6
  "release": false,