@noctcore/eslint-plugin-code-quality 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,58 @@
1
+ # @noctcore/eslint-plugin-code-quality
2
+
3
+ Portable code-quality, comment-hygiene, and test-discipline rules. Flat-config only, ESLint 9+.
4
+ Every rule is de-projected — it keys off code and generic file-path globs, never a specific
5
+ repo layout.
6
+
7
+ ## Install
8
+
9
+ ```sh
10
+ bun add -D @noctcore/eslint-plugin-code-quality # or npm i -D / pnpm add -D
11
+ ```
12
+
13
+ ## Use
14
+
15
+ ```js
16
+ // eslint.config.js
17
+ import codeQuality from '@noctcore/eslint-plugin-code-quality';
18
+
19
+ export default [
20
+ codeQuality.configs.recommended,
21
+ ];
22
+ ```
23
+
24
+ Or wire rules individually (including the ones not in `recommended`):
25
+
26
+ ```js
27
+ import codeQuality from '@noctcore/eslint-plugin-code-quality';
28
+
29
+ export default [
30
+ {
31
+ plugins: { 'noctcore-code-quality': codeQuality },
32
+ rules: {
33
+ 'noctcore-code-quality/no-process-exit': ['error', { allowIn: ['**/scripts/**'] }],
34
+ // Opinionated / niche — off by default, opt in here:
35
+ 'noctcore-code-quality/interface-prefix-i': 'error',
36
+ 'noctcore-code-quality/no-template-trim-empty-ternary': 'error',
37
+ },
38
+ },
39
+ ];
40
+ ```
41
+
42
+ ## Rules
43
+
44
+ `recommended` = ✅ enabled by the `recommended` preset. The two unchecked rules are exported and
45
+ documented but off by default (opinionated / niche) — enable them explicitly.
46
+
47
+ | Rule | Description | Recommended | Options |
48
+ | --- | --- | --- | --- |
49
+ | [`prefer-early-return`](./docs/rules/prefer-early-return.md) | Prefer a guard clause over wrapping the whole function body in an `if`. | ✅ | |
50
+ | [`no-process-exit`](./docs/rules/no-process-exit.md) | Ban `process.exit()` outside bootstrap/shutdown paths and CLIs. | ✅ | `allowIn` |
51
+ | [`no-bare-date-now`](./docs/rules/no-bare-date-now.md) | Ban bare `Date.now()` / `new Date()`; read time through a mockable `clock`. | ✅ | `allowIn` |
52
+ | [`no-historical-comments`](./docs/rules/no-historical-comments.md) | Ban comments framing code against its past ("before the fix", "used to"). | ✅ | |
53
+ | [`no-narration-comments`](./docs/rules/no-narration-comments.md) | Ban step-by-step "Now we… / First we…" narration comments. | ✅ | |
54
+ | [`no-pr-reference-comments`](./docs/rules/no-pr-reference-comments.md) | Ban PR/issue references in comments. | ✅ | |
55
+ | [`no-focused-tests`](./docs/rules/no-focused-tests.md) | Ban focused tests (`.only` / `fdescribe` / `fit`). | ✅ | |
56
+ | [`skipped-tests-need-tracking`](./docs/rules/skipped-tests-need-tracking.md) | Skipped tests must carry a tracking marker (issue URL or `TODO(@owner)`). | ✅ | `markers`, `lookback` |
57
+ | [`interface-prefix-i`](./docs/rules/interface-prefix-i.md) | Interface names must be `I` + uppercase. Opinionated house style. | | |
58
+ | [`no-template-trim-empty-ternary`](./docs/rules/no-template-trim-empty-ternary.md) | Extract inline `` `…`.trim() === '' ? … `` to a named util. Niche. | | |