eslint-plugin-putout 16.9.0 β 17.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 +3 -3
- package/lib/array-element-newline/index.js +8 -0
- package/lib/index.js +3 -3
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -135,11 +135,9 @@ Disabled π**Putout** rules:
|
|
|
135
135
|
- β [`nodejs/remove-process-exit`](https://github.com/coderaiser/putout/tree/v24.0.0/packages/plugin-nodejs#remove-process-exit#readme);
|
|
136
136
|
- β [`remove-unused-variables`](https://github.com/coderaiser/putout/tree/v24.0.0/packages/plugin-remove-unused-variables#readme);
|
|
137
137
|
- β [`typescript/remove-unused-types`](https://github.com/coderaiser/putout/tree/v24.0.2/packages/plugin-typescript#remove-unused-types#readme);
|
|
138
|
-
- β [`remove-unused-for-of-variables`](https://github.com/coderaiser/putout/tree/v24.0.0/packages/plugin-remove-unused-for-of-variables#readme);
|
|
139
138
|
- β [`remove-unused-expressions`](https://github.com/coderaiser/putout/tree/v24.0.0/packages/plugin-removeunused-expressions#readme);
|
|
140
139
|
- β [`remove-unreferenced-variables`](https://github.com/coderaiser/putout/tree/24.1.0/packages/plugin-remove-unreferenced-variables#readme);
|
|
141
140
|
- β [`remove-useless-arguments`](https://github.com/coderaiser/putout/tree/master/packages/plugin-remove-useless-arguments#readme);
|
|
142
|
-
- β [`remove-useless-for-of`](https://github.com/coderaiser/putout/tree/master/packages/plugin-remove-useless-for-of#readme);
|
|
143
141
|
- β [`remove-useless-return`](https://github.com/coderaiser/putout/tree/master/packages/plugin-remove-useless-return#readme);
|
|
144
142
|
- β [`remove-useless-spread`](https://github.com/coderaiser/putout/tree/master/packages/plugin-remove-useless-spread/#readme#readme);
|
|
145
143
|
- β [`remove-useless-variables/rename`](https://github.com/coderaiser/putout/tree/master/packages/plugin-remove-useless-arguments#rename#readme);
|
|
@@ -148,7 +146,9 @@ Disabled π**Putout** rules:
|
|
|
148
146
|
- β [`remove-console`](https://github.com/coderaiser/putout/tree/v24.0.0/packages/plugin-remove-console#readme);
|
|
149
147
|
- β [`remove-debugger`](https://github.com/coderaiser/putout/tree/v24.0.0/packages/plugin-remove-debugger#readme);
|
|
150
148
|
- β [`remove-unreachable-code`](https://github.com/coderaiser/putout/tree/v24.0.0/packages/plugin-remove-unreachable-code#readme);
|
|
151
|
-
- β [`
|
|
149
|
+
- β [`for-of/for`](https://github.com/coderaiser/putout/tree/v29.1.2/packages/plugin-convert-for-to-for-of#readme);
|
|
150
|
+
- β [`for-of/remove-useless`](https://github.com/coderaiser/putout/tree/v29.1.2/packages/plugin-remove-useless-for-of#readme);
|
|
151
|
+
- β [`for-of/remove-unused-variables`](https://github.com/coderaiser/putout/tree/29.1.2/packages/plugin-for-of#remove-unused-variables);
|
|
152
152
|
|
|
153
153
|
### safe+align
|
|
154
154
|
|
|
@@ -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/lib/index.js
CHANGED
|
@@ -112,9 +112,7 @@ const safe = {
|
|
|
112
112
|
'typescript/remove-unused-types': 'off',
|
|
113
113
|
'remove-unused-variables': 'off',
|
|
114
114
|
'remove-unused-expressions': 'off',
|
|
115
|
-
'remove-unused-for-of-variables': 'off',
|
|
116
115
|
'remove-unreachable-code': 'off',
|
|
117
|
-
'remove-useless-for-of': 'off',
|
|
118
116
|
'remove-useless-arguments': 'off',
|
|
119
117
|
'remove-useless-variables/rename': 'off',
|
|
120
118
|
'remove-useless-return': 'off',
|
|
@@ -124,7 +122,9 @@ const safe = {
|
|
|
124
122
|
'tape/remove-only': 'off',
|
|
125
123
|
'remove-console': 'off',
|
|
126
124
|
'remove-debugger': 'off',
|
|
127
|
-
'
|
|
125
|
+
'for-of/for': 'off',
|
|
126
|
+
'for-of/remove-unused-variables': 'off',
|
|
127
|
+
'for-of/remove-useless': 'off',
|
|
128
128
|
},
|
|
129
129
|
}],
|
|
130
130
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-putout",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "17.0.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"description": "ESLint plugin for πPutout",
|
|
6
6
|
"release": false,
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
],
|
|
24
24
|
"author": "coderaiser",
|
|
25
25
|
"main": "lib/index.js",
|
|
26
|
-
"commitType": "colon",
|
|
27
26
|
"scripts": {
|
|
28
27
|
"wisdom": "madrun wisdom",
|
|
29
28
|
"test": "madrun test",
|
|
@@ -57,7 +56,7 @@
|
|
|
57
56
|
},
|
|
58
57
|
"devDependencies": {
|
|
59
58
|
"@babel/plugin-syntax-typescript": "^7.12.1",
|
|
60
|
-
"@putout/test": "^
|
|
59
|
+
"@putout/test": "^6.0.0",
|
|
61
60
|
"c8": "^7.5.0",
|
|
62
61
|
"eslint": "^8.0.1",
|
|
63
62
|
"eslint-plugin-eslint-plugin": "^5.0.6",
|