npm package: @schafevormfenster/eslint-config
Description: This package serves as the central **Configuration Hub** for ESLint across the `@schafevormfenster` monorepo. It orchestrates community standards (Next.js, TypeScript, Prettier) and integrates our internal custom rules.
Latest version: 0.0.24

# @schafevormfenster/eslint-config

This package serves as the central **Configuration Hub** for ESLint across the `@schafevormfenster` monorepo. It orchestrates community standards (Next.js, TypeScript, Prettier) and integrates our internal custom rules.

## Purpose

- **Standardization**: Ensures all projects (apps, libraries, tests) follow the same coding standards.
- **Simplicity**: Projects only need to install this one package instead of managing dozens of ESLint plugins and dependencies.
- **Modularity**: Provides composable configurations for different tech stacks (Next.js, Library, Playwright, etc.).

## Documentation

> **For detailed rule documentation, usage examples, and offline access patterns**, see [**RULES_REFERENCE.md**](docs/RULES_REFERENCE.md) or the [@schafevormfenster/eslint-plugin documentation](https://www.npmjs.com/package/@schafevormfenster/eslint-plugin).

The RULES_REFERENCE guide includes:
- Complete mapping of all rules by configuration
- Path patterns to find documentation in node_modules (for offline/isolated environments)
- Detailed explanations of when and how to use each modular config
- Guidance for AI coding agents on referencing documentation

## General Approach

This package exports **Flat Config** arrays that can be easily combined in your project's `eslint.config.mjs`. It wraps:
- **Community Plugins**: `@typescript-eslint`, `@next/eslint-plugin-next`, `eslint-plugin-zod`, `eslint-plugin-playwright`, etc.
- **Internal Rules**: `@schafevormfenster/eslint-plugin` (Logging, Architecture, etc.).

## Usage

In your application's `eslint.config.mjs`:

```javascript
import { defineConfig } from "eslint/config";
import svfNext from "@schafevormfenster/eslint-config/next";
import svfLogging from "@schafevormfenster/eslint-config/logging";
import svfPlaywright from "@schafevormfenster/eslint-config/playwright";

export default defineConfig([
  // 1. Base Stack (Next.js + TypeScript + React)
  ...svfNext,

  // 2. Domain Specific Rules
  ...svfLogging,

  // 3. Testing Overrides (only applies to test files)
  ...svfPlaywright,

  // 4. Local Overrides
  {
    rules: {
      "no-console": "warn"
    }
  }
]);
```

### Available Configurations

> For detailed information about each configuration's purpose, rules, and when to use them, see [RULES_REFERENCE.md](docs/RULES_REFERENCE.md).

- **`@schafevormfenster/eslint-config`** (default): Base TypeScript & Node.js rules.
- **`@schafevormfenster/eslint-config/base`**: Minimal plugin registration only (advanced usage).
- **`@schafevormfenster/eslint-config/next`**: For Next.js applications (includes React & Hooks).
- **`@schafevormfenster/eslint-config/library`**: For pure TypeScript libraries.
- **`@schafevormfenster/eslint-config/logging`**: Enforces internal logging standards.
- **`@schafevormfenster/eslint-config/architecture`**: Enforces file naming and folder structure.
- **`@schafevormfenster/eslint-config/caching`**: Enforces caching strategies (e.g. no cache in POST).
- **`@schafevormfenster/eslint-config/rest`**: Enforces REST API design standards (route structure, schemas).
- **`@schafevormfenster/eslint-config/stack`**: Enforces tech stack constraints (e.g. forbidden imports).
- **`@schafevormfenster/eslint-config/playwright`**: For E2E test suites.
- **`@schafevormfenster/eslint-config/vitest`**: For Vitest unit, component, and integration test suites.
- **`@schafevormfenster/eslint-config/component`**: For Vitest component test suites (`*.component.test.ts`).
- **`@schafevormfenster/eslint-config/integration`**: For Integration test suites.
- **`@schafevormfenster/eslint-config/testing-coverage`**: For source-file test coverage checks (`require-component-test`, `require-integration-test`).