npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dubium/eslint-config

v2.0.4

Published

Opinionated ESLint flat config for strict TypeScript, React and NestJS projects.

Readme

@dubium/eslint-config

Language: English | Русский

Opinionated ESLint flat config for TypeScript, React, NestJS, Node.js, and browser projects.

The package is built as a set of composable presets. Framework rules, runtime globals, test globals, and formatter compatibility are intentionally separated, so each project can opt in only to what it actually uses.

Requirements

Node.js     >=22.13.0
ESLint      >=10.5.0 <11
TypeScript  >=6.0.3 <7

This package is ESM-only and supports only ESLint flat config.

Installation

npm install -D @dubium/eslint-config eslint typescript

If the project uses Prettier, install Prettier compatibility separately:

npm install -D eslint-config-prettier prettier

Quick start

React strict

import { defineConfig } from "eslint/config"

import { reactStrict } from "@dubium/eslint-config"

export default defineConfig([...reactStrict])

React strict + Prettier

import { defineConfig } from "eslint/config"

import { reactStrict } from "@dubium/eslint-config"

import eslintConfigPrettier from "eslint-config-prettier"

export default defineConfig([
 ...reactStrict,

 // Keep last when the project is formatted by Prettier.
 eslintConfigPrettier,
])

NestJS strict

import { defineConfig } from "eslint/config"

import { nestStrict } from "@dubium/eslint-config"

export default defineConfig([...nestStrict])

TypeScript recommended

import { defineConfig } from "eslint/config"

import { recommended } from "@dubium/eslint-config"

export default defineConfig([...recommended])

TypeScript fast recommended

Use this preset when type-aware linting is too expensive or the project does not have a stable TypeScript project setup yet.

import { defineConfig } from "eslint/config"

import { recommendedFast } from "@dubium/eslint-config"

export default defineConfig([...recommendedFast])

Optional runtime presets

Runtime presets are not included in React/Nest presets automatically. Add them only when the project needs their globals or runtime-specific rules.

import { defineConfig } from "eslint/config"

import { browserRuntime, reactStrict, vitestRuntime } from "@dubium/eslint-config"

import eslintConfigPrettier from "eslint-config-prettier"

export default defineConfig([...reactStrict, ...browserRuntime, ...vitestRuntime, eslintConfigPrettier])

Available runtime presets:

| Preset | Purpose | | ---------------- | ---------------------------------------------------------------------------- | | browserRuntime | Browser globals such as window, document, localStorage, HTMLElement. | | nodeRuntime | Node.js globals and Node-specific rules from eslint-plugin-n. | | vitestRuntime | Vitest globals for *.test.*, *.spec.*, test/**, and tests/**. | | jestRuntime | Jest globals and Jest test rules. |

Config files

Base rules disallow default exports in regular TypeScript/JavaScript modules. Config files commonly use export default, so if your lint command checks the project root with eslint ., add a small local override:

import { defineConfig } from "eslint/config"

import { reactStrict } from "@dubium/eslint-config"

import eslintConfigPrettier from "eslint-config-prettier"

export default defineConfig([
 ...reactStrict,

 {
  files: ["eslint.config.{js,mjs,cjs,ts,mts,cts}", "*.config.{js,mjs,cjs,ts,mts,cts}"],
  rules: {
   "no-restricted-exports": "off",
  },
 },

 eslintConfigPrettier,
])

Keep this override local. The package does not force a specific bundler, runtime, or config file structure.

Prettier

Prettier is intentionally not bundled into the presets.

Recommended setup: use ESLint for code quality and Prettier as a separate formatter.

npm install -D eslint-config-prettier prettier
import { defineConfig } from "eslint/config"

import { reactStrict } from "@dubium/eslint-config"

import eslintConfigPrettier from "eslint-config-prettier"

export default defineConfig([
 ...reactStrict,

 // Keep last when the project is formatted by Prettier.
 eslintConfigPrettier,
])

Recommended scripts:

{
 "scripts": {
  "lint": "eslint .",
  "format": "prettier --write .",
  "format:check": "prettier --check ."
 }
}

The presets contain no formatter-owned layout rules. eslint-config-prettier is kept as a final compatibility layer for third-party rules and future changes.

Presets

Base presets

| Preset | Description | | ----------------- | -------------------------------------------------------------------- | | recommendedFast | Fast TypeScript/JavaScript config without type-aware semantic rules. | | recommended | Main TypeScript/JavaScript config with type-aware semantic rules. | | legacy | Softer migration preset based on recommendedFast. |

TypeScript layers

| Preset | Description | | -------------------- | ------------------------------------------------------------------- | | typescriptBase | TypeScript parser and syntax-aware rules. | | typescriptSemantic | Type-aware rules using TypeScript project service. | | typescriptSorting | TypeScript-specific sorting rules. | | typescriptStrict | typescriptBase + typescriptSemantic + additional strict limits. |

React presets

| Preset | Description | | ------------------ | ----------------------------------------------------- | | reactRecommended | recommended + React core rules + React hooks. | | reactStrict | reactRecommended with stricter React rules. | | reactCore | React/JSX correctness rules. | | reactHooks | React Hooks rules for hook files and component files. |

reactHooks is available from the React subpath:

import { reactHooks } from "@dubium/eslint-config/react"

NestJS presets

| Preset | Description | | ----------------- | -------------------------------------------------- | | nestRecommended | Recommended TypeScript rules + NestJS conventions. | | nestStrict | Stricter NestJS preset. | | nestConventions | NestJS naming and structure conventions. |

Common layers

| Preset | Description | | ------------------ | ----------------------------------------------------- | | commonIgnores | Default ignored folders and generated outputs. | | commonJavascript | JavaScript correctness rules and module restrictions. | | commonComments | ESLint disable/comment discipline. |

Import paths

Most users can import from the root package:

import { reactStrict, browserRuntime, vitestRuntime } from "@dubium/eslint-config"

Subpath imports are also available:

import { reactStrict } from "@dubium/eslint-config/react"
import { browserRuntime } from "@dubium/eslint-config/browser"
import { nodeRuntime } from "@dubium/eslint-config/node"
import { vitestRuntime } from "@dubium/eslint-config/vitest"
import { jestRuntime } from "@dubium/eslint-config/jest"
import { nestStrict } from "@dubium/eslint-config/nest"

More granular subpaths are available for advanced composition:

import { reactHooks } from "@dubium/eslint-config/react/hooks"
import { typescriptSemantic } from "@dubium/eslint-config/typescript/semantic"
import { typescriptSorting } from "@dubium/eslint-config/typescript/sorting"

Rules and conventions

The config intentionally enforces several project conventions:

  • no export * from public API files;
  • no default exports in regular TypeScript/JavaScript modules;
  • direct default export is allowed in React files for React.lazy(() => import(...)) compatibility;
  • default re-exports are still restricted;
  • type-only imports are required for types;
  • imports, exports, and JSX props are not sorted;
  • React Fast Refresh safety is checked with eslint-plugin-react-refresh;
  • React Hooks are checked separately from JSX/browser runtime;
  • browser, Node.js, Vitest, and Jest globals are opt-in runtime layers.

Sorting

Import declarations, named imports, exports, export attributes, and JSX props are not sorted.

The only remaining sorting layer is typescriptSorting, which checks TypeScript type structures:

typescriptSorting:
  sort-enums
  sort-interfaces
  sort-object-types
  sort-union-types
  sort-intersection-types

Override or omit typescriptSorting when this ordering is not needed.

License

MIT