ota-meshi/jsonc-eslint-parser

Node engine regression

Badisi opened this issue · 3 comments

Issue

The upgrade of eslint-visitor-keys to v3 had an impact to your package's required node engine version.

error eslint-visitor-keys@3.0.0: The engine "node" is incompatible with this module. Expected version "^12.22.0 || ^14.17.0 || >=16.0.0". Got "10.0.0"
error Found incompatible module.

Explanation

eslint-visitor-keys@v3 now requires : "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
https://github.com/eslint/eslint-visitor-keys/blob/main/package.json#L22

Which makes your package no more compatible with node < 12.22.0
https://github.com/ota-meshi/jsonc-eslint-parser/blob/master/package.json#L10

You can also use eslint-visitor-keys v1.3.0. So I think it's compatible with node v8, am I misunderstanding?

https://github.com/ota-meshi/jsonc-eslint-parser/blob/master/package.json#L74

Sorry, I think I should better explain my use case.

I'm not using jsonc-eslint-parser directly.
Instead I'm using eslint-plugin-jsonc which uses jsonc-eslint-parser as a direct dependency.

My application is required to run under node 10 (nothing I can change about that).

Few months ago

My dependency graph was as follow :

"eslint-plugin-jsonc": "^1.2.1"                                         # was resolving to 1.3.1
└──  "jsonc-eslint-parser": "^1.0.0"                                    # was resolving to 1.0.1
      └──  "eslint-visitor-keys": "^2.0.0"                              # was resolving to 2.1.0
            └──  requires "node": ">=10"

This was giving me no error during dependency installation on node 10.

Today

I didn't change anything on my side, but the dependency graph changed to :

"eslint-plugin-jsonc": "^1.2.1"                                         # resolves to 1.6.0
└──  "jsonc-eslint-parser": "^1.2.0"                                    # resolves to 1.3.0
      └──  "eslint-visitor-keys": "^1.3.0 || ^2.1.0 || ^3.0.0"          # resolves to 3.0.0
            └──  requires "node": "^12.22.0 || ^14.17.0 || >=16.0.0"

As you can see I have now no choice but to migrate to at least node 12.22.0.

error eslint-visitor-keys@3.0.0: The engine "node" is incompatible with this module. Expected version "^12.22.0 || ^14.17.0 || >=16.0.0". Got "10.0.0"
error Found incompatible module.

Personal thought

To me this is a breaking change and I think that migrating to eslint-visitor-keys v3 should have been a major change for jsonc-eslint-parser (ie. moving to v2.0.0, and also upgrading the node engine requirement).

And there is nothing I can really do now, expect maybe downgrading eslint-plugin-jsonc to a version older enough that it will brings me eslint-visitor-keys prior to v3...

Thank you for information.
I was expecting the modules that depend on the ESLint you are using to be used.
I found that it didn't work as expected, so I need to downgrade the dependencies.