Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
56760fc
chore: upgrade vitest to v3
hanna-skryl Apr 3, 2026
6d8808e
chore: initialize Nx
hanna-skryl Apr 3, 2026
b1a88c0
chore: convert repository to monorepo structure
hanna-skryl Apr 3, 2026
a27ad30
chore: generate create-eslint-config package
hanna-skryl Apr 3, 2026
5db9595
chore: clean up generator output and configure packages
hanna-skryl Apr 6, 2026
0418ac2
chore: configure Nx releases, remove release-it
hanna-skryl Apr 7, 2026
c43b8e8
ci: use nx affected in CI pipeline
hanna-skryl Apr 7, 2026
71be2a2
chore: set up commitlint and commitizen
hanna-skryl Apr 7, 2026
e34167d
docs: update documentation for monorepo structure
hanna-skryl Apr 7, 2026
c3f7c25
chore: add missing test watch target
hanna-skryl Apr 7, 2026
5acfed8
chore: regenerate docs and update package-lock
hanna-skryl Apr 7, 2026
9022f93
chore: set default parallel to 3
hanna-skryl Apr 9, 2026
fdffba0
fix: add inputs to cacheable targets
hanna-skryl Apr 9, 2026
7c83d79
chore: configure named inputs
hanna-skryl Apr 9, 2026
d883c0e
chore: centralize release version config
hanna-skryl Apr 9, 2026
6dcf005
docs(eslint-config): remove contributing section from README
hanna-skryl Apr 9, 2026
681f36e
fix(create-eslint-config): remove unused tslib
hanna-skryl Apr 9, 2026
f8772ad
chore: add root eslint config with nx rules
hanna-skryl Apr 9, 2026
2b58c4a
fix(eslint-config): use absolute paths in tests
hanna-skryl Apr 9, 2026
de60388
fix(eslint-config): scope dependency-checks rule
hanna-skryl Apr 10, 2026
bab1a4e
chore: simplify spec pattern
hanna-skryl Apr 10, 2026
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
42 changes: 31 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,68 +13,84 @@ jobs:
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm
- name: Set base and head for Nx affected commands
uses: nrwl/nx-set-shas@v4
- name: Install dependencies
run: npm ci
- name: Run Vitest tests
run: npm test
- name: Run affected tests
run: npx nx affected -t test

lint:
runs-on: ubuntu-latest
name: Lint
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm
- name: Set base and head for Nx affected commands
uses: nrwl/nx-set-shas@v4
- name: Install dependencies
run: npm ci
- name: Run ESLint
run: npm run lint
- name: Lint affected projects
run: npx nx affected -t lint

typecheck:
runs-on: ubuntu-latest
name: Type check
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm
- name: Set base and head for Nx affected commands
uses: nrwl/nx-set-shas@v4
- name: Install dependencies
run: npm ci
- name: Check types using TypeScript compiler
run: npm run typecheck
- name: Type check affected projects
run: npx nx affected -t typecheck

