From 4d282100eab2ace49102d2eea135b3950155c44a Mon Sep 17 00:00:00 2001 From: Colum Ferry Date: Wed, 26 Jul 2023 11:07:20 +0100 Subject: [PATCH] fix(core): eslint dep check rule should check prereleases correctly --- packages/eslint-plugin/src/rules/dependency-checks.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/eslint-plugin/src/rules/dependency-checks.ts b/packages/eslint-plugin/src/rules/dependency-checks.ts index b539ebd27d6e2..d633b7d7f2010 100644 --- a/packages/eslint-plugin/src/rules/dependency-checks.ts +++ b/packages/eslint-plugin/src/rules/dependency-checks.ts @@ -2,12 +2,7 @@ import { join } from 'path'; import { satisfies } from 'semver'; import { AST } from 'jsonc-eslint-parser'; import { type JSONLiteral } from 'jsonc-eslint-parser/lib/parser/ast'; -import { - normalizePath, - ProjectGraphProjectNode, - FileData, - workspaceRoot, -} from '@nx/devkit'; +import { normalizePath, workspaceRoot } from '@nx/devkit'; import { findNpmDependencies } from '@nx/js/src/utils/find-npm-dependencies'; import { createESLintRule } from '../utils/create-eslint-rule'; @@ -209,7 +204,9 @@ export default createESLintRule({ if ( npmDependencies[packageName] === '*' || packageRange === '*' || - satisfies(npmDependencies[packageName], packageRange) + satisfies(npmDependencies[packageName], packageRange, { + includePrerelease: true, + }) ) { return; }