refactor: prune narration and history comments#19559
1 unresolved thread · Jump to file
0 / 100 viewed100 files changedLine totals unavailable
oxlint-plugin-t3code/rules/no-low-value-comments.ts · Earlier revision 81dc0475 · right 11
Original diff
@@ -0,0 +1,118 @@
+import { defineRule, type ESTree } from "@oxlint/plugins";
+
+const TS_FILE_PATTERN = /\.[cm]?tsx?$/u;
+const DIRECTIVE_PATTERN =
+ /^\s*(?:(?:oxlint|eslint)-|@ts-|@effect-diagnostics|prettier-ignore|biome-ignore|c8 |istanbul |#(?:end)?region)/u;
+const DIVIDER_LINE_PATTERN = /^(?:[-=*#~_/+]{3,}.*|.*[-=*#~_]{3,})$/u;
+const TEST_STEP_PATTERN = /^(?:arrange|act|assert|given|when|then)\s*[:.]?$/iu;
+const TASK_MARKER_PATTERN = /\b(?:TODO|FIXME|XXX|HACK)\b/u;
+const TASK_LINK_PATTERN = /#\d+|https?:\/\//u;
+const JSDOC_TYPE_PATTERN = /^@(?:param|returns?|type|typedef)\s+\{/u;
+const EMPTY_JSDOC_TAG_PATTERN = /^@(?:param|returns?)(?:\s+\[?[\w$.]+\]?)?$/u;macroscopeapp9d ago
🟡 Medium rules/no-low-value-comments.ts:11
A one-word return description such as @returns milliseconds is reported as an empty JSDoc tag, so meaningful documentation is rejected. The pattern allows an optional word after both @param and @returns; only parameter tags have a name to skip. Match an optional name only for @param, and match @returns only when it has no following text.
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
text
| 1 | In file @oxlint-plugin-t3code/rules/no-low-value-comments.ts around line 11: |
| 2 | |
| 3 | A one-word return description such as `@returns milliseconds` is reported as an empty JSDoc tag, so meaningful documentation is rejected. The pattern allows an optional word after both `@param` and `@returns`; only parameter tags have a name to skip. Match an optional name only for `@param`, and match `@returns` only when it has no following text. |
maria9d ago
Note
Written by claude-opus-5-5 on behalf of Maria
Fixed in 56df2bd07c: only @param skips a name now, so @returns milliseconds passes and a bare @returns is still flagged.