Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .changeset/align-eslint-config-devdeps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
"@mikecbrant/eslint-config": major
---

Breaking change: adopt Option B dependency model. Only the following are required as peer dependencies for consumers:

- `eslint`
- `typescript`

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):

- `@typescript-eslint/parser`
- `@typescript-eslint/eslint-plugin`
- `eslint-config-xo-typescript`
- `eslint-plugin-import`
- `eslint-import-resolver-typescript`
- `eslint-plugin-unicorn`
- `eslint-plugin-sonarjs`
- `eslint-plugin-unused-imports`

Development policy: this package’s `devDependencies` now use caret ranges to track current tooling (no pinning to exact lockfile resolutions).
25 changes: 23 additions & 2 deletions packages/eslint-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,22 @@ ESLint 9 flat config for ESM-only Node 22/24 projects.
- ESM-only: no `.cjs`, no eslintrc format
- CJS (`*.cjs`, `*.cts`) files are ignored by default

## Peer dependencies

This package requires the following peers in your project:

- `eslint` (^9.0.0)
- `typescript` (^5.0.0)

All ESLint plugins/configs used by this shareable config are regular dependencies and install transitively with `@mikecbrant/eslint-config`.

## Install

```bash
pnpm add -D eslint @mikecbrant/eslint-config
pnpm add -D eslint typescript @mikecbrant/eslint-config
```

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.
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.

## Usage

Expand All @@ -23,6 +32,18 @@ import config from '@mikecbrant/eslint-config'
export default config
```

### Avoid duplicated config values

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:

- `@typescript-eslint`
- `eslint-plugin-import`
- `eslint-plugin-unicorn`
- `eslint-plugin-sonarjs`
- `eslint-plugin-unused-imports`

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.

Key strict rules (all error):

- `max-lines-per-function` = 60 (skip comments/blank lines)
Expand Down
23 changes: 14 additions & 9 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,24 @@
"engines": {
"node": ">=22 <25"
},
"dependencies": {
"peerDependencies": {
"eslint": "^9.0.0",
"eslint-config-xo-typescript": "^8.0.0",
"@typescript-eslint/parser": "^8.0.0",
"@typescript-eslint/eslint-plugin": "^8.0.0",
"eslint-plugin-import": "^2.29.0",
"eslint-import-resolver-typescript": "^3.6.0",
"typescript": "^5.0.0"
},
"dependencies": {
"@typescript-eslint/parser": "^8.41.0",
"@typescript-eslint/eslint-plugin": "^8.41.0",
"eslint-config-xo-typescript": "^8.0.2",
"eslint-plugin-import": "^2.32.0",
"eslint-import-resolver-typescript": "^3.10.1",
"eslint-plugin-unicorn": "^52.0.0",
"eslint-plugin-sonarjs": "^3.0.2",
"eslint-plugin-unused-imports": "^4.0.0"
"eslint-plugin-sonarjs": "^3.0.5",
"eslint-plugin-unused-imports": "^4.2.0"
},
"devDependencies": {
"@mikecbrant/prettier-config": "workspace:*"
"@mikecbrant/prettier-config": "workspace:*",
"eslint": "^9.34.0",
"typescript": "^5.9.2"
},
"publishConfig": {
"access": "public"
Expand Down
23 changes: 13 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.