eslint-plugin-autofix
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -119,2 +119,17 @@ /** | ||
case "after-used": { | ||
const tokenBefore = sourceCode.getTokenBefore(node) | ||
const tokenAfter = sourceCode.getTokenAfter(node) | ||
if ( | ||
parent.params.length === 1 && | ||
!(tokenBefore && tokenBefore.value === '(') && | ||
!(tokenAfter && tokenAfter.value === ')') | ||
) { | ||
return [ | ||
fixer.insertTextBefore(node, '('), | ||
fixer.insertTextAfter(node, ')'), | ||
fixer.remove(node) | ||
] | ||
} | ||
const comma = sourceCode.getTokenBefore(node, commaFilter); | ||
@@ -124,9 +139,9 @@ | ||
return [fixer.remove(comma), fixer.remove(node)]; | ||
} else { | ||
const commaAfter = sourceCode.getTokenAfter(node, commaFilter); | ||
if (commaAfter && commaAfter.range && grand.range && commaAfter.range[1] <= grand.range[1]) { | ||
return [fixer.remove(node), fixer.remove(commaAfter)]; | ||
} | ||
} | ||
const commaAfter = sourceCode.getTokenAfter(node, commaFilter); | ||
if (commaAfter && commaAfter.range && grand.range && commaAfter.range[1] <= grand.range[1]) { | ||
return [fixer.remove(node), fixer.remove(commaAfter)]; | ||
} | ||
return [fixer.remove(node)]; | ||
@@ -133,0 +148,0 @@ } |
{ | ||
"name": "eslint-plugin-autofix", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"author": "薛定谔的猫 <weiran.zsd@outlook.com>", | ||
@@ -5,0 +5,0 @@ "description": "autofix some errors reported by eslint rules.", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
47015
722