Repository navigation
chore(checks): reject new comments, casts and AI-sounding docs - #7652
Merged
Merged
Conversation
Turn pstack's /no-comments, TypeScript and /unslop guidance into checks that fail only on lines a change adds against origin/dev. - code-habits: the comment rule now covers TypeScript in apps, packages and ee, and new rules reject any, as casts (as const is fine), non-null assertions, ts/eslint/biome suppressions and console.log outside command-line entry points. - prose-habits: markdown lines may not add dashes, AI vocabulary, "serves as", "not just X but Y", chatbot phrases, wordy phrases, curly quotes or filler words. Code, inline code and links are skipped. - Both run in pnpm check and the quick check workflow. AGENTS.md drops the any/cast line the check now enforces.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this about?
pnpm checkand the quick check now reject new comments,any, casts, non-null assertions, suppressions andconsole.login TypeScript, and AI-sounding phrasing in markdown.What problem does it solve?
Agents keep adding narrating comments, casts and slop wording faster than review catches them. Prose rules in AGENTS.md did not stop it; a failing check does.
What was the situation before?
The comment rule only covered
apps/app/src. Casts,anyand suppressions were discouraged in AGENTS.md but never checked, and docs had no check at all.How is this implemented?
scripts/check-code-habits.mjs: the comment rule coversapps,packages,ee/apps,ee/packages(tests,.d.ts, generated files excluded; directives,#__PURE__, licenses, issue links and exported package API docs kept). New rules:no-new-any,no-new-cast(as constallowed),no-new-non-null,no-new-suppression,no-new-console-log(CLI entry points exempt).scripts/check-prose-habits.mjs: new check on added markdown lines for dashes, AI vocabulary, "serves as", "not just X but Y", chatbot and wordy phrases, curly quotes and filler words. Code blocks, inline code and links are skipped.scripts/check.mjsandquick-check.yml.What else changed?
any/cast line the check now enforces;ARCHITECTURE.mddescribes the wider rule.check-code-habitsis raised to 512 MB; a 100-commit diff overflowed 32 MB.Release note
none
Evidence
No E2E;
node --test scripts/check*.test.mjs(51 tests) andpnpm check. Replaying the last 100devcommits flags about 1,000 comments, 32 TypeScript findings and 40 markdown lines.