Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-inker

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-inker - npm Package Compare versions

Comparing version 2.6.9 to 2.6.10

15

dist/rules/enforce-import-name.js
"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

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