@putout/plugin-putout 26.12.0 → 26.13.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.
|
@@ -17,7 +17,7 @@ const INCORRECT = {
|
|
|
17
17
|
NO_REPORT: /: (no report after transform|report|(transform|no transform)(\swith options)?)/,
|
|
18
18
|
NO_REPORT_AFTER_TRANSFORM: /: (report|transform|no transform|no report)/,
|
|
19
19
|
NO_REPORT_WITH_OPTIONS: /: (no report after transform(\swith options)?|report|transform|no transform|no report)/,
|
|
20
|
-
TRANSFORM: /: (no report after transform|no transform|report|no report)/,
|
|
20
|
+
TRANSFORM: /: (transform with options|no report after transform|no transform|report|no report)/,
|
|
21
21
|
NO_TRANSFORM: /: (no report after transform|transform|report|no report)/,
|
|
22
22
|
TRANSFORM_WITH_OPTIONS: /: (no report after transform|transform|no transform(\swith options)?|report|no report)/,
|
|
23
23
|
NO_TRANSFORM_WITH_OPTIONS: /: (no report after transform|transform(\swith options)?|no transform|report|no report)/,
|
|
@@ -109,10 +109,19 @@ function isCorrect({path, correct, incorrect}) {
|
|
|
109
109
|
|
|
110
110
|
const {value} = messagePath.node;
|
|
111
111
|
|
|
112
|
-
if (value
|
|
112
|
+
if (containsCorrect(value, correct))
|
|
113
113
|
return [CORRECT];
|
|
114
114
|
|
|
115
115
|
const is = !incorrect.test(value);
|
|
116
116
|
|
|
117
117
|
return [is, messagePath];
|
|
118
118
|
}
|
|
119
|
+
|
|
120
|
+
function containsCorrect(value, correct) {
|
|
121
|
+
if (!value.includes(correct))
|
|
122
|
+
return false;
|
|
123
|
+
|
|
124
|
+
const nextIndex = value.indexOf(correct) + correct.length;
|
|
125
|
+
|
|
126
|
+
return value.charAt(nextIndex) !== ' ';
|
|
127
|
+
}
|
package/package.json
CHANGED