Socket
Socket
Sign inDemoInstall

eslint-plugin-unicorn

Package Overview
Dependencies
Maintainers
1
Versions
106
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-unicorn - npm Package Compare versions

Comparing version 8.0.0 to 8.0.1

2

package.json
{
"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 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc