# @encoura/eslint-config

> Encoura's preferred configs for TypeScript, Prettier, ESLint, CommitLint, and MarkdownLint.

Latest version **4.0.2** (published 2026-09-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install @encoura/eslint-config
pnpm add @encoura/eslint-config
yarn add @encoura/eslint-config
bun add @encoura/eslint-config
```

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support; large bundle.

## Facts

| | |
|---|---|
| Version | 4.0.2 |
| Published | 2026-09-23 |
| First published | 2023-09-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 31 |
| Unpacked size | 14.9 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Jon Cursi |
| Maintainers | scott.saniuk, joncursi, thecleric |
| Keywords | commitlint, eslint, eslint-config, markdownlint, prettier, typescript |

## Links

- npm: https://www.npmjs.com/package/@encoura/eslint-config
- Repository: https://github.com/nrccua/eslint-config
- Homepage: https://github.com/nrccua/eslint-config#readme
- Issues: https://github.com/nrccua/eslint-config/issues
- npm.io page: https://npm.io/package/@encoura/eslint-config

## Dependencies (31)

- [prettier](https://npm.io/package/prettier.md) ^3.9.8
- [storybook](https://npm.io/package/storybook.md) ^10.6.0
- [@eslint/js](https://npm.io/package/@eslint/js.md) ^10.0.1
- [@eslint/compat](https://npm.io/package/@eslint/compat.md) ^2.1.0
- [@commitlint/cli](https://npm.io/package/@commitlint/cli.md) ^21.0.2
- [@eslint/eslintrc](https://npm.io/package/@eslint/eslintrc.md) ^3.3.5
- [eslint-plugin-mdx](https://npm.io/package/eslint-plugin-mdx.md) ^3.8.1
- [eslint-plugin-react](https://npm.io/package/eslint-plugin-react.md) ^7.37.5
- [eslint-plugin-regex](https://npm.io/package/eslint-plugin-regex.md) ^1.10.0
- [eslint-config-airbnb](https://npm.io/package/eslint-config-airbnb.md) ^19.0.4
- [eslint-plugin-import](https://npm.io/package/eslint-plugin-import.md) ^2.32.0
- [eslint-plugin-lodash](https://npm.io/package/eslint-plugin-lodash.md) ^8.0.0
- [eslint-plugin-promise](https://npm.io/package/eslint-plugin-promise.md) ^7.3.0
- [eslint-config-prettier](https://npm.io/package/eslint-config-prettier.md) ^10.1.8
- [eslint-plugin-jsx-a11y](https://npm.io/package/eslint-plugin-jsx-a11y.md) ^6.10.2
- [eslint-plugin-no-loops](https://npm.io/package/eslint-plugin-no-loops.md) ^0.4.0
- [eslint-plugin-prettier](https://npm.io/package/eslint-plugin-prettier.md) ^5.5.6
- [eslint-plugin-security](https://npm.io/package/eslint-plugin-security.md) ^4.0.0
- [eslint-plugin-filenames](https://npm.io/package/eslint-plugin-filenames.md) ^1.3.2
- [eslint-plugin-storybook](https://npm.io/package/eslint-plugin-storybook.md) ^10.6.0
- [@next/eslint-plugin-next](https://npm.io/package/@next/eslint-plugin-next.md) ^16.2.9
- [@stylistic/eslint-plugin](https://npm.io/package/@stylistic/eslint-plugin.md) ^5.10.0
- [@typescript-eslint/parser](https://npm.io/package/@typescript-eslint/parser.md) ^8.61.0
- [eslint-config-airbnb-base](https://npm.io/package/eslint-config-airbnb-base.md) ^15.0.0
- [eslint-plugin-react-hooks](https://npm.io/package/eslint-plugin-react-hooks.md) ^7.1.1
- [eslint-import-resolver-node](https://npm.io/package/eslint-import-resolver-node.md) ^0.4.0
- [eslint-plugin-sort-keys-fix](https://npm.io/package/eslint-plugin-sort-keys-fix.md) ^1.1.2
- [eslint-plugin-new-with-error](https://npm.io/package/eslint-plugin-new-with-error.md) ^5.0.0
- [@commitlint/config-conventional](https://npm.io/package/@commitlint/config-conventional.md) ^21.0.2
- [@typescript-eslint/eslint-plugin](https://npm.io/package/@typescript-eslint/eslint-plugin.md) ^8.61.0
- [eslint-import-resolver-typescript](https://npm.io/package/eslint-import-resolver-typescript.md) ^4.4.5

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 4.0.2 (latest) — 2026-09-23
- 4.0.1 — 2026-06-10
- 4.0.0 — 2026-06-10
- 3.0.1 — 2026-01-13
- 3.0.0 — 2025-06-30
- 2.8.0 — 2024-09-27
- 2.7.0 — 2024-09-27
- 2.6.1 — 2024-09-27
- 2.6.0 — 2024-09-27
- 2.5.0 — 2024-09-27
- 2.4.0 — 2024-09-26
- 2.3.0 — 2024-09-26
- 2.2.0 — 2024-09-26
- 2.1.1 — 2024-09-26
- 2.1.0 — 2024-09-26
- … 5 more at https://npm.io/package/@encoura/eslint-config/versions

## README

# ESLint Config

Encoura's preferred configs for TypeScript, Prettier, ESLint, CommitLint, and
MarkdownLint.

## Getting Started

Install this package, [ESLint](https://eslint.org/),
[husky](https://github.com/typicode/husky), and
[lint-staged](https://github.com/okonet/lint-staged) as dev dependencies:

```shell
npm install --save-dev @encoura/eslint-config eslint@^10 husky lint-staged
```

Configure husky by adding the following to your `package.json` file:

```json
...
"scripts": {
  ...
  "prepare": "husky",
  ...
},
...
```

## Configure CommitLint

To configure [CommitLint](https://github.com/marionebl/commitlint), create a
`commitlint.config.js` file in the root of your project that contains the
following:

```js
module.exports = require('@encoura/eslint-config/commitlint.config');
```

This will allow CommitLint to discover the configuration this repository
provides from within your `node_modules` folder.

By default the Encoura commitlint expects a commit message in the following format:

`[XXX-###]: Subject` where XXX-### is a work item id, e.g., `WEB-1`

The commit message may also be in the form of git's standard merge commit format.

## Configure ESLint

To configure [ESLint](https://eslint.org/), add the following to your
`eslint.config.js` and `package.json` files. This package supports ESLint 10's
flat config system. This repository develops and validates the config on Node 24.

Five upstream packages still declare peer ranges that exclude ESLint 10:
Airbnb, Airbnb Base, Import, React, and JSX accessibility. Their original
implementations and rule names are retained. The build bundles those packages
and their locked production dependencies into the
published artifact. It widens only their ESLint peer metadata to include v10
and Airbnb's React Hooks peer metadata to include v7.

These are package-local compatibility patches, not upstream declarations of
support. The existing `@eslint/compat` adapters handle legacy rule APIs.
Consumers need no peer overrides or `--legacy-peer-deps`. Tests install the
packed artifact with strict peers, compare complete rule inventories, and
verify that bundled implementation files match the installed originals.

Bundled dependencies are fixed by this package's lockfile. Their updates require
a new package build and release. Use `npm ci` before release builds. Remove each
compatibility patch when its upstream package supports these peer versions.

```js
const createConfig = require('@encoura/eslint-config');

module.exports = createConfig({
  nextRootDir: __dirname,
  resolverProject: ['tsconfig.json'],
  tsconfigRootDir: __dirname,
});
```

For back-end (Nest.js) projects:

```js
const createConfig = require('@encoura/eslint-config/nest');

module.exports = createConfig({
  resolverProject: ['tsconfig.json'],
  tsconfigRootDir: __dirname,
});
```

```json
...
"lint-staged": {
  ...
  "*.{js,jsx,ts,tsx}": "eslint",
  ...
},
...
```

### Breaking Changes In v4

- ESLint config consumers must use ESLint 10 flat config. Legacy `.eslintrc`
  `extends: ['@encoura/eslint-config']` and
  `extends: ['@encoura/eslint-config/nest']` usage is no longer supported.
  Create an `eslint.config.js` file and call the exported config factory instead.
- Install `eslint@^10` directly in consuming projects. This package declares
  ESLint 10 as a peer so the project-level `eslint` CLI resolves to the expected
  major version.
- The published `jest.config.js` export and Jest-related dependencies were
  removed. Projects that imported
  `@encoura/eslint-config/jest.config` should own their Jest or Vitest config
  locally.
- Jest-specific test linting is no longer enabled by this shared ESLint config.
  Test files still receive the shared TypeScript/React overrides, but Vitest
  projects no longer inherit Jest rules.
- `eslint-plugin-disable` is no longer bundled. The shared config did not enable
  any `disable/*` rules; projects that used that package transitively should add
  their own dependency.

## Configure MarkdownLint

To configure [MarkdownLint](https://github.com/DavidAnson/markdownlint), add the
following to your `package.json` file. This will allow MarkdownLint to discover
the configuration this repository provides from within your `node_modules`
folder, and will check your `*.md` files for infractions every time you create
a new commit:

```json
...
"lint-staged": {
  ...
  "*.{md}": "markdownlint --config node_modules/@encoura/eslint-config/markdownlint.config.json",
  ...
},
...
```

## Configure Prettier

To configure [prettier](https://prettier.io/), create a `.prettierrc.js`
file in the root of your project that contains the following:

```js
module.exports = require('@encoura/eslint-config/prettier.config');
```

This will allow Prettier to discover the configuration this repository
provides from within your `node_modules` folder.

Next, add the following to your `package.json` file so that prettier will check
your files for infractions every time you create a new commit:

```json
...
"lint-staged": {
  ...
  "*.{js,jsx,json,md,ts,tsx}": [
    "prettier --write",
    "git add"
  ]
  ...
},
...
```

## Configure TypeScript

To configure [TypeScript](https://www.typescriptlang.org/), add the following
to your `tsconfig.json` file. This will allow TypeScript to discover the
configuration this repository provides from within your `node_modules` folder:

```json
...
"extends": "node_modules/@encoura/eslint-config/tsconfig.json",
...
```

## Dependency Upgrade Notes

See [UPGRADE-NOTES.md](UPGRADE-NOTES.md) for security fixes, tooling compatibility
changes, consumer migration steps, and validation commands.

## Local Development

### npm Scripts

There are several npm scripts at your disposal during local development.
Here are some of the more important ones:

| Script                | Description                                              |
| :-------------------- | :------------------------------------------------------- |
| npm test              | Run all validation checks.                               |
| npm run test:lint:js  | Lint JavaScript files with the shared ESLint config.     |
| npm run test:lint:ts  | Lint TypeScript files with the shared ESLint config.     |
| npm run test:lint:md  | Lint Markdown files with the shared MarkdownLint config. |
| npm run test:prettier | Check formatting with Prettier.                          |
| npm run test:tsconfig | Validate the shared TypeScript config.                   |
| npm run test:unit     | Run unit tests for the exported config factories.        |

### Release Process

When your code changes are ready, it's time to publish a new patch, minor, or
major release. Maintainers typically squash pull requests when merging, so the
PR title becomes the squash commit title and is the source of truth for patch
and minor release detection.

1. Make a PR (or mark your draft PR as ready for review).

2. Choose a public-safe PR title that lets Semantic Release know if this should
   yield a new patch, minor, or major release:
   - If you expect the merging of your PR to result in a new _patch_ release,
     start your PR title with `fix:`.
   - If you expect the merging of your PR to result in a new _minor_ release,
     start your PR title with `feat:`.
   - If you expect the merging of your PR to result in a new _major_ release,
     see #3 below for details.
   - If you expect the merging of your PR to skip the creation of a new release,
     you can start your PR title with `build:` (for build changes),
     `chore:` (for basic maintenance), `docs:` (for documentation updates),
     or simply do not use any of the above keyword prefixes.

3. If the pull request should create a new major version release, the string
   `BREAKING CHANGE:` must be included in at least one commit message's
   **footer** ([see docs](https://semantic-release.gitbook.io/semantic-release#commit-message-format))
   — Semantic Release's commit analyzer does **not** use the PR title in
   determining major releases.

   You can either manually add `BREAKING CHANGE:` to the commit footer
   after pressing "Merge Pull Request"/"Squash and Merge" in your PR (in the
   "optional extended description" field). Alternatively, if you're merging the
   PR by creating a new merge commit, ensure that at least one of the source
   commits' messages has `BREAKING CHANGE:` in its footer. Note that to
   accomplish this you may need to commit with the `--no-verify` flag to bypass
   commitlint.

4. Once your PR is merged, Semantic Release will pick it up and initiate the
   automated release process. If it detects that it should create a release
   (based on the above), it will. Otherwise, it won't!

---
_Source: https://npm.io/package/@encoura/eslint-config · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
