# @lightbase/eslint-config

> ESLint based linting and formatting configuration

Latest version **4.4.0** (published 2026-08-20) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

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

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 4.4.0 |
| Published | 2026-08-20 |
| First published | 2024-05-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 17 |
| Unpacked size | 123.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 0 |
| Maintainers | dirkdev98, mathijslightbase, owinter86, rodymolenaar |

## Links

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

## Dependencies (17)

- [eslint](https://npm.io/package/eslint.md) 9.39.4
- [globals](https://npm.io/package/globals.md) 17.8.0
- [synckit](https://npm.io/package/synckit.md) 0.11.13
- [prettier](https://npm.io/package/prettier.md) 3.8.4
- [@eslint/js](https://npm.io/package/@eslint/js.md) 9.39.4
- [eslint-mdx](https://npm.io/package/eslint-mdx.md) 3.8.1
- [diff-match-patch](https://npm.io/package/diff-match-patch.md) 1.0.5
- [eslint-plugin-mdx](https://npm.io/package/eslint-plugin-mdx.md) 3.8.1
- [typescript-eslint](https://npm.io/package/typescript-eslint.md) 8.65.0
- [eslint-plugin-jsdoc](https://npm.io/package/eslint-plugin-jsdoc.md) 63.3.1
- [eslint-plugin-import-x](https://npm.io/package/eslint-plugin-import-x.md) 4.17.1
- [@typescript-eslint/utils](https://npm.io/package/@typescript-eslint/utils.md) 8.65.0
- [@typescript-eslint/parser](https://npm.io/package/@typescript-eslint/parser.md) 8.65.0
- [eslint-plugin-file-progress](https://npm.io/package/eslint-plugin-file-progress.md) 3.0.2
- [eslint-config-flat-gitignore](https://npm.io/package/eslint-config-flat-gitignore.md) 2.3.0
- [eslint-plugin-comment-length](https://npm.io/package/eslint-plugin-comment-length.md) 2.3.1
- [eslint-import-resolver-typescript](https://npm.io/package/eslint-import-resolver-typescript.md) 4.4.5

## Recent versions

- 4.4.0 (latest) — 2026-08-20
- 4.3.2 — 2026-05-04
- 4.3.1 — 2026-04-01
- 4.3.0 — 2026-03-19
- 4.2.1 — 2026-03-13
- 4.2.0 — 2026-02-20
- 4.1.2 — 2026-02-03
- 4.1.1 — 2025-12-12
- 4.1.0 — 2025-11-17
- 4.0.1 — 2025-11-13
- 4.0.0 — 2025-11-13
- 3.4.1 — 2025-10-22
- 3.4.0 — 2025-08-25
- 3.3.0 — 2025-08-25
- 3.2.4 — 2025-07-01
- … 31 more at https://npm.io/package/@lightbase/eslint-config/versions

## README

# ESLint config

Opinionated but configurable ESLint config. Fully includes linting and formatting.

## Install

```shell
npm install --save-dev --exact @lightbase/eslint-config
```

Some configurations require manually installed plugins. For example

```shell
npm install --save-dev --exact eslint-plugin-react eslint-plugin-react-hooks
```

This is documented below.

## Usage

This package builds a config, compatible with
[ESLint Flat Config](https://eslint.org/docs/latest/use/configure/configuration-files-new).
To use the config, create the following `eslint.config.js` file:

```js
import { defineConfig } from "@lightbase/eslint-config";

export default defineConfig({});
```

### Commands

Add the following scripts to your `package.json`:

```json
{
	"scripts": {
		"lint": "eslint . --concurrency=auto --fix --cache --cache-location .cache/eslint/",
		"lint:ci": "eslint . --concurrency=auto"
	}
}
```

> Make sure to add `.cache` to your .gitignore

> > [!NOTE]
>
> In a CommonJS project, make sure to name your file `eslint.config.mjs` instead.

## Default configuration and options

### Prettier

Prettier is configured to run on all Markdown, JSON, YAML, JavaScript and TypeScript
files. We support the following configuration to override this:

```js
import { defineConfig } from "@lightbase/eslint-config";

export default defineConfig({
	prettier: {
		globalOverride: {
			// Override Prettier options for all supported files.
		},
		languageOverrides: {
			ts: {
				// Override Prettier options for a specific file
				// group.
			},
		},
	},
});
```

Prettier can be disabled entirely by passing `false`:

```js
import { defineConfig } from "@lightbase/eslint-config";

export default defineConfig({
	prettier: false,
});
```

### Using an external formatter (e.g. Oxfmt)

If you use an external formatter like
[Oxfmt](https://oxc.rs/docs/guide/usage/formatter.html) instead of Prettier, you should
disable Prettier and import ordering rules to avoid conflicts:

```js
import { defineConfig } from "@lightbase/eslint-config";

export default defineConfig({
	prettier: false,
	disableImportOrdering: true,
});
```

This disables:

- All Prettier formatting rules
- `import-x/order`, `import-x/first`, and `import-x/newline-after-import`
- Custom React import grouping (if `react` is enabled)

All other rules (TypeScript, JSDoc, comment-length, React logic, accessibility, etc.) are
purely semantic and do not conflict with external formatters.

### Typescript

[Typescript ESLint](http://typescript-eslint.io/) is automatically enabled if a
`tsconfig.json` is present.

```js
import { defineConfig } from "@lightbase/eslint-config";

export default defineConfig(
	{},
	{
		// Apply custom rules
		files: ["**/*.ts"],
		rules: {
			"@typescript-eslint/no-unused-vars": "off",
		},
	},
);
```

Or explicitly disabling Typescript support can be done with:

```js
import { defineConfig } from "@lightbase/eslint-config";

export default defineConfig({
	typescript: false,
});
```

By default, we enable the recommended type checked rules from typescript-eslint. To
disable these rules, use:

```js
import { defineConfig } from "@lightbase/eslint-config";

export default defineConfig({
	typescript: {
		disableTypeCheckedRules: true,
	},
});
```

### Markdown

A Markdown processor is installed by default. Its purpose is to extract code-blocks and
present them as virtual files. This means that markdown code-blocks can receive custom
rules as follows:

```js
import { defineConfig } from "@lightbase/eslint-config";

export default defineConfig(
	{},
	{
		files: ["**/*.md/*.js"],
		rules: {
			"no-unused-vars": "off",
		},
	},
);
```

### React

The config optionally supports enabling React and Next.js specific rules. Add the
following dependencies:

```shell
npm install --save-dev --exact eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-jsx-a11y eslint-plugin-no-relative-import-paths
```

If you use Next.js, make sure to also add `@next/eslint-plugin-next` via:

```shell
npm install --save-dev --exact @next/eslint-plugin-next
```

React is only support in combination with Typescript (see above), and can be enabled as
follows:

```js
import { defineConfig } from "@lightbase/eslint-config";

export default defineConfig({
	react: {
		withNextJs: true,
	},
});
```

This enables all Next.js rules and various recommended rules for React, hooks usage, and
JSX accessibility.

### Globals

The config by default includes all globals for Node.js, Browser, and ES2021. You can use
other predefined presets via

```js
import { defineConfig } from "@lightbase/eslint-config";

export default defineConfig({
	// Make sure to include the full setup.
	globals: ["browser", "serviceworker"],
});
```

This enables environment-specific globals for all files. For a stricter setup, use custom
configuration as explained below

```js
import globals from "globals";
import { defineConfig } from "@lightbase/eslint-config";

export default defineConfig(
	{},
	{
		files: ["**/*.js"],
		languageOptions: {
			globals: {
				...globals.es2015,
			},
		},
	},
);
```

### Ignores

ESLint will by default ignore everything as defined in your `.gitignore`. You can add new
directories like so.

```js
import { defineConfig } from "@lightbase/eslint-config";

export default defineConfig(
	{
		// Define config options, explained above.
	},
	{
		// Ignore the packages/ directory.
		ignores: ["packages/**"],
	},
);
```

Make sure that nested directory ignores contain the proper wildcards for them to work.

```ignorelang
# works
.cache
**/src/generated

# doesn't work
src/generated
```

### Custom configuration

`defineConfig` accepts custom ESLint configuration as the 'rest' parameter. This allows
you to configure rules for specific file patterns.

```js
import { defineConfig } from "@lightbase/eslint-config";

export default defineConfig(
	{
		// Define config options, explained above.
	},
	{
		// Ignore the packages/ directory.
		ignores: ["packages/**"],
	},
	{
		// Add rules for specific files.
		file: ["**/*.ts"],
		rules: {
			"no-console": "off",
		},
	},
);
```

## IDE

### WebStorm

Configuring Webstorm to use this config can be done as follows:

- Go to `Languages & Frameworks` -> `JavaScript` -> `Code Quality Tools` -> `ESLint`
- Select `Automatic ESLint configuration`
- Set `Run for files` to `**/*.*`
- Select `Run eslint --fix on save`
- Click on `Apply` & `OK`

Since this config is configured to automatically cleanup imports, and runs Prettier as
part of ESLint, you can disable these settings in the `Actions on Save`-settings of
WebStorm.

> [!NOTE]
>
> WebStorm sometimes doesn't pick up on an updated ESLint configuration. A restart of the
> background services fixes this.
>
> - In versions `2023.3` and below, go to the ESLint settings in your preferences
>   according to the steps above. Select `Disable ESLint configuration`, click on `Apply`
>   and select `Automatic ESLint configuration` again.
> - In versions `20241.1` and above use `Help` -> `Find action` ->
>   `Restart ESLint Service`.

## Credits

Inspired by [Dirkdev98's](https://github.com/dirkdev98) initial design, solidified with
[@antfu/eslint-config](https://github.com/antfu/eslint-config/).

## License

[MIT](./LICENSE)

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