eslint-plugin-node-dependencies 1.1.0 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -11,7 +11,7 @@
11
11
  [![NPM downloads](https://img.shields.io/npm/dm/eslint-plugin-node-dependencies.svg)](http://www.npmtrends.com/eslint-plugin-node-dependencies)
12
12
  [![NPM downloads](https://img.shields.io/npm/dy/eslint-plugin-node-dependencies.svg)](http://www.npmtrends.com/eslint-plugin-node-dependencies)
13
13
  [![NPM downloads](https://img.shields.io/npm/dt/eslint-plugin-node-dependencies.svg)](http://www.npmtrends.com/eslint-plugin-node-dependencies)
14
- [![Build Status](https://github.com/ota-meshi/eslint-plugin-node-dependencies/workflows/CI/badge.svg?branch=main)](https://github.com/ota-meshi/eslint-plugin-node-dependencies/actions?query=workflow%3ACI)
14
+ [![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)
15
15
  [![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)
16
16
 
17
17
  ## :name_badge: Features
@@ -153,25 +153,29 @@ exports.default = (0, utils_1.createRule)("compat-engines", {
153
153
  for (const module of ctx.engines) {
154
154
  const selfVer = selfEngines.get(module);
155
155
  const engineValue = depEngines.get(module);
156
- if (engineValue) {
156
+ if (engineValue && engineValue !== "*") {
157
157
  ctx.markAsProcessed(module);
158
- const depVer = (0, semver_2.getSemverRange)(engineValue);
159
- if (depVer) {
160
- if (semver_1.default.subset(selfVer.adjust, buildAdjustRangeForDeps(comparisonType, depVer))) {
161
- ctx.markAsValid(module);
162
- }
163
- else {
164
- ctx.addInvalid(module, depVer);
165
- }
166
- }
158
+ }
159
+ const depVer = (0, semver_2.getSemverRange)(engineValue || "*");
160
+ if (!depVer) {
161
+ continue;
162
+ }
163
+ if (semver_1.default.subset(selfVer.adjust, buildAdjustRangeForDeps(comparisonType, depVer))) {
164
+ ctx.markAsValid(module);
165
+ }
166
+ else {
167
+ ctx.addInvalid(module, depVer);
167
168
  }
168
169
  }
169
170
  }
170
171
  function processDependencyModule(ctx, name, ver, modules, node) {
171
172
  const currModules = [...modules, `${name}@${ver}`];
172
- processMeta(ctx, (0, meta_1.getMetaFromNodeModules)(name, ver, { context }));
173
- if (!ctx.hasInvalid() && ctx.isAllProcessed()) {
174
- return;
173
+ const nodeModulesMeta = (0, meta_1.getMetaFromNodeModules)(name, ver, { context });
174
+ if (nodeModulesMeta) {
175
+ processMeta(ctx, nodeModulesMeta);
176
+ if (!ctx.hasInvalid() && ctx.isAllProcessed()) {
177
+ return;
178
+ }
175
179
  }
176
180
  const metaData = (0, meta_1.getMetaFromNpm)(name, ver);
177
181
  for (const meta of metaData.cache) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-node-dependencies",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "ESLint plugin to check Node.js dependencies.",
5
5
  "repository": "git+https://github.com/ota-meshi/eslint-plugin-node-dependencies.git",
6
6
  "homepage": "https://github.com/ota-meshi/eslint-plugin-node-dependencies#readme",