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

@mlaursen/eslint-config

v11.0.1

Published

An eslint config used by mlaursen for most projects.

Readme

@mlaursen/eslint-config

A reusable eslint config that I use for most of my projects.

Starting at 5.0.0, I only support eslint@^9 or greater.

Installation

npm install -D eslint @mlaursen/eslint-config

Then create an eslint.config.mjs with one of the following:

// @ts-check
import { configs, gitignore } from "@mlaursen/eslint-config";
import { defineConfig } from "eslint/config";

export default defineConfig([
  gitignore(import.meta.url),
  ...configs.recommendedFrontend({
    // Optional: enable additional react-refresh eslint rules
    reactRefresh: "vite",
    // reactRefresh: "next",
    // reactRefresh: "recommended",

    // Optional: enable additional react-compiler eslint rules
    reactCompiler: true,

    // Optional: defaults to `"vitest"`
    testFramework: "jest",

    // Optional: enables strict type checking with tsc (slower)
    tsconfigRootDir:
      process.env.STRICT_TYPING === "true" ? import.meta.dirname : undefined,
  }),
]);
import { configs, gitignore } from "@mlaursen/eslint-config";
import { defineConfig } from "eslint/config";

export default defineConfig([
  gitignore(import.meta.url),
  ...configs.recommended({
    // Optional: defaults to `"vitest"`
    testFramework: "jest",

    // Optional: enables strict type checking with tsc (slower)
    tsconfigRootDir:
      process.env.STRICT_TYPING === "true" ? import.meta.dirname : undefined,
  }),
]);

Next.js Setup

This is no longer included in this eslint-config since it requires the eslint plugin to be installed in the project to work. Here are the setup steps:

npm install -D @next/eslint-plugin-next
yarn add -D @next/eslint-plugin-next
pnpm add -D @next/eslint-plugin-next

Next.js >= 16

 import { configs, gitignore } from "@mlaursen/eslint-config";
 import { defineConfig } from "eslint/config";
+import nextPlugin from "@next/eslint-plugin-next";

 // somewhat strict type checking
 export default defineConfig([
+  nextPlugin.configs["core-web-vitals"],
   gitignore(import.meta.url),
   ...configs.recommendedFrontend(),
 ]);

Next.js < 16

 // @ts-check
+import { FlatCompat } from "@eslint/eslintrc";
 import { configs, gitignore } from "@mlaursen/eslint-config";
 import { defineConfig } from "eslint/config";

+const compat = new FlatCompat({
+  baseDirectory: import.meta.dirname,
+});
+

 // somewhat strict type checking
 export default defineConfig([
   gitignore(import.meta.url),
+  ...compat.config({
+    extends: ["plugin:@next/next/recommended"],
+    // or with core-web-vitals
+    // extends: ["plugin:@next/next/core-web-vitals"],
+  }),
   ...configs.recommendedFrontend(),
 ]);

Configs

I normally just use the recommended or recommendedFrontend configs, but the others can be used individually if needed.

recommended

// @ts-check
import { configs, gitignore } from "@mlaursen/eslint-config";
import { defineConfig } from "eslint/config";

export default defineConfig([
  gitignore(import.meta.dirname),
  ...configs.recommended({ testFramework: "jest" }),
]);

// or with strict type checking
export default defineConfig([
  gitignore(import.meta.dirname),
  ...configs.recommended({
    testFramework: "jest",
    tsconfigRootDir: import.meta.dirname,
  }),
]);

recommendedFrontend

// @ts-check
import { configs, gitignore } from "@mlaursen/eslint-config";
import { defineConfig } from "eslint/config";

export default defineConfig([
  gitignore(import.meta.dirname),
  ...configs.recommendedFrontend({
    reactRefresh: "next",
    reactCompiler: true,
    testFramework: "jest",
  }),
]);

// or with strict type checking
export default defineConfig([
  gitignore(import.meta.dirname),
  ...configs.recommendedFrontend({
    reactRefresh: "next",
    reactCompiler: true,
    testFramework: "jest",
    tsconfigRootDir: import.meta.dirname,
  }),
]);

base

The base config is automatically used by the typescript config and is just the eslint.configs.recommended and a few other stylistic changes.

This should not be used if the typescript config is used.

// @ts-check
import { configs } from "@mlaursen/eslint-config";
import { defineConfig } from "eslint/config";

export default defineConfig(configs.base);

scripts

The scripts config is used to allow console.log() functions in scripts/**:

// @ts-check
import { configs } from "@mlaursen/eslint-config";
import { defineConfig } from "eslint/config";

export default defineConfig([...configs.base, ...configs.scripts]);

typescript

This extends the base config and the tseslint.configs.strict config. It also includes a few stylistic choices for type behavior and disabled strict rules in test files.

// @ts-check
import { configs } from "@mlaursen/eslint-config";
import { defineConfig } from "eslint/config";

export default defineConfig(configs.typescript());

// or with strict type checking
export default defineConfig(
  configs.typescript({ tsconfigRootDir: import.meta.dirname })
);

testing

This enables the jest or vitest rules along with jestDom.

// @ts-check
import { configs } from "@mlaursen/eslint-config";
import { defineConfig } from "eslint/config";

export default defineConfig(configs.testing({ testFramework: "jest" }));

// or vitest
export default defineConfig(configs.testing({ testFramework: "vitest" }));

jest

This only enables the eslint-plugin-jest.configs["flat/recommended"] rules on tests files and should not be used if using testing.

// @ts-check
import { configs } from "@mlaursen/eslint-config";
import { defineConfig } from "eslint/config";

export default defineConfig(configs.jest);

jestDom

This only enables the eslint-plugin-jest-dom.configs["flat/recommended"] rules on tests files and should not be used if using testing.

// @ts-check
import { configs } from "@mlaursen/eslint-config";
import { defineConfig } from "eslint/config";

export default defineConfig(configs.jestDom);

vitest

This only enables the @vitest/eslint-plugin rules on test files and should not be used if using testing.

testingLibraryReact

This enables the eslint-plugin-testing-library/.configs["flat/react"] plugin and rules on test files.

// @ts-check
import { configs } from "@mlaursen/eslint-config";
import { defineConfig } from "eslint/config";

export default defineConfig(configs.vitest);
// @ts-check
import { configs } from "@mlaursen/eslint-config";
import { defineConfig } from "eslint/config";

export default defineConfig(configs.testingLibraryReact);

testingLibraryDom

This enables the eslint-plugin-testing-library/.configs["flat/dom"] plugin and rules on test files.

This should not be used with the testingLibraryReact rules

// @ts-check
import { configs } from "@mlaursen/eslint-config";
import { defineConfig } from "eslint/config";

export default defineConfig(configs.testingLibraryDom);

react

This enables the eslint-plugin-react and eslint-plugin-react-hooks:

// @ts-check
import { configs } from "@mlaursen/eslint-config";
import { defineConfig } from "eslint/config";

export default defineConfig(configs.react());

// or with the react compiler rules enabled
export default defineConfig(configs.react(true));

jsxA11y

This enables eslint-plugin-jsx-a11y:

// @ts-check
import { configs } from "@mlaursen/eslint-config";
import { defineConfig } from "eslint/config";

export default defineConfig(configs.jsxA11y);

unicorn

This enables some rules from eslint-plugin-unicorn:

// @ts-check
import { configs } from "@mlaursen/eslint-config";
import { defineConfig } from "eslint/config";

export default defineConfig(configs.unicorn);