Skip to content

-i Flag Fails to Ignore Dependencies Specified with Caret (e.g., ^9.7.0) on Windows but not macOS or Linux #111

Open
@Tatious

Description

Environment:

Node.js: v22.13.1
npm: v10.9.2
NX: v20.3.2
Sherif: v1.1.1

Steps to Reproduce:

  1. Create a new NX project with two apps, one with "eslint": "^9.7.0", another with "eslint": "^9.8.0".

  2. Run npm i, followed by npx sherif -i eslint@^9.7.0

Expected Behavior:

Sherif should not report any errors, as the specified version eslint@^9.7.0 is being ignored.

Actual Behavior:

Sherif reports the following error on Windows, but not macOS or Linux:

1 issue found in ./:

 ⨯ error Dependency eslint has multiple versions defined in the workspace. multiple-dependency-versions

      ./                        ^9.8.0   ↑ highest

      .\apps\app2               ^9.8.0   ↑ highest

      .\apps\app1               ^9.7.0   ↓ lowest

1 issue found (1 ⨯, 0 ⚠️, 0 ✓) across 2 packages in 793.5µs.

Observations:

  • The eslint@^9.7.0 version was explicitly ignored using npx sherif -i eslint@^9.7.0.
  • Despite this, Sherif flagged the version mismatch as an error.
  • Testing the same for "eslint": "9.7.0" and "eslint": "9.8.0" does not repro.

Zipped demo:

nx-sherif-demo.zip

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions