eslint-plugin-inker
Advanced tools
Comparing version 2.6.9 to 2.6.10
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const micromatch_1 = __importDefault(require("micromatch")); | ||
const minimatch_1 = require("minimatch"); | ||
const lodash_1 = require("lodash"); | ||
@@ -86,5 +83,9 @@ const importNamesSchema = { | ||
const { source, specifiers, } = node; | ||
const foundPaths = options.paths.filter(item => 'name' in item | ||
? item.name === source.value | ||
: micromatch_1.default.isMatch(source.value, item.pattern)); | ||
const foundPaths = options.paths.filter(item => { | ||
if ('name' in item) { | ||
return item.name === source.value; | ||
} | ||
const patterns = (0, lodash_1.castArray)(item.pattern); | ||
return patterns.some(pattern => (0, minimatch_1.minimatch)(source.value, pattern)); | ||
}); | ||
if (foundPaths.length === 0) { | ||
@@ -91,0 +92,0 @@ return; |
{ | ||
"name": "eslint-plugin-inker", | ||
"version": "2.6.9", | ||
"version": "2.6.10", | ||
"description": "", | ||
@@ -28,3 +28,2 @@ "types": "dist/index.d.ts", | ||
"@types/lodash": "^4.14.182", | ||
"@types/micromatch": "^4.0.2", | ||
"@typescript-eslint/parser": "^5.59.8", | ||
@@ -37,4 +36,4 @@ "eslint": "^8.20.0", | ||
"lodash": "^4.17.21", | ||
"micromatch": "^4.0.5" | ||
"minimatch": "^9.0.3" | ||
} | ||
} |
@@ -5,3 +5,3 @@ import { | ||
import micromatch from 'micromatch' | ||
import { minimatch } from 'minimatch' | ||
@@ -13,2 +13,3 @@ import { | ||
import { | ||
castArray, | ||
compact, | ||
@@ -126,7 +127,10 @@ } from 'lodash' | ||
const foundPaths = options.paths.filter( | ||
item => 'name' in item | ||
? item.name === source.value | ||
: micromatch.isMatch(source.value as string, item.pattern), | ||
) | ||
const foundPaths = options.paths.filter(item => { | ||
if ('name' in item) { | ||
return item.name === source.value | ||
} | ||
const patterns = castArray(item.pattern) | ||
return patterns.some(pattern => minimatch(source.value as string, pattern)) | ||
}) | ||
if (foundPaths.length === 0) { | ||
@@ -133,0 +137,0 @@ return |
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
51202
9
1447
+ Addedminimatch@^9.0.3
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@2.0.1(transitive)
+ Addedminimatch@9.0.5(transitive)
- Removedmicromatch@^4.0.5
- Removedbraces@3.0.3(transitive)
- Removedfill-range@7.1.1(transitive)
- Removedis-number@7.0.0(transitive)
- Removedmicromatch@4.0.8(transitive)
- Removedpicomatch@2.3.1(transitive)
- Removedto-regex-range@5.0.1(transitive)