feat(eslint-config): move eslint and typescript-eslint to peer deps#174
Conversation
Under strict package managers (pnpm v10+), transitive dependencies are no longer exposed at the project root, which broke eslint bin resolution and 'import ... from typescript-eslint' in consuming projects. Declaring them as peers guarantees a single, project-controlled instance of each. Also drops the redundant @typescript-eslint/eslint-plugin and @typescript-eslint/parser direct deps (provided by the typescript-eslint umbrella). eslint-config-prettier, eslint-plugin-prettier and globals stay bundled. BREAKING CHANGE: consumers must now install eslint and typescript-eslint.
🦋 Changeset detectedLatest commit: bbd54e6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
eslint ^10.0.0, typescript-eslint ^8.0.0, prettier ^3.0.0 — one caret on the current latest major for each, consistently.
There was a problem hiding this comment.
Pull request overview
This PR updates @fingerprintjs/eslint-config-dx-team to rely on project-provided ESLint/TypeScript-ESLint (via peer dependencies) to avoid pnpm v10+ strict-layout resolution issues, and documents the new installation expectations.
Changes:
- Move
eslintandtypescript-eslintfromdependenciestopeerDependenciesfor@fingerprintjs/eslint-config-dx-teamand remove redundant direct@typescript-eslint/*deps. - Add
typescript-eslintto the root workspace devDependencies and update lockfile accordingly. - Update
eslint-config-dx-teamREADME and add a major changeset describing the breaking change.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Updates workspace lock entries for the new dependency/peer-dependency layout. |
| packages/eslint-config-dx-team/README.md | Updates consumer-facing install/requirements guidance for the new peer dependency model. |
| packages/eslint-config-dx-team/package.json | Moves ESLint + TypeScript-ESLint to peers; keeps only internally-imported tooling bundled. |
| package.json | Adds typescript-eslint to root devDependencies to dogfood the new peer requirement. |
| .changeset/eslint-config-peer-deps.md | Adds a major changeset documenting the breaking change for consumers. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
🚀 Following releases will be created using changesets from this PR:@fingerprintjs/eslint-config-dx-team@3.0.0Major Changes
|
This PR will create a major release 🚀
|
Coverage report
Test suite run success15 tests passing in 7 suites. Report generated by 🧪jest coverage report action from bbd54e6 Show full coverage report
|
eslintandtypescript-eslintfromdependenciestopeerDependenciesineslint-config-dx-team.@typescript-eslint/eslint-pluginand@typescript-eslint/parserdirect deps — they're provided by thetypescript-eslintumbrella and neverrequired directly by the config.eslint-config-prettier,eslint-plugin-prettier, andglobalsbundled (only imported inside the config, so they resolve fine under strict layouts).typescript-eslintto the root workspace devDeps to dogfood the new peer, update the README, add a major changeset.Why: under pnpm v10+ transitive deps are no longer hoisted to the project root, so bundling
eslint/typescript-eslintbroke theeslintbin andimport ... from 'typescript-eslint'in consumer configs (see the node-sdk pnpm upgrade thread). Peers guarantee a single, project-controlled instance of each and avoid "multiple ESLint instances" errors.Discussion point: this is the "peer deps with range" outcome, not "bundle everything"
This reverses the previous README guidance — consumers now install
eslint+typescript-eslintthemselves. We lose the "don't repeat in client repos" property for those two packages, but they're the two the consumer actually imports directly, so declaring them is the correct/portable model. Everything else stays bundled.prettierwas already a peer. Alternative considered:publicHoistPatternin each repo (pnpm-specific escape hatch that keeps the phantom dependency).Peer version ranges
Pinned to the current latest major for each, caret-style:
eslint: "^10.0.0",typescript-eslint: "^8.0.0",prettier: "^3.0.0". Note this drops eslint 9 support (the config useseslint/configflat-config APIs and the toolkit already ships eslint 10) — consumers on eslint 9 would see a peer warning and should bump.Breaking change
Major bump (2.0.0 → 3.0.0 via changeset). Consuming repos must add
eslintandtypescript-eslintto their devDeps when upgrading; the first will be node-sdk#259.Note: unrelated lint error on main
pnpm lintreports one pre-existingprettier/prettiererror in.github/actions/update-sdk-schema/update-schema.test.ts(trailing whitespace, present onmain, untouched by this PR). Left as-is to keep the diff focused.