I have an application (application-x
) that depends on a package I control with eslint configs: my-eslint-config
.
In my-eslint-config
the dependencies looks like this:
"peerDependencies": {
"@stylistic/eslint-plugin": ">=2.1.0",
"@types/eslint": ">=8.56.10",
"@typescript-eslint/eslint-plugin": ">=7.11.0",
"@typescript-eslint/parser": ">=7.11.0",
"eslint": ">=8.57.0",
"eslint-config-xo": ">=0.45.0",
"eslint-config-xo-space": ">=0.35.0",
"eslint-config-xo-typescript": ">=4.0.0",
"eslint-import-resolver-typescript": ">=3.6.1",
"eslint-plugin-import-newlines": ">=1.4.0",
"eslint-plugin-jest": ">=28.5.0",
"eslint-plugin-jest-formatting": ">=3.1.0"
}
I have all eslint configs and dependencies setup in this package.
In my application I have NO dependencies on these sub-packages. I ONLY have a dependency on my my-eslint-config
package.
I have renovate setup to update my packages in application-x
automatically. But I get dependency conflicts when trying to update the packages automatically:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/my-eslint-config
npm ERR! dev my-eslint-config@"^0.10.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev my-eslint-config@"^0.10.3" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/eslint-config-xo
npm ERR! peer eslint-config-xo@">=0.45.0" from [email protected]
npm ERR! node_modules/my-eslint-config
npm ERR! dev my-eslint-config@"^0.10.3" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
It seems like when trying to upgrade my-eslint-config
it gets a conflict with the peer dependencies of the previous version of my-eslint-config
?
I guess that this is how peer dependencies work?
Possible solutions:
- Set the actual dependencies in application-x. This probably helps but I have multiple applications and I dont want to manage the updates in each single application.
- Move the peer dependencies to normal dependencies. Not sure if this works if eslint will look in package/node-modules folder for dependencies?
Any other suggestions?