Alephic's custom ESLint rules.
pnpm add -D @alephic/eslint-pluginRequires ESLint >= 9 (flat config).
// eslint.config.js
import alephic from '@alephic/eslint-plugin'
import { defineConfig } from 'eslint/config'
export default defineConfig([...alephic.configs.recommended])Or configure rules individually:
import alephic from '@alephic/eslint-plugin'
import { defineConfig } from 'eslint/config'
export default defineConfig([
{
plugins: { '@alephic': alephic },
rules: {
'@alephic/symmetric-never-exclusions': 'error',
},
},
])💼 Configurations enabled in.
✅ Set in the recommended configuration.
🔧 Automatically fixable by the --fix CLI option.
| Name | Description | 💼 | 🔧 |
|---|---|---|---|
| symmetric-never-exclusions | Enforce symmetric ?: never exclusions in discriminated union types | ✅ | 🔧 |
| test-exercises-code | Require test describe/it titles to name identifiers that the file actually references, so tests exercise the real code instead of a parallel reimplementation. | ✅ | |
| use-step-exports-only | In files that contain a 'use step' function, only step functions and type-only exports are allowed, and module-level statements must be pure. Non-step exports and side-effectful top-level statements survive the Workflow DevKit's step-stubbing and drag the file's import chain into the workflow VM bundle. | ✅ |
pnpm install
pnpm test # vitest rule-tester suites (watch mode locally, single run in CI)
pnpm lint # eslint --fix + prettier --write + typecheck
pnpm build # tsdown → dist/ (ESM)
pnpm build && pnpm eslint-doc-generator # regenerate rules docsNew rules go in src/rules/<rule-name>.ts with a colocated
<rule-name>.test.ts and a docs/rules/<rule-name>.md page, and must be
registered in src/index.ts (both rules and configs.recommended — default
severity is error). After adding or editing a rule, run
pnpm build && pnpm eslint-doc-generator to regenerate the README rules table
and docs/rules headers (the generator loads the plugin from dist/); CI
fails if they're stale.
Releases are automated with changesets:
- In your PR, run
pnpm changesetand pick a bump. Adding or tightening a rule is breaking for consumers (new CI failures) — use a major bump for that once past 1.0; bug fixes that only remove false positives are a patch. - Merge the PR. The release job in
ci.ymlopens (or updates) achore: releasePR that accumulates pending changesets and their changelog entries. - Merge the release PR. Once the CI job passes on main, the release job publishes the new version to npmjs (via trusted publishing/OIDC, with provenance).
No npm tokens are involved: npmjs trusts the ci.yml workflow directly.
MIT