@putout/plugin-putout 29.33.0 → 29.33.1
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,7 +1,10 @@
|
|
|
1
1
|
import {operator, types} from 'putout';
|
|
2
2
|
|
|
3
3
|
const {compare, remove} = operator;
|
|
4
|
-
const {
|
|
4
|
+
const {
|
|
5
|
+
booleanLiteral,
|
|
6
|
+
isObjectProperty,
|
|
7
|
+
} = types;
|
|
5
8
|
|
|
6
9
|
export const report = () => `Avoid useless 'match'`;
|
|
7
10
|
|
|
@@ -14,7 +17,7 @@ export const traverse = ({push}) => ({
|
|
|
14
17
|
const properties = __objectPath.get('properties');
|
|
15
18
|
const boolean = booleanLiteral(true);
|
|
16
19
|
|
|
17
|
-
for (const property of properties) {
|
|
20
|
+
for (const property of properties.filter(isObjectProperty)) {
|
|
18
21
|
const {body} = property.node.value;
|
|
19
22
|
|
|
20
23
|
if (compare(body, boolean))
|
package/package.json
CHANGED