Gathering detailed insights and metrics for eslint-plugin-node-dependencies
Gathering detailed insights and metrics for eslint-plugin-node-dependencies
Gathering detailed insights and metrics for eslint-plugin-node-dependencies
Gathering detailed insights and metrics for eslint-plugin-node-dependencies
npm install eslint-plugin-node-dependencies
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
15 Stars
217 Commits
3 Watching
7 Branches
2 Contributors
Updated on 05 Nov 2024
TypeScript (96.63%)
JavaScript (2.24%)
Dockerfile (1.12%)
Cumulative downloads
Total Downloads
Last day
-41.6%
1,669
Compared to previous day
Last week
-39%
8,869
Compared to previous week
Last month
160.1%
49,003
Compared to previous month
Last year
86.2%
229,290
Compared to previous year
1
45
eslint-plugin-node-dependencies is ESLint plugin to check Node.js dependencies.
::: This Plugin is still in an EXPERIMENTAL STATE :::
This ESLint plugin checks package.json
and provides linting rules related to dependencies problems.
See documents.
1npm install --save-dev eslint eslint-plugin-node-dependencies
Requirements
- ESLint v6.0.0 and above
- Node.js v14.16.0 and above
Add node-dependencies
to the plugins section of your eslint.config.js
or .eslintrc
configuration file (you can omit the eslint-plugin-
prefix)
and either use one of the two configurations available (recommended
) or configure the rules you want:
The plugin.configs["flat/recommended"]
config enables a subset of the rules that should be most useful to most users.
See lib/configs/rules/recommended.ts for more details.
1// eslint.config.js 2import * as nodeDependenciesPlugin from "eslint-plugin-node-dependencies" 3 4export default [ 5 ...nodeDependenciesPlugin.configs["flat/recommended"], 6];
The plugin:node-dependencies/recommended
config enables a subset of the rules that should be most useful to most users.
See lib/configs/rules/recommended.ts for more details.
1// .eslintrc.js 2module.exports = { 3 "plugins": [ 4 "node-dependencies" 5 ], 6 "extends": [ 7 // add more generic rulesets here, such as: 8 // 'eslint:recommended', 9 "plugin:node-dependencies/recommended" 10 ] 11}
Override/add specific rules configurations. See also: http://eslint.org/docs/user-guide/configuring.
1// eslint.config.js 2import * as nodeDependenciesPlugin from "eslint-plugin-node-dependencies" 3 4export default [ 5 { 6 plugins: { "node-dependencies": nodeDependenciesPlugin } 7 rules: { 8 // Override/add rules settings here, such as: 9 "node-dependencies/rule-name": "error" 10 } 11 } 12];
1// .eslintrc.js 2module.exports = { 3 "plugins": [ 4 "node-dependencies" 5 ], 6 "rules": { 7 // Override/add rules settings here, such as: 8 "node-dependencies/rule-name": "error" 9 } 10}
If you have specified a parser, you need to configure a parser for .json
.
For example, if you are using the "@babel/eslint-parser"
, configure it as follows:
1module.exports = { 2 // ... 3 extends: [ "plugin:node-dependencies/recommended"], 4 // ... 5 parser: "@babel/eslint-parser", 6 // Add an `overrides` section to add a parser configuration for json. 7 overrides: [ 8 { 9 files: ["*.json", "*.json5"], 10 parser: "jsonc-eslint-parser", 11 }, 12 ], 13 // ... 14};
The --fix
option on the command line automatically fixes problems reported by rules which have a wrench :wrench: below.
The rules with the following star :star: are included in the plugin:node-dependencies/recommended
config.
Rule ID | Description | |
---|---|---|
node-dependencies/compat-engines | enforce the versions of the engines of the dependencies to be compatible. | :star: |
node-dependencies/no-dupe-deps | disallow duplicate dependencies. | :star: |
node-dependencies/valid-semver | enforce versions that is valid as a semantic version. | :star: |
Rule ID | Description | |
---|---|---|
node-dependencies/absolute-version | require or disallow absolute version of dependency. | |
node-dependencies/no-deprecated | disallow having dependencies on deprecate packages. | |
node-dependencies/no-restricted-deps | Disallows dependence on the specified package. |
Rule ID | Description | |
---|---|---|
node-dependencies/prefer-caret-range-version | require caret(^ ) version instead of range version. | :wrench: |
node-dependencies/prefer-tilde-range-version | require tilde(~ ) version instead of range version. | :wrench: |
Rule ID | Replaced by |
---|---|
node-dependencies/valid-engines | node-dependencies/compat-engines |
You can verify the JSON files by checking and installing eslint-plugin-jsonc.
You can verify using JSON Schema by checking and installing eslint-plugin-json-schema-validator.
Welcome contributing!
Please use GitHub's Issues/PRs.
npm test
runs tests and measures coverage.npm run update
runs in order to update readme and recommended configuration.npm run new [new rule name]
runs to create the files needed for the new rule.npm run docs:watch
starts the website locally.See the LICENSE file for license rights and limitations (MIT).
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
7 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 5
Reason
Found 0/24 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn Moreeslint-import-resolver-node
Node default behavior import resolution plugin for eslint-plugin-import.
eslint-plugin-node
Additional ESLint's rules for Node.js
eslint-config-standard
JavaScript Standard Style - ESLint Shareable Config
eslint-plugin-react-hooks
ESLint rules for React Hooks