docs:
runs-on: ubuntu-latest
name: Docs check
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm
- name: Set base and head for Nx affected commands
uses: nrwl/nx-set-shas@v4
- name: Install dependencies
run: npm ci
- name: Generate docs
run: npm run docs
run: npx nx affected -t docs
- name: Check docs unchanged
run: |
if [ "$(git diff --ignore-space-at-eol --text docs/*.md README.md | wc -l)" -gt "0" ]; then
if [ "$(git diff --ignore-space-at-eol --text -- packages/eslint-config/docs/ packages/eslint-config/README.md | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after running docs script. See status below:"
git diff --ignore-space-at-eol --text docs/*.md README.md
git diff --ignore-space-at-eol --text -- packages/eslint-config/docs/ packages/eslint-config/README.md
exit 1
fi

Expand All @@ -84,12 +100,16 @@ jobs:
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm
- name: Set base and head for Nx affected commands
uses: nrwl/nx-set-shas@v4
- name: Install dependencies
run: npm ci
- name: Check Prettier formatting
run: npx prettier --check .
- name: Check formatting of affected files
run: npx nx format:check
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,8 @@ testem.log
# System Files
.DS_Store
Thumbs.db

# Nx
.nx/cache
.nx/workspace-data
vitest.config.*.timestamp*
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit "$1"
6 changes: 3 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
. "$(dirname -- "$0")/_/husky.sh"

# tests
npm test
npx nx run eslint-config:test

# docs script
npm run docs
git add docs README.md
npx nx run eslint-config:docs
git add packages/eslint-config/docs packages/eslint-config/README.md

# Prettier (https://prettier.io/docs/en/precommit.html#option-5-shell-script)
FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g')
Expand Down
5 changes: 4 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
*.md
*.md
dist
coverage
.nx
5 changes: 0 additions & 5 deletions .release-it.json

This file was deleted.

77 changes: 77 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Contributing

## Setup

Prerequisites:

- Node.js installed (version specified in [`.node-version`](./.node-version))

Make sure to install dependencies:

```sh
npm install
```

## Development

Refer to docs on [how to run tasks in Nx](https://nx.dev/features/run-tasks).

Some examples:

```sh
# visualize project graph
npx nx graph

# run tests for all projects
npx nx run-many -t test

# run tests for a specific project
npx nx run eslint-config:test

# run lint for all projects
npx nx run-many -t lint

# run type check for all projects
npx nx run-many -t typecheck

# check formatting
npx nx format:check

# fix formatting
npx nx format:write

# generate docs for eslint-config
npx nx run eslint-config:docs
```

## Commits

This repository uses [conventional commits](https://www.conventionalcommits.org/). Commit messages are linted with [Commitlint](https://commitlint.js.org/) and must follow the format:

```
type(scope): description
```

Valid scopes correspond to Nx project names (e.g. `eslint-config`, `create-eslint-config`).

You can use [Commitizen](https://commitizen-tools.github.io/commitizen/) to create commits interactively:

```sh
npm run commit
```

## Releases

Releases are managed with [Nx release](https://nx.dev/features/manage-releases). Both packages are published together under the same version (fixed releases).

To create a release manually:

```sh
npx nx release
```

To preview a release without making changes:

```sh
npx nx release --dry-run
```
144 changes: 7 additions & 137 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,144 +1,14 @@
# @code-pushup/eslint-config

[![npm](https://img.shields.io/npm/v/%40code-pushup%2Feslint-config.svg)](https://www.npmjs.com/package/@code-pushup/eslint-config)
[![CI](https://github.com/code-pushup/eslint-config/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/code-pushup/eslint-config/actions/workflows/ci.yml?query=branch%3Amain)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Recommended ESLint presets by [Code PushUp](https://github.com/code-pushup/cli/tree/main/packages/cli).
Monorepo for [Code PushUp](https://github.com/code-pushup/cli) ESLint packages.

<!-- begin autogenerated -->
## Packages

## ⚙️ Configs

| Stack | Config | Description |
| :--------------------------------------------------------: | :------------------------------------------------------- | :------------------------------------------------------------------ |
| ![javascript](./docs/icons/material/javascript.png) | [javascript](./docs/javascript.md) | Default config, suitable for any **JavaScript/TypeScript** project. |
| ![typescript](./docs/icons/material/typescript.png) | [typescript](./docs/typescript.md) | Config for strict **TypeScript** projects. |
| ![nodejs](./docs/icons/material/nodejs.png) | [node](./docs/node.md) | Config for **Node.js** projects. |
| ![angular](./docs/icons/material/angular.png) | [angular](./docs/angular.md) | Config for **Angular** projects. |
| ![ngrx](./docs/icons/other/ngrx.png) | [ngrx](./docs/ngrx.md) | Config for **Angular** projects using **NgRx** library. |
| ![react](./docs/icons/material/react.png) | [react](./docs/react.md) | Config for **React** projects. |
| ![graphql](./docs/icons/material/graphql.png) | [graphql](./docs/graphql.md) | Config for **GraphQL servers** implemented in Node.js. |
| ![jest](./docs/icons/material/jest.png) | [jest](./docs/jest.md) | Config for projects using **Jest** for testing. |
| ![vitest](./docs/icons/material/vitest.png) | [vitest](./docs/vitest.md) | Config for projects using **Vitest** for testing. |
| ![cypress](./docs/icons/material/cypress.png) | [cypress](./docs/cypress.md) | Config for projects using **Cypress** for testing. |
| ![playwright](./docs/icons/material/playwright.png) | [playwright](./docs/playwright.md) | Config for projects using **Playwright** for testing. |
| ![storybook](./docs/icons/material/storybook.png) | [storybook](./docs/storybook.md) | Config for projects using **Storybook** for UI components. |
| ![testing-library](./docs/icons/other/testing-library.png) | [react-testing-library](./docs/react-testing-library.md) | Config for projects using **React Testing Library** for testing. |

Some configs extend other configs, as illustrated below. So, for example, extending `angular` config implicitly extends `typescript` and `javascript` configs as well.

```mermaid
graph BT;
typescript --extends--> javascript
node --extends--> javascript
angular --extends--> typescript
ngrx --extends--> angular
react --extends--> javascript
graphql --extends--> node
```

### 🏗️ Setup

To use the default config, follow these steps:

1. You must first install all the required peer dependencies (if you haven't already):

```sh
npm install -D eslint @eslint/js eslint-plugin-{functional,import,promise,sonarjs,unicorn} globals typescript-eslint
```

2. Install `@code-pushup/eslint-config` with:

```sh
npm install -D @code-pushup/eslint-config
```

3. Include default config in your [ESLint configuration file](https://eslint.org/docs/latest/use/configure/configuration-files) (usually `eslint.config.js`):

```js
import javascript from '@code-pushup/eslint-config/javascript.js';
import { defineConfig } from 'eslint/config';

export default defineConfig(...javascript);
```

Depending on your tech stack, you may wish to extend other configs as well ([listed above](#⚙️-configs)). This will require installing additional peer dependencies. For more details, refer to setup docs for the configs you're interested in using.

#### 📦 Peer dependencies

All peer dependencies used by `@code-pushup/eslint-config` are listed below, along with their supported versions. Only the default config's dependencies are required, others are optional.

| | NPM package | Version | Required |
| :--------------------------------------------------------: | :--------------------------------------------------------------------------------------------------- | :----------------------------------------------: | :------: |
| ![eslint](./docs/icons/material/eslint.png) | [eslint](https://www.npmjs.com/package/eslint) | `^9.0.0` | ✅ |
| ![eslint](./docs/icons/material/eslint.png) | [@eslint/js](https://www.npmjs.com/package/@eslint/js) | `^9.0.0` | ✅ |
| ![lambda](./docs/icons/icons8/lambda.png) | [eslint-plugin-functional](https://www.npmjs.com/package/eslint-plugin-functional) | `^7.0.0 \|\| ^8.0.0 \|\| ^9.0.0` | ✅ |
| ![import](./docs/icons/icons8/import.png) | [eslint-plugin-import](https://www.npmjs.com/package/eslint-plugin-import) | `^2.31.0` | ✅ |
| ![import](./docs/icons/icons8/import.png) | [eslint-import-resolver-typescript](https://www.npmjs.com/package/eslint-import-resolver-typescript) | `^3.0.0 \|\| ^4.0.0` | |
| ![promise](./docs/icons/icons8/promise.png) | [eslint-plugin-promise](https://www.npmjs.com/package/eslint-plugin-promise) | `>=6.4.0` | ✅ |
| ![sonar](./docs/icons/other/sonar.png) | [eslint-plugin-sonarjs](https://www.npmjs.com/package/eslint-plugin-sonarjs) | `^1.0.4` | ✅ |
| ![unicorn](./docs/icons/icons8/unicorn.png) | [eslint-plugin-unicorn](https://www.npmjs.com/package/eslint-plugin-unicorn) | `>=50.0.0` | ✅ |
| ![global](./docs/icons/icons8/global.png) | [globals](https://www.npmjs.com/package/globals) | `>=14.0.0` | ✅ |
| ![typescript](./docs/icons/material/typescript.png) | [typescript-eslint](https://www.npmjs.com/package/typescript-eslint) | `^8.0.0` | ✅ |
| ![graphql](./docs/icons/material/graphql.png) | [@graphql-eslint/eslint-plugin](https://www.npmjs.com/package/@graphql-eslint/eslint-plugin) | `^3.0.0 \|\| ^4.0.0` | |
| ![ngrx](./docs/icons/other/ngrx.png) | [@ngrx/eslint-plugin](https://www.npmjs.com/package/@ngrx/eslint-plugin) | `^18.0.0 \|\| ^19.0.0 \|\| ^20.0.0 \|\| ^21.0.0` | |
| ![vitest](./docs/icons/material/vitest.png) | [@vitest/eslint-plugin](https://www.npmjs.com/package/@vitest/eslint-plugin) | `^1.1.9` | |
| ![angular](./docs/icons/material/angular.png) | [angular-eslint](https://www.npmjs.com/package/angular-eslint) | `^18.0.0 \|\| ^19.0.0 \|\| ^20.0.0 \|\| ^21.0.0` | |
| ![cypress](./docs/icons/material/cypress.png) | [eslint-plugin-cypress](https://www.npmjs.com/package/eslint-plugin-cypress) | `>=3.3.0` | |
| ![jest](./docs/icons/material/jest.png) | [eslint-plugin-jest](https://www.npmjs.com/package/eslint-plugin-jest) | `^28.8.0 \|\| ^29.0.0` | |
| ![accessibility](./docs/icons/icons8/accessibility.png) | [eslint-plugin-jsx-a11y](https://www.npmjs.com/package/eslint-plugin-jsx-a11y) | `^6.10.0` | |
| ![nodejs](./docs/icons/material/nodejs.png) | [eslint-plugin-n](https://www.npmjs.com/package/eslint-plugin-n) | `>=17.0.0` | |
| ![playwright](./docs/icons/material/playwright.png) | [eslint-plugin-playwright](https://www.npmjs.com/package/eslint-plugin-playwright) | `^2.1.0` | |
| ![react](./docs/icons/material/react.png) | [eslint-plugin-react](https://www.npmjs.com/package/eslint-plugin-react) | `^7.36.0` | |
| ![react_ts](./docs/icons/material/react_ts.png) | [eslint-plugin-react-hooks](https://www.npmjs.com/package/eslint-plugin-react-hooks) | `>=5.0.0` | |
| ![rxjs](./docs/icons/other/rxjs.png) | [eslint-plugin-rxjs-x](https://www.npmjs.com/package/eslint-plugin-rxjs-x) | `>=0.6.0` | |
| ![storybook](./docs/icons/material/storybook.png) | [eslint-plugin-storybook](https://www.npmjs.com/package/eslint-plugin-storybook) | `>=0.10.0` | |
| ![testing-library](./docs/icons/other/testing-library.png) | [eslint-plugin-testing-library](https://www.npmjs.com/package/eslint-plugin-testing-library) | `^7.1.1` | |

### 🧪 Test overrides

For non-production code, some rules are disabled (or downgraded from errors to warnings).

This applies to file paths matching any of the following globs:

- `**/*.spec.?(c|m)[jt]s?(x)`
- `**/*.test.?(c|m)[jt]s?(x)`
- `**/__tests__/**/*.?(c|m)[jt]s?(x)`
- `**/__mocks__/**/*.?(c|m)[jt]s?(x)`
- `**/*.cy.?(c|m)[jt]s?(x)`
- `**/*.stories.?(c|m)[jt]s?(x)`
- `**/*.e2e.?(c|m)[jt]s?(x)`
- `**/*.mock.?(c|m)[jt]s?(x)`
- `**/*.mocks.?(c|m)[jt]s?(x)`
- `**/test/**/*.?(c|m)[jt]s?(x)`
- `**/tests/**/*.?(c|m)[jt]s?(x)`
- `**/mocks/**/*.?(c|m)[jt]s?(x)`
- `**/testing-utils/**/*.?(c|m)[jt]s?(x)`
- `**/test-utils/**/*.?(c|m)[jt]s?(x)`
- `**/fixtures/**/*.?(c|m)[jt]s?(x)`
- `**/*.config.?(c|m)[jt]s`
- `**/.prettierrc.?(c|m)[jt]s`
- `**/codegen.?(c|m)[jt]s`
- `**/test-setup.?(c|m)[jt]s`

<!-- end autogenerated -->

## 🫴 Contributing

Node.js installation is a prerequisite (LTS version). Install dependencies with NPM:

```sh
npm install
```

To execute tests:

```sh
npm test
```

To generate documentation:

```sh
npm run docs
```
| Package | Description |
| :------------------------------------------------------------------- | :------------------------------------------- |
| [`@code-pushup/eslint-config`](./packages/eslint-config/README.md) | Recommended ESLint presets by Code PushUp |
| `@code-pushup/create-eslint-config` | Interactive setup wizard _(coming soon)_ |
Loading
Loading