Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade eslint #155

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

chore: upgrade eslint #155

wants to merge 4 commits into from

Conversation

david-luna
Copy link
Member

Updates eslint to v9 and switches to the new flat config.

@david-luna david-luna requested a review from trentm April 29, 2024 16:58
@david-luna david-luna marked this pull request as draft April 29, 2024 17:05
@david-luna
Copy link
Member Author

with the package-lock.json state from main you can install with warnings. A cleanup of node_modules and a new install gives this error

Run npm ci
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: eslint-plugin-import@2.29.1
npm ERR! Found: eslint@9.1.1
npm ERR! node_modules/eslint
npm ERR!   dev eslint@"^9.1.0" from the root project
npm ERR!   peer eslint@"^6.0.0 || ^7.0.0 || >=8.0.0" from @eslint-community/eslint-utils@[4](https://github.com/elastic/elastic-otel-node/actions/runs/8882442044/job/24387150370?pr=155#step:6:5).4.0
npm ERR!   node_modules/@eslint-community/eslint-utils
npm ERR!     @eslint-community/eslint-utils@"^4.2.0" from eslint@9.1.1
npm ERR!     @eslint-community/eslint-utils@"^4.1.2" from eslint-plugin-es-x@7.[5](https://github.com/elastic/elastic-otel-node/actions/runs/8882442044/job/24387150370?pr=155#step:6:6).0
npm ERR!     node_modules/eslint-plugin-es-x
npm ERR!       eslint-plugin-es-x@"^7.5.0" from eslint-plugin-n@17.3.1
npm ERR!       node_modules/eslint-plugin-n
npm ERR!         dev eslint-plugin-n@"^17.2.0" from the root project
npm ERR!     1 more (eslint-plugin-n)
npm ERR!   5 more (eslint-compat-utils, eslint-config-prettier, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"^2 || ^3 || ^4 || ^5 || ^[6](https://github.com/elastic/elastic-otel-node/actions/runs/8882442044/job/24387150370?pr=155#step:6:7) || ^7.2.0 || ^8" from eslint-plugin-import@2.29.1
npm ERR! node_modules/eslint-plugin-import
npm ERR!   dev eslint-plugin-import@"^2.29.0" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: eslint@8.5[7](https://github.com/elastic/elastic-otel-node/actions/runs/8882442044/job/24387150370?pr=155#step:6:8).0
npm ERR! node_modules/eslint
npm ERR!   peer eslint@"^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^[8](https://github.com/elastic/elastic-otel-node/actions/runs/8882442044/job/24387150370?pr=155#step:6:9)" from eslint-plugin-import@2.2[9](https://github.com/elastic/elastic-otel-node/actions/runs/8882442044/job/24387150370?pr=155#step:6:10).1
npm ERR!   node_modules/eslint-plugin-import
npm ERR!     dev eslint-plugin-import@"^2.29.0" 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.
npm ERR! 
npm ERR! See /home/runner/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2024-04-29T[17](https://github.com/elastic/elastic-otel-node/actions/runs/8882442044/job/24387150370?pr=155#step:6:18)_00_46_673Z-debug-0.log

It's odd this does not happen in apm-agent-nodejs repo.

@trentm
Copy link
Member

trentm commented Apr 29, 2024

It's odd this does not happen in apm-agent-nodejs repo.

Perhaps because apm-agent-nodejs repo has this:

% cat .npmrc
# Workaround unresolvable peerDependencies between graphql, @apollo-server,
# and apollo-server-express. npm v7 (included with node v15) makes these
# peerDependencies issues an install error. Until the community catches up
# and resolves peerDependencies issues or apm-agent-nodejs.git's tests are
# setup to not have competing deps in "devDependencies", we revert to the
# pre-v7 behavior.
# https://docs.npmjs.com/cli/v7/using-npm/config#legacy-peer-deps
legacy-peer-deps=true

@trentm
Copy link
Member

trentm commented Apr 29, 2024

Is there an issue or PR on eslint-plugin-import to have it update its peerDeps to include eslint v9?

@david-luna
Copy link
Member Author

Is there an issue or PR on eslint-plugin-import to have it update its peerDeps to include eslint v9?

There is an issue to add support to eslint@9 import-js/eslint-plugin-import#2948

and theres is a draft PR import-js/eslint-plugin-import#2996 so the peerDependencies will be updated in a newer version

@trentm
Copy link
Member

trentm commented Apr 30, 2024

Wow, that's a big PR change to eslint-plugin-import.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants