eslint-plugin-putout 22.6.1 → 22.7.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.
@@ -3,7 +3,7 @@
3
3
  const alignSpaces = require('align-spaces');
4
4
  const alignedMap = new Map();
5
5
 
6
- module.exports.report = () => 'Spaces should be aligned on empty lines';
6
+ module.exports.report = () => 'Keep whitespaces in blank lines';
7
7
 
8
8
  module.exports.include = () => ['Program'];
9
9
 
@@ -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 isLoc = isCorrectLoc(line, specifiers);
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 !(isLoc || isLength);
62
+ return !isLength;
57
63
  }
58
64
 
59
65
  const {id} = node;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-putout",
3
- "version": "22.6.1",
3
+ "version": "22.7.1",
4
4
  "type": "commonjs",
5
5
  "description": "ESLint plugin for 🐊Putout",
6
6
  "release": false,