Socket
Socket
Sign inDemoInstall

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 9.1.0 to 9.2.0

lib/rules/no-callback-literal.js

1

lib/index.js

@@ -15,2 +15,3 @@ /* DON'T EDIT THIS FILE. This is generated by 'scripts/update-lib-index.js' */

"file-extension-in-import": require("./rules/file-extension-in-import"),
"no-callback-literal": require("./rules/no-callback-literal"),
"no-deprecated-api": require("./rules/no-deprecated-api"),

@@ -17,0 +18,0 @@ "no-extraneous-import": require("./rules/no-extraneous-import"),

2

lib/rules/exports-style.js

@@ -149,3 +149,3 @@ /**

url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.1.0/docs/rules/exports-style.md",
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.2.0/docs/rules/exports-style.md",
},

@@ -152,0 +152,0 @@ type: "suggestion",

@@ -42,3 +42,3 @@ /**

url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.1.0/docs/rules/file-extension-in-import.md",
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.2.0/docs/rules/file-extension-in-import.md",
},

@@ -45,0 +45,0 @@ fixable: "code",

@@ -716,3 +716,3 @@ /**

url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.1.0/docs/rules/no-deprecated-api.md",
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.2.0/docs/rules/no-deprecated-api.md",
},

@@ -719,0 +719,0 @@ type: "problem",

@@ -22,3 +22,3 @@ /**

url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.1.0/docs/rules/no-extraneous-import.md",
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.2.0/docs/rules/no-extraneous-import.md",
},

@@ -25,0 +25,0 @@ type: "problem",

@@ -22,3 +22,3 @@ /**

url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.1.0/docs/rules/no-extraneous-require.md",
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.2.0/docs/rules/no-extraneous-require.md",
},

@@ -25,0 +25,0 @@ type: "problem",

@@ -58,3 +58,3 @@ /**

url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.1.0/docs/rules/no-hide-core-modules.md",
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.2.0/docs/rules/no-hide-core-modules.md",
},

@@ -61,0 +61,0 @@ type: "problem",

@@ -21,3 +21,3 @@ /**

url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.1.0/docs/rules/no-missing-import.md",
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.2.0/docs/rules/no-missing-import.md",
},

@@ -24,0 +24,0 @@ type: "problem",

@@ -21,3 +21,3 @@ /**

url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.1.0/docs/rules/no-missing-require.md",
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.2.0/docs/rules/no-missing-require.md",
},

@@ -24,0 +24,0 @@ type: "problem",

@@ -39,3 +39,3 @@ /**

url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.1.0/docs/rules/no-unpublished-bin.md",
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.2.0/docs/rules/no-unpublished-bin.md",
},

@@ -42,0 +42,0 @@ type: "problem",

@@ -22,3 +22,3 @@ /**

url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.1.0/docs/rules/no-unpublished-import.md",
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.2.0/docs/rules/no-unpublished-import.md",
},

@@ -25,0 +25,0 @@ type: "problem",

@@ -22,3 +22,3 @@ /**

url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.1.0/docs/rules/no-unpublished-require.md",
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.2.0/docs/rules/no-unpublished-require.md",
},

@@ -25,0 +25,0 @@ type: "problem",

@@ -1002,3 +1002,3 @@ /**

*/
function nomalizeScope(initialScope, node) {
function normalizeScope(initialScope, node) {
let scope = getInnermostScope(initialScope, node)

@@ -1055,3 +1055,3 @@

url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.1.0/docs/rules/no-unsupported-features.md",
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.2.0/docs/rules/no-unsupported-features.md",
},

@@ -1174,3 +1174,3 @@ type: "problem",

})
} else if (!nomalizeScope(context.getScope(), node).isStrict) {
} else if (!normalizeScope(context.getScope(), node).isStrict) {
context.report({

@@ -1177,0 +1177,0 @@ node,

@@ -132,3 +132,3 @@ /**

url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.1.0/docs/rules/no-unsupported-features/es-builtins.md",
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.2.0/docs/rules/no-unsupported-features/es-builtins.md",
},

@@ -135,0 +135,0 @@ type: "problem",

@@ -375,3 +375,3 @@ /**

*/
function nomalizeScope(initialScope, node) {
function normalizeScope(initialScope, node) {
let scope = getInnermostScope(initialScope, node)

@@ -430,3 +430,3 @@

get isStrict() {
return nomalizeScope(context.getScope(), this.node).isStrict
return normalizeScope(context.getScope(), this.node).isStrict
},

@@ -509,3 +509,3 @@ }

url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.1.0/docs/rules/no-unsupported-features/es-syntax.md",
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.2.0/docs/rules/no-unsupported-features/es-syntax.md",
},

@@ -512,0 +512,0 @@ type: "problem",

@@ -268,3 +268,3 @@ /**

url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.1.0/docs/rules/no-unsupported-features/node-builtins.md",
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.2.0/docs/rules/no-unsupported-features/node-builtins.md",
},

@@ -271,0 +271,0 @@ type: "problem",

@@ -29,3 +29,3 @@ /**

url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.1.0/docs/rules/prefer-global/buffer.md",
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.2.0/docs/rules/prefer-global/buffer.md",
},

@@ -32,0 +32,0 @@ type: "suggestion",

@@ -26,3 +26,3 @@ /**

url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.1.0/docs/rules/prefer-global/console.md",
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.2.0/docs/rules/prefer-global/console.md",
},

@@ -29,0 +29,0 @@ type: "suggestion",

@@ -26,3 +26,3 @@ /**

url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.1.0/docs/rules/prefer-global/process.md",
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.2.0/docs/rules/prefer-global/process.md",
},

@@ -29,0 +29,0 @@ type: "suggestion",

@@ -29,3 +29,3 @@ /**

url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.1.0/docs/rules/prefer-global/text-decoder.md",
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.2.0/docs/rules/prefer-global/text-decoder.md",
},

@@ -32,0 +32,0 @@ type: "suggestion",

@@ -29,3 +29,3 @@ /**

url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.1.0/docs/rules/prefer-global/text-encoder.md",
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.2.0/docs/rules/prefer-global/text-encoder.md",
},

@@ -32,0 +32,0 @@ type: "suggestion",

@@ -29,3 +29,3 @@ /**

url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.1.0/docs/rules/prefer-global/url-search-params.md",
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.2.0/docs/rules/prefer-global/url-search-params.md",
},

@@ -32,0 +32,0 @@ type: "suggestion",

@@ -28,3 +28,3 @@ /**

url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.1.0/docs/rules/prefer-global/url.md",
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.2.0/docs/rules/prefer-global/url.md",
},

@@ -31,0 +31,0 @@ type: "suggestion",

@@ -39,3 +39,3 @@ /**

url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.1.0/docs/rules/prefer-promises/dns.md",
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.2.0/docs/rules/prefer-promises/dns.md",
},

@@ -42,0 +42,0 @@ fixable: null,

@@ -45,3 +45,3 @@ /**

url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.1.0/docs/rules/prefer-promises/fs.md",
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.2.0/docs/rules/prefer-promises/fs.md",
},

@@ -48,0 +48,0 @@ fixable: null,

@@ -8,8 +8,13 @@ /**

const CodePathAnalyzer = safeRequire(
"eslint/lib/linter/code-path-analysis/code-path-analyzer",
"eslint/lib/code-path-analysis/code-path-analyzer"
)
const CodePath = safeRequire("eslint/lib/code-path-analysis/code-path")
const CodePathSegment = safeRequire(
"eslint/lib/linter/code-path-analysis/code-path-segment",
"eslint/lib/code-path-analysis/code-path-segment"
)
const CodePath = safeRequire(
"eslint/lib/linter/code-path-analysis/code-path",
"eslint/lib/code-path-analysis/code-path"
)

@@ -21,12 +26,14 @@ const originalLeaveNode =

* Imports a specific module.
*
* @param {string} moduleName - A module name to import.
* @param {...string} moduleNames - module names to import.
* @returns {object|null} The imported object, or null.
*/
function safeRequire(moduleName) {
try {
return require(moduleName)
} catch (_err) {
return null
function safeRequire(...moduleNames) {
for (const moduleName of moduleNames) {
try {
return require(moduleName)
} catch (_err) {
// Ignore.
}
}
return null
}

@@ -149,3 +156,3 @@

url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.1.0/docs/rules/process-exit-as-throw.md",
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.2.0/docs/rules/process-exit-as-throw.md",
},

@@ -152,0 +159,0 @@ type: "problem",

@@ -61,3 +61,3 @@ /**

url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.1.0/docs/rules/shebang.md",
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.2.0/docs/rules/shebang.md",
},

@@ -64,0 +64,0 @@ type: "problem",

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

@@ -16,4 +16,4 @@ "engines": {

"dependencies": {
"eslint-plugin-es": "^1.4.0",
"eslint-utils": "^1.3.1",
"eslint-plugin-es": "^1.4.1",
"eslint-utils": "^1.4.2",
"ignore": "^5.1.1",

@@ -30,2 +30,3 @@ "minimatch": "^3.0.4",

"fast-glob": "^2.2.6",
"globals": "^11.12.0",
"mocha": "^6.1.4",

@@ -40,6 +41,8 @@ "nyc": "^14.0.0",

"clean": "rimraf .nyc_output coverage",
"codecov": "codecov",
"codecov": "nyc report --reporter text-lcov | codecov --pipe --disable=gcov",
"coverage": "opener ./coverage/lcov-report/index.html",
"lint": "eslint lib scripts tests/lib .eslintrc.js",
"pretest": "npm run -s lint",
"test": "nyc npm run -s test:_mocha",
"test:ci": "nyc npm run -s test:_mocha",
"test:_mocha": "_mocha \"tests/lib/**/*.js\" --reporter progress",

@@ -46,0 +49,0 @@ "preversion": "npm t && npm run -s build",

@@ -5,3 +5,3 @@ # eslint-plugin-node

[![Downloads/month](https://img.shields.io/npm/dm/eslint-plugin-node.svg)](http://www.npmtrends.com/eslint-plugin-node)
[![Build Status](https://travis-ci.org/mysticatea/eslint-plugin-node.svg?branch=master)](https://travis-ci.org/mysticatea/eslint-plugin-node)
[![Build Status](https://mysticatea.visualstudio.com/eslint-plugin-node/_apis/build/status/mysticatea.eslint-plugin-node?branchName=master)](https://mysticatea.visualstudio.com/eslint-plugin-node/_build/latest?definitionId=1&branchName=master)
[![Coverage Status](https://codecov.io/gh/mysticatea/eslint-plugin-node/branch/master/graph/badge.svg)](https://codecov.io/gh/mysticatea/eslint-plugin-node)

@@ -68,2 +68,3 @@ [![Dependency Status](https://david-dm.org/mysticatea/eslint-plugin-node.svg)](https://david-dm.org/mysticatea/eslint-plugin-node)

|:--------|:------------|:--:|
| [node/no-callback-literal](./docs/rules/no-callback-literal.md) | ensure Node.js-style error-first callback pattern is followed | |
| [node/no-extraneous-import](./docs/rules/no-extraneous-import.md) | disallow `import` declarations which import extraneous modules | ⭐️ |

@@ -70,0 +71,0 @@ | [node/no-extraneous-require](./docs/rules/no-extraneous-require.md) | disallow `require()` expressions which import extraneous modules | ⭐️ |

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