eslint-plugin-putout 11.15.0 → 11.15.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.
|
@@ -8,6 +8,8 @@ const {
|
|
|
8
8
|
isExpressionStatement,
|
|
9
9
|
} = types;
|
|
10
10
|
|
|
11
|
+
const regExp = /^\n( +)?\n +$/;
|
|
12
|
+
|
|
11
13
|
module.exports.category = 'typescript';
|
|
12
14
|
module.exports.report = () => 'Add newline before function call';
|
|
13
15
|
|
|
@@ -31,7 +33,7 @@ module.exports.filter = ({text, node, getText, getCommentsBefore}) => {
|
|
|
31
33
|
|
|
32
34
|
const spaces = getSpacesBeforeNode(node, {text, getText});
|
|
33
35
|
|
|
34
|
-
if (
|
|
36
|
+
if (regExp.test(spaces))
|
|
35
37
|
return false;
|
|
36
38
|
|
|
37
39
|
for (let i = 2; i < n; i++) {
|
|
@@ -47,7 +49,7 @@ module.exports.filter = ({text, node, getText, getCommentsBefore}) => {
|
|
|
47
49
|
|
|
48
50
|
const spaces = getSpacesBeforeNode(prevA, {getText});
|
|
49
51
|
|
|
50
|
-
if (
|
|
52
|
+
if (regExp.test(spaces))
|
|
51
53
|
return false;
|
|
52
54
|
|
|
53
55
|
return true;
|