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

@hughescr/eslint-config-default

v6.0.1

Published

Default base config for eslint

Readme

@hughescr/eslint-config-default

Shared ESLint flat config for JavaScript and TypeScript projects. Bundles a curated set of plugins and enforces consistent style, correctness, and type-safety rules out of the box.

  • ESLint v10, ESM module
  • BSD-3-Clause license

Installation

eslint is included as a dependency, so you do not need to install it separately.

bun add -D @hughescr/eslint-config-default

Usage

Create an eslint.config.mjs in your project root:

import hughescrDefault from '@hughescr/eslint-config-default';
import { defineConfig } from 'eslint/config';

export default defineConfig(
    ...hughescrDefault,
    // your project-specific overrides here
);

The package exports a complete flat config array. Spread it into defineConfig() and add any project-specific overrides after it.

What's Included

The following plugins are bundled and pre-configured:

  • @eslint/js — core ESLint rules
  • @stylistic/eslint-plugin — formatting rules
  • typescript-eslint — TypeScript support with type-checked rules
  • eslint-plugin-import-x — import ordering and hygiene
  • eslint-plugin-unicorn — opinionated best practices
  • eslint-plugin-sonarjs — code quality and cognitive complexity
  • eslint-plugin-lodash — Lodash usage patterns
  • eslint-plugin-n — Node.js-specific rules
  • eslint-plugin-promise — Promise best practices
  • eslint-plugin-regexp — regular expression correctness
  • @eslint-community/eslint-plugin-eslint-comments — lint comment hygiene
  • eslint-plugin-package-jsonpackage.json validation
  • @hughescr/eslint-plugin-test-hygiene — test-file hygiene rules (see below)
  • @hughescr/eslint-plugin-module-boundaries — module boundary integrity rules (see below)

Custom Rules

@hughescr/eslint-plugin-test-hygiene

Four rules enforced at error severity on all files. Docs: docs/rules/

| Rule | Severity | Description | |---|---|---| | @hughescr/test-hygiene/no-mock-module-in-test-body | error | mock.module() calls must live only in setup files, not inside describe/it blocks | | @hughescr/test-hygiene/require-fake-timers-cleanup | error | Every jest.useFakeTimers() must be paired with jest.useRealTimers() in a cleanup hook | | @hughescr/test-hygiene/require-mock-cleanup | error | Every jest.spyOn() must be paired with jest.restoreAllMocks() or mockRestore() in afterEach | | @hughescr/test-hygiene/require-mock-reset | error | Mocks imported from configured setup modules must have their reset helper called in afterEach |

@hughescr/eslint-plugin-module-boundaries

Three rules for TypeScript projects. Docs: docs/rules/

| Rule | Severity | Description | |---|---|---| | @hughescr/module-boundaries/no-internal-in-barrel | error | Barrel index.ts files must not re-export @internal-tagged symbols | | @hughescr/module-boundaries/no-star-export-from-non-barrel | error | Barrel index.ts files must not use export * from './x' for non-barrel files | | @hughescr/module-boundaries/no-cross-module-internal | off | Production code must not import @internal symbols from a different module — requires a modules option; off by default |

Enabling no-cross-module-internal

This rule requires a project-specific modules option that describes your architectural module layout. Add an override after spreading this config:

import hughescrDefault from '@hughescr/eslint-config-default';
import { defineConfig } from 'eslint/config';

export default defineConfig(
    ...hughescrDefault,
    {
        rules: {
            '@hughescr/module-boundaries/no-cross-module-internal': ['error', {
                modules: [
                    { name: 'agent',   pattern: 'src/agent/**' },
                    { name: 'storage', pattern: 'src/storage/**' },
                    // … one entry per architectural module
                ],
            }],
        },
    },
);

The modules array defines which directory trees form distinct boundaries. Imports of @internal-tagged symbols that cross those boundaries are flagged as errors.

Key Style Choices

  • 4-space indentation
  • Single quotes, semicolons required
  • Most rules use warn severity; error is reserved for critical correctness issues
  • eslint-disable comments must include a description

TypeScript Support

TypeScript rules are applied automatically to .ts, .tsx, .cts, and .mts files using typescript-eslint's type-checked configs. The buildTypescriptExtensionRules function automatically promotes applicable core ESLint rules to their @typescript-eslint equivalents.

Type-checked rules require a tsconfig.json in your project root. The config uses:

parserOptions: {
    projectService: true,
    tsconfigRootDir: process.cwd(),
}

If your project has no tsconfig.json, TypeScript files will still be linted but type-aware rules will be skipped.

Developer

To browse the full config interactively, inspect enabled/disabled rules, or find unconfigured rules:

bun rules-checkup