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

@tada5hi/eslint-plugin

v1.3.0

Published

ESLint rules for type locations, directory barrel boundaries and agent docs

Readme

@tada5hi/eslint-plugin

ESLint rules for the @tada5hi source conventions and for agent documentation (CLAUDE.md, AGENTS.md, .agents/).

Usage

npm install --save-dev eslint typescript typescript-eslint @tada5hi/eslint-plugin
import tada5hi from '@tada5hi/eslint-plugin';
import tseslint from 'typescript-eslint';

export default [
    {
        files: ['**/*.{ts,tsx,mts,cts}'],
        languageOptions: { parser: tseslint.parser },
    },
    tada5hi.configs.conventions,
];

The preset does not configure or depend on a TypeScript parser. Supply your own parser configuration, as above, or use your existing TypeScript ESLint config.

The preset applies the custom rules to **/src/**/*.{ts,tsx,mts,cts} (not Vue or build/test configuration files). For manual use, including plain JavaScript import rules with ESLint's default parser:

import tada5hi from '@tada5hi/eslint-plugin';

export default [{
    plugins: { '@tada5hi': tada5hi },
    rules: {
        '@tada5hi/no-reexport-shims': 'error',
        '@tada5hi/no-root-barrel-import': 'error',
    },
}];

Rules

  • lines-between-class-members — autofixable Stylistic class-member spacing with support for TypeScript abstract properties and auto-accessors in its field selector. Accepts the same options as @stylistic/lines-between-class-members; the shared config and conventions preset require a blank line after fields only (prev: 'field', next: '*'), leaving method-to-method spacing unchanged. Does not mutate the parser AST.

  • no-collection-call-in-condition — extract collection operations into named variables rather than putting them in if / else if, while, do…while, for tests, or ternary conditions. Matches map, filter, flatMap, some, every, find, findIndex, findLast, findLastIndex, reduce, and reduceRight by method name, including chains, optional calls, and static computed method names. Simple predicates, includes, and has remain allowed. This syntax-only rule also matches unrelated methods with these names. Deferred function bodies (including IIFEs) and deferred instance-field initializers inside conditions are not inspected, nor are Vue template expressions. No autofix: preserve short-circuiting and loop re-evaluation when extracting a value.

const hasActiveItems = items.some(isActive);

if (hasActiveItems) {
    process(items);
}
  • type-declaration-location — exported top-level interfaces and type aliases belong in types.ts, types.mts, types.cts, or types.tsx. This includes declarations exported later or by a default export. Private top-level types and local types are allowed. Ambient declaration files (.d.ts, .d.mts, .d.cts) are exempt. Namespace and module-local declarations are not top-level and are allowed; no interface-versus-alias semantics are enforced.

  • no-reexport-shims — top-level export-from declarations are allowed only in index directory barrels, including index.d.ts, index.d.mts, and index.d.cts. Ambient module re-exports are not file barrels and are exempt. Their source must begin with ./ and normalize within that barrel directory's subtree. Named local exports are allowed.

  • no-root-barrel-import — internal relative static imports, dynamic imports, unshadowed CommonJS require() calls, TypeScript import-equals declarations, and TypeScript import types may not target the nearest src root or its explicit index file. Nested and sibling barrels remain allowed. For Windows absolute filenames (drive-letter or UNC paths), CommonJS require() and TypeScript import-equals requests also recognize backslash separators; ESM and POSIX requests are unchanged.

  • agent-docs-max-size — an agent document (CLAUDE.md, AGENTS.md, .agents/**/*.md) stays under maxBytes (default 40000).

  • agent-docs-no-history — no phrase that narrates history instead of stating the current rule. Default patterns (case-insensitive regular expressions, \s+ between words so a phrase wrapped onto the next line still matches): plan NNN, used to (not after a form of "be" or "get", the passive voice), before #N, no longer, pinned by. A match touching a code span, a code block (fenced or indented) or HTML is skipped.

  • agent-docs-import-budget — a root document (CLAUDE.md, AGENTS.md) and everything its @ imports load, followed breadth first relative to the importing file up to five hops like Claude Code does, each file counted once, stays under maxBytes (default 60000). Relative, absolute and non-ASCII paths are recognized. An @...md import that cannot be read is reported, also inside an imported file, where the report sits on the root import that leads to it and names both files; other @ tokens such as @scope/package are ignored unless they name a file.

The agent-docs-* rules are written for Markdown: code and HTML regions come from a CommonMark parse (mdast-util-from-markdown), and @tada5hi/eslint-config wires the rules to @eslint/markdown. Apart from the import budget, the rules do not resolve files or use a TypeScript program. Only lines-between-class-members provides autofixes; the other rules require manual changes. Filename-based checks are skipped when ESLint provides an unknown filename.

Exceptions

Place overrides after tada5hi.configs.conventions (or after the shared config). Use the exact rule IDs to disable individual policies, optionally adding files to limit an exception:

{
    rules: {
        '@tada5hi/lines-between-class-members': 'off',
        '@tada5hi/no-collection-call-in-condition': 'off',
        '@tada5hi/type-declaration-location': 'off',
        '@tada5hi/no-reexport-shims': 'off',
        '@tada5hi/no-root-barrel-import': 'off',
        '@tada5hi/agent-docs-max-size': ['error', { maxBytes: 60000 }],
        '@tada5hi/agent-docs-no-history': 'off',
        '@tada5hi/agent-docs-import-budget': ['error', { maxBytes: 180000 }],
    },
}