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

@mdor/eslint-config

v0.0.3

Published

Shared ESLint flat configuration for MDOR JavaScript projects

Downloads

27

Readme

@mdor/eslint-config

Shared ESLint flat configuration for JavaScript and TypeScript projects. The package is written in JavaScript, has no build output, and combines Perfectionist, RegExp, SonarJS, and Unicorn rules in one JavaScript configuration object. It does not configure framework-specific plugins. It is ESM-only and ships TypeScript declarations.

Requirements

  • Node.js 22.13 or newer
  • npm 10 or newer
  • ESLint 10.8 or newer within the 10.x release line (^10.8.0)
  • TypeScript 5.5.4 or newer within the supported range

Install

npm install --save-dev @mdor/eslint-config

ESLint, TypeScript ESLint, TypeScript, and the other four plugins are peer dependencies because the consuming project owns their versions. npm 7 and newer installs compatible peers automatically when needed. Package managers configured not to install peers automatically require the peer dependencies explicitly.

npm install --save-dev eslint@^10.8.0 eslint-plugin-perfectionist@^5.10.1 eslint-plugin-regexp@^3.1.1 eslint-plugin-sonarjs@^4.2.0 eslint-plugin-unicorn@^73.0.0 typescript typescript-eslint@^8.67.0

Use

// eslint.config.js
import mdorConfig from "@mdor/eslint-config";

export default mdorConfig;

Add project-specific settings by composing the exported array:

// eslint.config.js
import mdorConfig from "@mdor/eslint-config";

export default [
  ...mdorConfig,
  {
    files: ["scripts/**/*.js"],
    rules: {
      "no-console": "off",
    },
  },
];

The named eslintConfig export references the same flat-config array.

Plugin examples

Use the complete preset

The default export enables the shared rules and all five plugins for JavaScript, JSX, TypeScript, and TSX files:

// eslint.config.js
import mdorConfig from "@mdor/eslint-config";

export default [
  ...mdorConfig,
  {
    rules: {
      // Project overrides go last and therefore take precedence.
      "perfectionist/sort-imports": "off",
      "unicorn/prefer-at": "warn",
      "sonarjs/cognitive-complexity": ["error", 25],
      "@typescript-eslint/no-explicit-any": "warn",
    },
  },
];

Override plugins for specific files

Flat-config entries are applied in order. Put file-specific exceptions after the shared preset:

// eslint.config.js
import mdorConfig from "@mdor/eslint-config";

export default [
  ...mdorConfig,
  {
    files: ["tests/**/*.js"],
    rules: {
      "perfectionist/sort-objects": "off",
      "sonarjs/no-duplicate-string": "off",
      "unicorn/no-null": "off",
    },
  },
  {
    files: ["scripts/**/*.cjs"],
    rules: {
      "unicorn/prefer-module": "off",
    },
  },
];

Enable or tune individual rules

Rules use their standard plugin prefixes:

// eslint.config.js
import mdorConfig from "@mdor/eslint-config";

export default [
  ...mdorConfig,
  {
    rules: {
      // Consistent natural ordering.
      "perfectionist/sort-imports": "error",
      "perfectionist/sort-named-imports": "error",

      // RegExp correctness and performance.
      "regexp/no-dupe-characters-character-class": "error",
      "regexp/no-super-linear-backtracking": "error",

      // Maintainability and bug detection.
      "sonarjs/cognitive-complexity": ["warn", 20],
      "sonarjs/no-identical-functions": "error",

      // Modern JavaScript conventions.
      "unicorn/prefer-at": "error",
      "unicorn/prefer-node-protocol": "error",
    },
  },
];

For example, these plugins can sort imports and objects naturally, report duplicate regular-expression characters, detect catastrophic backtracking risks, find duplicated or overly complex functions, and flag older JavaScript patterns such as items[items.length - 1].

Public API

  • The default and named eslintConfig exports contain the complete flat-config array.

Plugin-specific configuration objects are intentionally not exported. All plugin registrations, settings, and rules are consolidated into the preset's single JavaScript and TypeScript configuration object.

Scope

The preset applies to .js, .mjs, .cjs, .jsx, .ts, .mts, .cts, and .tsx files. It parses JavaScript and TypeScript without requiring type-aware linting or a tsconfig.json. It enables correctness and bug-prevention rules, treats unused ESLint disable comments as errors, and ignores common generated directories. It also enables TypeScript ESLint's recommended rules, natural ordering from eslint-plugin-perfectionist, recommended RegExp and SonarJS rules, and selected Unicorn rules. Formatting rules unrelated to statement ordering are intentionally left to Prettier.

Rules that require TypeScript type information are disabled in this portable preset. Consumers that want rules such as no-floating-promises or no-confusing-void-expression should add a project-specific type-aware config with parserOptions.projectService: true after this preset.

Runtime enforcement

The package declares Node.js and npm requirements through engines. npm reports incompatible consumer environments and rejects them when engine-strict=true. The matching devEngines policy uses onFail: "error" when this package is developed directly with npm.

Activate the repository runtime before running package commands:

nvm use 22.13.0

Validate and release

npm run typecheck --workspace @mdor/eslint-config
npm test --workspace @mdor/eslint-config
npm pack --workspace @mdor/eslint-config --dry-run
npm run release-patch-try --workspace @mdor/eslint-config

Publishing requires npm authentication with access to the @mdor organization.