Skip to content

Commit ed361e3

Browse files
committed
feat(eslint-config): adopt Option B — eslint+typescript as peers; plugins as deps; caret ranges\n\n- peerDependencies: eslint ^9.0.0, typescript ^5.0.0 only\n- dependencies: move ESLint plugins/configs; use caret ranges per owner\n- devDependencies: eslint ^9.34.0, typescript ^5.9.2, keep @mikecbrant/prettier-config workspace:*\n- update Changeset to state Option B and caret devDeps policy\n- docs: README adds peers, install/usage, and guidance to avoid duplicated flat-config values
1 parent 1fdc12d commit ed361e3

File tree

4 files changed

+53
-33
lines changed

4 files changed

+53
-33
lines changed

.changeset/align-eslint-config-devdeps.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22
"@mikecbrant/eslint-config": major
33
---
44

5-
Breaking change: move ESLint core and all ESLint plugin/config packages from `dependencies` to `peerDependencies`. Consumers must now install these directly in their projects to use this shared config:
5+
Breaking change: adopt Option B dependency model. Only the following are required as peer dependencies for consumers:
66

77
- `eslint`
8+
- `typescript`
9+
10+
All ESLint plugin/config packages are now regular dependencies of `@mikecbrant/eslint-config` and will be installed transitively by consumers (no need to add them directly):
11+
812
- `@typescript-eslint/parser`
913
- `@typescript-eslint/eslint-plugin`
1014
- `eslint-config-xo-typescript`
@@ -14,4 +18,4 @@ Breaking change: move ESLint core and all ESLint plugin/config packages from `de
1418
- `eslint-plugin-sonarjs`
1519
- `eslint-plugin-unused-imports`
1620

17-
Also align this package’s `devDependencies` with the exact versions resolved in the workspace lockfile to support local development of the config.
21+
Development policy: this package’s `devDependencies` now use caret ranges to track current tooling (no pinning to exact lockfile resolutions).

packages/eslint-config/README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,22 @@ ESLint 9 flat config for ESM-only Node 22/24 projects.
66
- ESM-only: no `.cjs`, no eslintrc format
77
- CJS (`*.cjs`, `*.cts`) files are ignored by default
88

9+
## Peer dependencies
10+
11+
This package requires the following peers in your project:
12+
13+
- `eslint` (^9.0.0)
14+
- `typescript` (^5.0.0)
15+
16+
All ESLint plugins/configs used by this shareable config are regular dependencies and install transitively with `@mikecbrant/eslint-config`.
17+
918
## Install
1019

1120
```bash
12-
pnpm add -D eslint @mikecbrant/eslint-config
21+
pnpm add -D eslint typescript @mikecbrant/eslint-config
1322
```
1423

15-
This shareable config brings along the necessary plugins/configs internally (XO + TypeScript, import resolver, SonarJS, unicorn, and unused-imports). Your project only needs `eslint` and this package.
24+
This installs the two peers alongside the shared config. The plugin/config packages (XO TypeScript, import resolver, SonarJS, unicorn, and unused-imports) are bundled as dependencies of this package—you do not need to add them yourself.
1625

1726
## Usage
1827

@@ -23,6 +32,18 @@ import config from '@mikecbrant/eslint-config'
2332
export default config
2433
```
2534

35+
### Avoid duplicated config values
36+
37+
When using the flat config exported by this package, do not re-declare the same plugins/configs or duplicate rules in your local `eslint.config.*`. This config already registers:
38+
39+
- `@typescript-eslint`
40+
- `eslint-plugin-import`
41+
- `eslint-plugin-unicorn`
42+
- `eslint-plugin-sonarjs`
43+
- `eslint-plugin-unused-imports`
44+
45+
Re-declaring these can lead to duplicate plugin instances or conflicting rules (an issue we hit in a recent PR). If you need project-specific tweaks, place additional overrides after the imported config without re-adding the same plugins/configs.
46+
2647
Key strict rules (all error):
2748

2849
- `max-lines-per-function` = 60 (skip comments/blank lines)

packages/eslint-config/package.json

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,21 @@
1010
},
1111
"peerDependencies": {
1212
"eslint": "^9.0.0",
13-
"eslint-config-xo-typescript": "^8.0.0",
14-
"@typescript-eslint/parser": "^8.0.0",
15-
"@typescript-eslint/eslint-plugin": "^8.0.0",
16-
"eslint-plugin-import": "^2.29.0",
17-
"eslint-import-resolver-typescript": "^3.6.0",
18-
"eslint-plugin-unicorn": "^52.0.0",
19-
"eslint-plugin-sonarjs": "^3.0.2",
20-
"eslint-plugin-unused-imports": "^4.0.0",
2113
"typescript": "^5.0.0"
2214
},
23-
"devDependencies": {
24-
"@mikecbrant/prettier-config": "workspace:*",
25-
"eslint": "^9.34.0",
26-
"eslint-config-xo-typescript": "^8.0.2",
15+
"dependencies": {
2716
"@typescript-eslint/parser": "^8.41.0",
2817
"@typescript-eslint/eslint-plugin": "^8.41.0",
18+
"eslint-config-xo-typescript": "^8.0.2",
2919
"eslint-plugin-import": "^2.32.0",
3020
"eslint-import-resolver-typescript": "^3.10.1",
3121
"eslint-plugin-unicorn": "^52.0.0",
3222
"eslint-plugin-sonarjs": "^3.0.5",
33-
"eslint-plugin-unused-imports": "^4.2.0",
23+
"eslint-plugin-unused-imports": "^4.2.0"
24+
},
25+
"devDependencies": {
26+
"@mikecbrant/prettier-config": "workspace:*",
27+
"eslint": "^9.34.0",
3428
"typescript": "^5.9.2"
3529
},
3630
"publishConfig": {

pnpm-lock.yaml

Lines changed: 17 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)