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

eslint-plugin-node

Package Overview
Dependencies
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-node - npm Package Compare versions

Comparing version 0.5.0 to 0.5.1

27

lib/util/get-npmignore.js

@@ -25,9 +25,15 @@ /**

var TAIL_SLASH = /\/+$/;
var PARENT_RELATIVE_PATH = /^\.\./;
var NEVER_IGNORED = /^(?:readme\.[^\.]*|(?:licen[cs]e|changes|changelog|history)(?:\.[^\.]*)?)$/i;
/**
* @returns {boolean} `false` always.
* Checks whether or not a given file name is a relative path to a ancestor
* directory.
*
* @param {string} filePath - A file name to check.
* @returns {boolean} `true` if the file name is a relative path to a ancestor
* directory.
*/
function alwaysFalse() {
return false;
function notAncestorFiles(filePath) {
return PARENT_RELATIVE_PATH.test(filePath);
}

@@ -49,7 +55,8 @@

* @param {function} g - A function.
* @returns {function} A logical-or function of `f` and `g`.
* @param {function|null} h - A function.
* @returns {function} A logical-or function of `f`, `g`, and `h`.
*/
function or(f, g) {
function or(f, g, h) {
return function(filePath) {
return f(filePath) || g(filePath);
return f(filePath) || g(filePath) || (h && h(filePath));
};

@@ -156,3 +163,3 @@ }

module.exports = function getNpmignore(startPath) {
var retv = {match: alwaysFalse};
var retv = {match: notAncestorFiles};

@@ -170,9 +177,9 @@ var p = getPackageJson(startPath);

if (filesIgnore && npmignoreIgnore) {
retv.match = and(filterNeverIgnoredFiles(p), or(filesIgnore, npmignoreIgnore));
retv.match = and(filterNeverIgnoredFiles(p), or(notAncestorFiles, filesIgnore, npmignoreIgnore));
}
else if (filesIgnore) {
retv.match = and(filterNeverIgnoredFiles(p), filesIgnore);
retv.match = and(filterNeverIgnoredFiles(p), or(notAncestorFiles, filesIgnore));
}
else if (npmignoreIgnore) {
retv.match = and(filterNeverIgnoredFiles(p), npmignoreIgnore);
retv.match = and(filterNeverIgnoredFiles(p), or(notAncestorFiles, npmignoreIgnore));
}

@@ -179,0 +186,0 @@

{
"name": "eslint-plugin-node",
"version": "0.5.0",
"version": "0.5.1",
"description": "Additional ESLint's rules for Node.js",

@@ -5,0 +5,0 @@ "files": [

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