eslint-plugin-putout 22.6.1 → 22.7.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.
|
@@ -15,6 +15,8 @@ const parseOptions = (options) => {
|
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
+
const notImportDefaultSpecifier = (a) => a.type !== 'ImportDefaultSpecifier';
|
|
19
|
+
|
|
18
20
|
module.exports.category = 'destructuring';
|
|
19
21
|
module.exports.report = () => 'Keep each property on separate lines when destructuring long properties';
|
|
20
22
|
|
|
@@ -47,13 +49,17 @@ module.exports.filter = ({node}, options) => {
|
|
|
47
49
|
if (isImportDeclaration(node)) {
|
|
48
50
|
const {specifiers} = node;
|
|
49
51
|
const {line} = node.loc.start;
|
|
50
|
-
const
|
|
52
|
+
const filtered = specifiers.filter(notImportDefaultSpecifier);
|
|
53
|
+
const isLoc = isCorrectLoc(line, filtered);
|
|
54
|
+
|
|
55
|
+
if (isLoc)
|
|
56
|
+
return false;
|
|
51
57
|
|
|
52
58
|
const isLength = isCorrectSpecifiersLength(specifiers, {
|
|
53
59
|
maxLength,
|
|
54
60
|
});
|
|
55
61
|
|
|
56
|
-
return !
|
|
62
|
+
return !isLength;
|
|
57
63
|
}
|
|
58
64
|
|
|
59
65
|
const {id} = node;
|