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

@schafevormfenster/eslint-plugin

v0.0.8

Published

This package contains **Custom ESLint Rules** that enforce logging, architectural, REST, testing, and other domain-specific patterns for the `@schafevormfenster` platform. It translates our internal guidelines into automated checks that run before code is

Downloads

679

Readme

@schafevormfenster/eslint-plugin

This package contains Custom ESLint Rules that enforce logging, architectural, REST, testing, and other domain-specific patterns for the @schafevormfenster platform. It translates our internal guidelines into automated checks that run before code is committed or deployed.

Purpose

This custom ESLint plugin serves three key functions:

  • Enforcement: Automates the verification of internal coding guides (e.g., "Always log before throwing," "Include required API route files").
  • Education: Provides helpful error messages to guide developers towards correct patterns during development.
  • Safety: Prevents common domain-specific mistakes (e.g., logging sensitive keys, missing cache headers in GET handlers).

Integration

This plugin is designed to be used via @schafevormfenster/eslint-config, which provides pre-configured rule sets for different project types. The plugin integrates seamlessly into your development workflow, running checks during:

  • Local development (IDE integration)
  • Pre-commit hooks
  • CI/CD pipelines

Documentation Structure

This plugin provides two types of documentation:

📚 Coding Instructions (docs/instructions/)

Living guidelines for engineers and AI coding agents. These documents describe how to write code that complies with our architectural patterns:

For Engineers and AI Agents: Consult these instruction documents as your primary coding guidelines. See INSTRUCTIONS.md for details on how to use these guides.

For Consuming Applications: Maintain an AGENTS.md file in your project root that references these instruction documents so AI coding agents know to follow them before ESLint enforcement runs. See INSTRUCTIONS.md for the recommended pattern.

📋 Rule Catalog (docs/rules/)

Technical documentation for each ESLint rule, including examples of correct and incorrect code:

See the full rule catalog below for a complete list organized by domain.

Semantic Module Architecture

We use a "Logical Monolith" structure. All custom rules live in this single package but are organized into semantic modules (domains). You can enable rules for specific domains without enabling everything.

Domains

  • Logging: Enforces structured logging, pino usage, and error handling.
  • Architecture: Enforces file naming conventions (kebab-case) and folder structures.
  • Caching: Enforces correct caching headers and HTTP method usage.
  • REST: Enforces API route structure, schema exports, and path conventions.
  • Stack: Enforces technology choices and prevents forbidden imports.
  • Testing: Enforces testing best practices (env vars, error matching, file naming).
    • Testing-E2E: Rules specific to end-to-end tests (Playwright).
    • Testing-Unit: Rules specific to unit tests (Vitest).
    • Testing-Integration: Rules specific to integration tests (Vitest).
  • Security: (Planned) Prevents usage of insecure patterns.
  • Queue: (Planned) Enforces correct retry behavior for queue handlers.

Usage

Typically, you will use this via @schafevormfenster/eslint-config. However, if you need to use it directly or want to understand the available modular configs:

import svfPlugin from "@schafevormfenster/eslint-plugin";

export default [
  {
    plugins: {
      "@schafevormfenster": svfPlugin
    },
    // Option A: Use a preset (Recommended)
    ...svfPlugin.configs.logging.rules,

    // Option B: Configure manually
    rules: {
      "@schafevormfenster/enforce-log-before-throw": "error",
      "@schafevormfenster/no-sensitive-log-keys": "error"
    }
  },
  // Example: Apply E2E testing rules to e2e directory
  {
    files: ["**/e2e/**/*.spec.ts"],
    rules: {
      ...svfPlugin.configs["testing-e2e"].rules
    }
  },
  // Example: Apply Unit testing rules to test files
  {
    files: ["**/*.test.ts"],
    rules: {
      ...svfPlugin.configs["testing-unit"].rules
    }
  }
];

Rules

💼 Configurations enabled in.
⚠️ Configurations set to warn in.
🔧 Automatically fixable by the --fix CLI option.

| Name                           | Description | 💼 | ⚠️ | 🔧 | | :----------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------ | :----------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------ | :- | | enforce-api-route-structure | Enforce presence of required files for API routes (route.test.ts, *.contract.ts, *.schema.ts) | badge-rest | | | | enforce-apitest-env-vars | Forbid process.env access in e2e/ unless variable starts with APITEST_ or is TEST_ENV | badge-testing badge-testing-e2e | | | | enforce-file-naming | Enforce kebab-case file naming with semantic suffixes | | badge-architecture | | | enforce-folder-structure | Enforce src/ folders: app, clients, lib, types, test, services | | badge-architecture | | | enforce-get-logger-category | Enforce getLogger to be called with a category string | badge-logging badge-logging-legacy | | | | enforce-log-before-throw | Enforce logging before throwing an error | badge-logging badge-logging-legacy | | | | enforce-log-level-before-throw | Enforce log level before throwing an error | | badge-logging badge-logging-legacy | | | enforce-schema-type-export | Every exported Zod schema must have a corresponding exported TypeScript type using z.infer | badge-rest | | | | enforce-semantic-cache-headers | Ensure Cache-Control header is set in GET route handlers | | badge-caching | | | enforce-structured-logging | Enforce structured logging (context object + message) | badge-logging badge-logging-legacy | | | | enforce-test-file-naming | Enforce *.spec.ts for Playwright tests and *.test.ts for Vitest tests | badge-testing badge-testing-e2e badge-testing-integration badge-testing-unit | | | | enforce-token-in-path | Enforce that API routes either include [token] in path or validate params.token in handler | badge-rest | | | | no-env-preservation-in-tests | Forbid preserving and restoring process.env values in tests - tests should set their own env vars | badge-testing badge-testing-e2e badge-testing-integration badge-testing-unit | | 🔧 | | no-forbidden-imports | Forbid libraries that have preferred alternatives per tech stack | | badge-stack | | | no-raw-logging | Prevent logging raw objects without a message | | badge-logging badge-logging-legacy | | | no-redundant-normalize-error | Detect and forbid calls to normalizeError() inside log.error(), as the logger handles this internally | badge-logging badge-logging-legacy | | | | no-reexport-files | Prevent files that primarily re-export from other modules | | badge-architecture | | | no-sensitive-log-keys | Prevent logging of sensitive keys | badge-logging badge-logging-legacy | | | | no-unsafe-log-property-access | Prevent unsafe property access in log context | | badge-logging badge-logging-legacy | | | no-use-cache-in-post | Forbid "use cache" directive in POST request handlers | badge-caching | | | | one-function-per-file | Warn if a file exports multiple named functions | | badge-architecture | | | prefer-custom-logger | Enforce use of custom logger instead of console | | badge-logging badge-logging-legacy | | | prefer-loose-error-matching | Prefer regex matching over exact string matching for error messages | | badge-testing badge-testing-integration badge-testing-unit | | | prefer-schema-extension | Warn if a Zod object is defined from scratch without using .extend() or .merge() when it could reuse common schemas | | badge-rest | | | require-env-setup-in-tests | Require beforeEach to initialize env vars when tests access process.env | | badge-testing badge-testing-integration badge-testing-unit | 🔧 | | require-error-in-log-error | Ensure log.error includes an error object | | badge-logging badge-logging-legacy | |