@noctcore/eslint-plugin-code-quality
v0.1.0
Published
Portable code-quality, comment-hygiene, and test-discipline ESLint rules.
Downloads
51
Maintainers
Readme
@noctcore/eslint-plugin-code-quality
Portable code-quality, comment-hygiene, and test-discipline rules. Flat-config only, ESLint 9+. Every rule is de-projected — it keys off code and generic file-path globs, never a specific repo layout.
Install
bun add -D @noctcore/eslint-plugin-code-quality # or npm i -D / pnpm add -DUse
// eslint.config.js
import codeQuality from '@noctcore/eslint-plugin-code-quality';
export default [
codeQuality.configs.recommended,
];Or wire rules individually (including the ones not in recommended):
import codeQuality from '@noctcore/eslint-plugin-code-quality';
export default [
{
plugins: { 'noctcore-code-quality': codeQuality },
rules: {
'noctcore-code-quality/no-process-exit': ['error', { allowIn: ['**/scripts/**'] }],
// Opinionated / niche — off by default, opt in here:
'noctcore-code-quality/interface-prefix-i': 'error',
'noctcore-code-quality/no-template-trim-empty-ternary': 'error',
},
},
];Rules
recommended = ✅ enabled by the recommended preset. The two unchecked rules are exported and
documented but off by default (opinionated / niche) — enable them explicitly.
| Rule | Description | Recommended | Options |
| --- | --- | --- | --- |
| prefer-early-return | Prefer a guard clause over wrapping the whole function body in an if. | ✅ | |
| no-process-exit | Ban process.exit() outside bootstrap/shutdown paths and CLIs. | ✅ | allowIn |
| no-bare-date-now | Ban bare Date.now() / new Date(); read time through a mockable clock. | ✅ | allowIn |
| no-historical-comments | Ban comments framing code against its past ("before the fix", "used to"). | ✅ | |
| no-narration-comments | Ban step-by-step "Now we… / First we…" narration comments. | ✅ | |
| no-pr-reference-comments | Ban PR/issue references in comments. | ✅ | |
| no-focused-tests | Ban focused tests (.only / fdescribe / fit). | ✅ | |
| skipped-tests-need-tracking | Skipped tests must carry a tracking marker (issue URL or TODO(@owner)). | ✅ | markers, lookback |
| interface-prefix-i | Interface names must be I + uppercase. Opinionated house style. | | |
| no-template-trim-empty-ternary | Extract inline `…`.trim() === '' ? … to a named util. Niche. | | |
