eslint-plugin-unicorn
Advanced tools
Comparing version 12.0.1 to 12.0.2
{ | ||
"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) { |
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
157065
4967
+ Addedimport-modules@2.1.0(transitive)
+ Addedread-pkg-up@7.0.1(transitive)
- Removedimport-modules@1.1.0(transitive)
- Removedread-pkg-up@6.0.0(transitive)
- Removedtype-fest@0.5.2(transitive)
Updatedimport-modules@^2.0.0
Updatedread-pkg-up@^7.0.0