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 12.0.1 to 12.0.2

10

package.json
{
"name": "eslint-plugin-unicorn",
"version": "12.0.1",
"version": "12.0.2",
"description": "Various awesome ESLint rules",

@@ -38,3 +38,3 @@ "license": "MIT",

"eslint-template-visitor": "^1.0.0",
"import-modules": "^1.1.0",
"import-modules": "^2.0.0",
"lodash.camelcase": "^4.3.0",

@@ -46,3 +46,3 @@ "lodash.defaultsdeep": "^4.6.1",

"lodash.upperfirst": "^4.3.1",
"read-pkg-up": "^6.0.0",
"read-pkg-up": "^7.0.0",
"regexpp": "^3.0.0",

@@ -59,3 +59,3 @@ "reserved-words": "^0.1.2",

"del": "^5.1.0",
"eslint": "^6.3.0",
"eslint": "^6.5.1",
"eslint-ava-rule-tester": "^3.0.0",

@@ -69,3 +69,3 @@ "eslint-plugin-eslint-plugin": "2.1.0",

"tempy": "^0.3.0",
"xo": "^0.24.0"
"xo": "^0.25.3"
},

@@ -72,0 +72,0 @@ "peerDependencies": {

@@ -0,1 +1,2 @@

/* eslint-disable unicorn/expiring-todo-comments */
'use strict';

@@ -20,8 +21,9 @@ const readPkgUp = require('read-pkg-up');

const hasPackage = readPkgUp.sync();
const pkg = hasPackage ? hasPackage.package : {};
const packageResult = readPkgUp.sync();
const hasPackage = Boolean(packageResult);
const packageJson = hasPackage ? packageResult.packageJson : {};
const pkgDependencies = {
...pkg.dependencies,
...pkg.devDependencies
...packageJson.dependencies,
...packageJson.devDependencies
};

@@ -43,3 +45,3 @@

const TODO_ARGUMENT_RE = new RegExp('\\[([^}]+)\\]', 'i');
const TODO_ARGUMENT_RE = /\[([^}]+)\]/i;
const result = TODO_ARGUMENT_RE.exec(string);

@@ -181,3 +183,3 @@

ignoreDatesOnPullRequests: true,
allowWarningComments: false,
allowWarningComments: true,
...context.options[0]

@@ -288,3 +290,3 @@ };

const pkgVersion = tryToCoerceVersion(pkg.version);
const pkgVersion = tryToCoerceVersion(packageJson.version);
const desidedPkgVersion = tryToCoerceVersion(version);

@@ -358,3 +360,3 @@

const pkgEngines = pkg.engines || {};
const pkgEngines = packageJson.engines || {};

@@ -361,0 +363,0 @@ for (const engine of engines) {

@@ -37,3 +37,3 @@ 'use strict';

// Strip off backticks
value = value.substring(1, value.length - 1);
value = value.slice(1, value.length - 1);
}

@@ -40,0 +40,0 @@

@@ -110,3 +110,3 @@ 'use strict';

function report(node, keyword) {
if (reported.indexOf(node) < 0) {
if (!reported.includes(node)) {
reported.push(node);

@@ -150,3 +150,3 @@ context.report({

// Check if it's an import specifier
} else if (['ImportSpecifier', 'ImportNamespaceSpecifier', 'ImportDefaultSpecifier'].indexOf(node.parent.type) >= 0) {
} else if (['ImportSpecifier', 'ImportNamespaceSpecifier', 'ImportDefaultSpecifier'].includes(node.parent.type)) {
// Report only if the local imported identifier is invalid

@@ -153,0 +153,0 @@ if (Boolean(keyword) && node.parent.local && node.parent.local.name === node.name) {

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