@so1ve/eslint-plugin 0.42.1 → 0.42.2
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.
- package/dist/index.cjs +3 -4
- package/dist/index.mjs +3 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -412,12 +412,11 @@ const noSpacesBeforeParen = createEslintRule({
|
|
|
412
412
|
},
|
|
413
413
|
CallExpression(node) {
|
|
414
414
|
const caller = "property" in node.callee ? node.callee.property : node.callee;
|
|
415
|
-
const
|
|
416
|
-
const
|
|
417
|
-
const parenStart = firstArgument ? firstArgumentStart - 1 : node.range[1] - 2;
|
|
415
|
+
const textAfterCaller = text.slice(caller.range[1]);
|
|
416
|
+
const parenStart = caller.range[1] + textAfterCaller.indexOf("(");
|
|
418
417
|
const textBetweenFunctionNameAndParenRange = [caller.range[1], parenStart];
|
|
419
418
|
const textBetweenFunctionNameAndParen = text.slice(...textBetweenFunctionNameAndParenRange);
|
|
420
|
-
const hasGenerics =
|
|
419
|
+
const hasGenerics = textBetweenFunctionNameAndParen.includes("<");
|
|
421
420
|
if (!hasGenerics) {
|
|
422
421
|
if (textBetweenFunctionNameAndParen.length > 0) {
|
|
423
422
|
context.report({
|
package/dist/index.mjs
CHANGED
|
@@ -410,12 +410,11 @@ const noSpacesBeforeParen = createEslintRule({
|
|
|
410
410
|
},
|
|
411
411
|
CallExpression(node) {
|
|
412
412
|
const caller = "property" in node.callee ? node.callee.property : node.callee;
|
|
413
|
-
const
|
|
414
|
-
const
|
|
415
|
-
const parenStart = firstArgument ? firstArgumentStart - 1 : node.range[1] - 2;
|
|
413
|
+
const textAfterCaller = text.slice(caller.range[1]);
|
|
414
|
+
const parenStart = caller.range[1] + textAfterCaller.indexOf("(");
|
|
416
415
|
const textBetweenFunctionNameAndParenRange = [caller.range[1], parenStart];
|
|
417
416
|
const textBetweenFunctionNameAndParen = text.slice(...textBetweenFunctionNameAndParenRange);
|
|
418
|
-
const hasGenerics =
|
|
417
|
+
const hasGenerics = textBetweenFunctionNameAndParen.includes("<");
|
|
419
418
|
if (!hasGenerics) {
|
|
420
419
|
if (textBetweenFunctionNameAndParen.length > 0) {
|
|
421
420
|
context.report({
|