{"id":15673960,"url":"https://github.com/ota-meshi/eslint-plugin-node-dependencies","last_synced_at":"2026-02-22T11:52:02.923Z","repository":{"id":37049699,"uuid":"394911939","full_name":"ota-meshi/eslint-plugin-node-dependencies","owner":"ota-meshi","description":"ESLint plugin to check Node.js dependencies.","archived":false,"fork":false,"pushed_at":"2025-02-18T13:41:54.000Z","size":350,"stargazers_count":16,"open_issues_count":11,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-16T13:35:31.173Z","etag":null,"topics":["eslint-plugin","nodejs","package-json"],"latest_commit_sha":null,"homepage":"https://ota-meshi.github.io/eslint-plugin-node-dependencies/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ota-meshi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"ota-meshi"}},"created_at":"2021-08-11T08:03:18.000Z","updated_at":"2025-01-29T13:06:24.000Z","dependencies_parsed_at":"2023-10-17T06:51:04.671Z","dependency_job_id":"a202609a-881a-4990-9d81-b12eb963485b","html_url":"https://github.com/ota-meshi/eslint-plugin-node-dependencies","commit_stats":{"total_commits":216,"total_committers":4,"mean_commits":54.0,"dds":0.5092592592592593,"last_synced_commit":"6c9bda4c6ce769de8bd2c761acc8448f9f6625e1"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ota-meshi%2Feslint-plugin-node-dependencies","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ota-meshi%2Feslint-plugin-node-dependencies/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ota-meshi%2Feslint-plugin-node-dependencies/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ota-meshi%2Feslint-plugin-node-dependencies/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ota-meshi","download_url":"https://codeload.github.com/ota-meshi/eslint-plugin-node-dependencies/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245644202,"owners_count":20649153,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eslint-plugin","nodejs","package-json"],"created_at":"2024-10-03T15:43:13.203Z","updated_at":"2026-02-22T11:52:02.915Z","avatar_url":"https://github.com/ota-meshi.png","language":"TypeScript","funding_links":["https://github.com/sponsors/ota-meshi"],"categories":[],"sub_categories":[],"readme":"# Introduction\n\n[eslint-plugin-node-dependencies](https://www.npmjs.com/package/eslint-plugin-node-dependencies) is ESLint plugin to check Node.js dependencies.\n\n::: This Plugin is still in an EXPERIMENTAL STATE :::\n\n[![NPM license](https://img.shields.io/npm/l/eslint-plugin-node-dependencies.svg)](https://www.npmjs.com/package/eslint-plugin-node-dependencies)\n[![NPM version](https://img.shields.io/npm/v/eslint-plugin-node-dependencies.svg)](https://www.npmjs.com/package/eslint-plugin-node-dependencies)\n[![NPM downloads](https://img.shields.io/badge/dynamic/json.svg?label=downloads\u0026colorB=green\u0026suffix=/day\u0026query=$.downloads\u0026uri=https://api.npmjs.org//downloads/point/last-day/eslint-plugin-node-dependencies\u0026maxAge=3600)](http://www.npmtrends.com/eslint-plugin-node-dependencies)\n[![NPM downloads](https://img.shields.io/npm/dw/eslint-plugin-node-dependencies.svg)](http://www.npmtrends.com/eslint-plugin-node-dependencies)\n[![NPM downloads](https://img.shields.io/npm/dm/eslint-plugin-node-dependencies.svg)](http://www.npmtrends.com/eslint-plugin-node-dependencies)\n[![NPM downloads](https://img.shields.io/npm/dy/eslint-plugin-node-dependencies.svg)](http://www.npmtrends.com/eslint-plugin-node-dependencies)\n[![NPM downloads](https://img.shields.io/npm/dt/eslint-plugin-node-dependencies.svg)](http://www.npmtrends.com/eslint-plugin-node-dependencies)\n[![Build Status](https://github.com/ota-meshi/eslint-plugin-node-dependencies/actions/workflows/NodeCI.yml/badge.svg?branch=main)](https://github.com/ota-meshi/eslint-plugin-node-dependencies/actions/workflows/NodeCI.yml?query=branch%3Amain)\n[![Coverage Status](https://coveralls.io/repos/github/ota-meshi/eslint-plugin-node-dependencies/badge.svg?branch=main)](https://coveralls.io/github/ota-meshi/eslint-plugin-node-dependencies?branch=main)\n\n## :name_badge: Features\n\nThis ESLint plugin checks `package.json` and provides linting rules related to dependencies problems.\n\n\u003c!--DOCS_IGNORE_START--\u003e\n\n## :book: Documentation\n\nSee [documents](https://ota-meshi.github.io/eslint-plugin-node-dependencies/).\n\n## :cd: Installation\n\n```bash\nnpm install --save-dev eslint eslint-plugin-node-dependencies\n```\n\n\u003e **Requirements**\n\u003e\n\u003e - ESLint v6.0.0 and above\n\u003e - Node.js v14.16.0 and above\n\n\u003c!--DOCS_IGNORE_END--\u003e\n\n## :book: Usage\n\n\u003c!--USAGE_SECTION_START--\u003e\n\nAdd `node-dependencies` to the plugins section of your `eslint.config.js` or `.eslintrc` configuration file (you can omit the `eslint-plugin-` prefix)  \nand either use one of the two configurations available (`recommended`) or configure the rules you want:\n\n### The recommended configuration (New Config)\n\nThe `plugin.configs[\"flat/recommended\"]` config enables a subset of [the rules](#white_check_mark-rules) that should be most useful to most users.\n*See [lib/configs/rules/recommended.ts](https://github.com/ota-meshi/eslint-plugin-node-dependencies/blob/main/lib/configs/rules/recommended.ts) for more details.*\n\n```js\n// eslint.config.js\nimport * as nodeDependenciesPlugin from \"eslint-plugin-node-dependencies\"\n\nexport default [\n    ...nodeDependenciesPlugin.configs[\"flat/recommended\"],\n];\n```\n\n### The recommended configuration (Legacy Config)\n\nThe `plugin:node-dependencies/recommended` config enables a subset of [the rules](#white_check_mark-rules) that should be most useful to most users.\n*See [lib/configs/rules/recommended.ts](https://github.com/ota-meshi/eslint-plugin-node-dependencies/blob/main/lib/configs/rules/recommended.ts) for more details.*\n\n```js\n// .eslintrc.js\nmodule.exports = {\n    \"plugins\": [\n        \"node-dependencies\"\n    ],\n    \"extends\": [\n         // add more generic rulesets here, such as:\n         // 'eslint:recommended',\n        \"plugin:node-dependencies/recommended\"\n    ]\n}\n```\n\n### Advanced Configuration\n\nOverride/add specific rules configurations. *See also: [http://eslint.org/docs/user-guide/configuring](http://eslint.org/docs/user-guide/configuring)*.\n\n```js\n// eslint.config.js\nimport * as nodeDependenciesPlugin from \"eslint-plugin-node-dependencies\"\n\nexport default [\n    {\n        plugins: { \"node-dependencies\": nodeDependenciesPlugin }\n        rules: {\n            // Override/add rules settings here, such as:\n            \"node-dependencies/rule-name\": \"error\"\n        }\n    }\n];\n```\n\n```js\n// .eslintrc.js\nmodule.exports = {\n    \"plugins\": [\n        \"node-dependencies\"\n    ],\n    \"rules\": {\n        // Override/add rules settings here, such as:\n        \"node-dependencies/rule-name\": \"error\"\n    }\n}\n```\n\n#### Parser Configuration\n\nIf you have specified a parser, you need to configure a parser for `.json`.\n\nFor example, if you are using the `\"@babel/eslint-parser\"`, configure it as follows:\n\n```js\nmodule.exports = {\n  // ...\n  extends: [ \"plugin:node-dependencies/recommended\"],\n  // ...\n  parser: \"@babel/eslint-parser\",\n  // Add an `overrides` section to add a parser configuration for json.\n  overrides: [\n    {\n      files: [\"*.json\", \"*.json5\"],\n      parser: \"jsonc-eslint-parser\",\n    },\n  ],\n  // ...\n};\n```\n\n\u003c!--USAGE_SECTION_END--\u003e\n\n## :white_check_mark: Rules\n\n\u003c!--RULES_SECTION_START--\u003e\n\nThe `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) automatically fixes problems reported by rules which have a wrench :wrench: below.\nThe rules with the following star :star: are included in the `plugin:node-dependencies/recommended` config.\n\n\u003c!--RULES_TABLE_START--\u003e\n\n### Possible Errors\n\n| Rule ID | Description |    |\n|:--------|:------------|:---|\n| [node-dependencies/compat-engines](https://ota-meshi.github.io/eslint-plugin-node-dependencies/rules/compat-engines.html) | enforce the versions of the engines of the dependencies to be compatible. | :star: |\n| [node-dependencies/no-dupe-deps](https://ota-meshi.github.io/eslint-plugin-node-dependencies/rules/no-dupe-deps.html) | disallow duplicate dependencies. | :star: |\n| [node-dependencies/valid-semver](https://ota-meshi.github.io/eslint-plugin-node-dependencies/rules/valid-semver.html) | enforce versions that is valid as a semantic version. | :star: |\n\n### Best Practices\n\n| Rule ID | Description |    |\n|:--------|:------------|:---|\n| [node-dependencies/absolute-version](https://ota-meshi.github.io/eslint-plugin-node-dependencies/rules/absolute-version.html) | require or disallow absolute version of dependency. |  |\n| [node-dependencies/no-deprecated](https://ota-meshi.github.io/eslint-plugin-node-dependencies/rules/no-deprecated.html) | disallow having dependencies on deprecate packages. |  |\n| [node-dependencies/no-restricted-deps](https://ota-meshi.github.io/eslint-plugin-node-dependencies/rules/no-restricted-deps.html) | Disallows dependence on the specified package. |  |\n| [node-dependencies/require-provenance-deps](https://ota-meshi.github.io/eslint-plugin-node-dependencies/rules/require-provenance-deps.html) | Require provenance information for dependencies |  |\n\n### Stylistic Issues\n\n| Rule ID | Description |    |\n|:--------|:------------|:---|\n| [node-dependencies/prefer-caret-range-version](https://ota-meshi.github.io/eslint-plugin-node-dependencies/rules/prefer-caret-range-version.html) | require caret(`^`) version instead of range version. | :wrench: |\n| [node-dependencies/prefer-tilde-range-version](https://ota-meshi.github.io/eslint-plugin-node-dependencies/rules/prefer-tilde-range-version.html) | require tilde(`~`) version instead of range version. | :wrench: |\n\n### Deprecated\n\n- :warning: We're going to remove deprecated rules in the next major release. Please migrate to successor/new rules.\n- :innocent: We don't fix bugs which are in deprecated rules since we don't have enough resources.\n\n| Rule ID | Replaced by |\n|:--------|:------------|\n| [node-dependencies/valid-engines](https://ota-meshi.github.io/eslint-plugin-node-dependencies/rules/valid-engines.html) | [node-dependencies/compat-engines](https://ota-meshi.github.io/eslint-plugin-node-dependencies/rules/compat-engines.html.md) |\n\n\u003c!--RULES_TABLE_END--\u003e\n\u003c!--RULES_SECTION_END--\u003e\n\n## :rocket: To Do More Verification\n\n### Verify JSON\n\nYou can verify the JSON files by checking and installing [eslint-plugin-jsonc].\n\n### Verify using JSON Schema\n\nYou can verify using JSON Schema by checking and installing [eslint-plugin-json-schema-validator].\n\n\u003c!-- ## :gear: Settings\n\nSee [Settings](https://ota-meshi.github.io/eslint-plugin-node-dependencies/settings/). --\u003e\n\n\u003c!--DOCS_IGNORE_START--\u003e\n\n\u003c!-- ## :traffic_light: Semantic Versioning Policy\n\n**eslint-plugin-jsonc** follows [Semantic Versioning](http://semver.org/) and [ESLint's Semantic Versioning Policy](https://github.com/eslint/eslint#semantic-versioning-policy). --\u003e\n\n## :beers: Contributing\n\nWelcome contributing!\n\nPlease use GitHub's Issues/PRs.\n\n### Development Tools\n\n- `npm test` runs tests and measures coverage.\n- `npm run update` runs in order to update readme and recommended configuration.\n- `npm run new [new rule name]` runs to create the files needed for the new rule.\n- `npm run docs:watch` starts the website locally.\n\n\u003c!--DOCS_IGNORE_END--\u003e\n\n## :couple: Related Packages\n\n- [eslint-plugin-jsonc](https://github.com/ota-meshi/eslint-plugin-jsonc) ... ESLint plugin for JSON, JSON with comments (JSONC) and JSON5.\n- [eslint-plugin-json-schema-validator](https://github.com/ota-meshi/eslint-plugin-json-schema-validator) ... ESLint plugin that validates data using JSON Schema Validator.\n- [jsonc-eslint-parser](https://github.com/ota-meshi/jsonc-eslint-parser) ... JSON, JSONC and JSON5 parser for use with ESLint plugins.\n\n## :lock: License\n\nSee the [LICENSE](LICENSE) file for license rights and limitations (MIT).\n\n[eslint-plugin-jsonc]: https://github.com/ota-meshi/eslint-plugin-jsonc\n[eslint-plugin-json-schema-validator]: https://github.com/ota-meshi/eslint-plugin-json-schema-validator\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fota-meshi%2Feslint-plugin-node-dependencies","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fota-meshi%2Feslint-plugin-node-dependencies","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fota-meshi%2Feslint-plugin-node-dependencies/lists"}