eslint-plugin-unicorn
Advanced tools
Comparing version 8.0.0 to 8.0.1
{ | ||
"name": "eslint-plugin-unicorn", | ||
"version": "8.0.0", | ||
"version": "8.0.1", | ||
"description": "Various awesome ESLint rules", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -405,5 +405,15 @@ 'use strict'; | ||
return identifier.parent.type === 'Property' && | ||
identifier.parent.key === identifier && | ||
identifier.parent.shorthand; | ||
}; | ||
const isAssignmentPatternShorthandPropertyIdentifier = identifier => { | ||
return identifier.parent.type === 'AssignmentPattern' && | ||
identifier.parent.left === identifier && | ||
identifier.parent.parent.type === 'Property' && | ||
identifier.parent.parent.key === identifier && | ||
identifier.parent.parent.value === identifier.parent && | ||
identifier.parent.parent.shorthand; | ||
}; | ||
const isShorthandImportIdentifier = identifier => { | ||
@@ -422,3 +432,3 @@ return identifier.parent.type === 'ImportSpecifier' && | ||
const fixIdentifier = (fixer, replacement) => identifier => { | ||
if (isShorthandPropertyIdentifier(identifier)) { | ||
if (isShorthandPropertyIdentifier(identifier) || isAssignmentPatternShorthandPropertyIdentifier(identifier)) { | ||
return fixer.replaceText(identifier, `${identifier.name}: ${replacement}`); | ||
@@ -425,0 +435,0 @@ } |
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
108934
3319