You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d7e0fd9
Browse filesBrowse the repository at this point in the historyBrowse files
docs: bring lib/ comments under the three-line limit and enable webpack/comment-length repo-wide (#22152)
* docs(html): bring HtmlParser comments under the three-line limit
* docs(html): bring HtmlModulesPlugin comments under the three-line limit
* docs(html): bring HtmlEntryDependency comments under the three-line limit
* docs(html): bring HtmlGenerator comments under the three-line limit
* docs(config): bring defaults comments under the three-line limit
* docs: bring SourceMapDevToolPlugin comments under the three-line limit
* docs(javascript): bring syntax comments under the three-line limit
* docs(optimize): bring ConcatenatedModule comments under the three-line limit
* docs: bring RuntimeTemplate comments under the three-line limit
* docs(runtime): bring deferred namespace comments under the three-line limit
* docs: bring ConstPlugin comments under the three-line limit
* docs: bring TemplatedPathPlugin comments under the three-line limit
* docs(javascript): bring JavascriptModulesPlugin comments under the three-line limit
* docs: bring core plugin comments under the three-line limit
* docs: bring module graph and flag plugin comments under the three-line limit
* docs: bring asset, chunk graph and cache comments under the three-line limit
* docs(css): bring parser, generator and config comments under the three-line limit
* docs(css): bring cssMinify comments under the three-line limit
* docs(dependencies): bring dependency comments under the three-line limit
* docs(dependencies): bring harmony, html and worker comments under the three-line limit
* docs(dependencies): finish the harmony and worker comment sweep
* docs: bring worker, html minify and parser comments under the three-line limit
* docs(optimize): bring optimization plugin comments under the three-line limit
* docs(node): finish the watch file system comment sweep
* docs: bring side effects, prefetch and performance comments under the three-line limit
* docs(serialization): move format grammars into the file preamble
* docs(util): bring the remaining util and wasm comments under the limit
* docs(html): compress the quoted tokenizer spec arcs
* docs(html): bring syntax.js comments under the limit
* docs(css): shorten the parser comments in syntax.js
* docs(css): shorten the streaming and printer comments
* docs(css): shorten the color and prefixing comments
* docs(css): shorten the shorthand and value comments
* docs(css): bring syntax.js comments under the limit
* build: enable webpack/comment-length across the repository
lib/ is swept, so the rule no longer needs a directory allowlist. examples/
keeps it off: a commented-out config there is what a reader copies.
* docs: restore the rationale the sweep compressed away, under WHY:
An audit of the sweep against main found comments where a contract, an
option's semantics or a measured number was cut rather than shortened.
Those are back in full behind the WHY: marker the limit exempts.
* docs: restore more compressed-away rationale under WHY:
* docs: restore the worked examples and version facts the sweep dropped
* docs: drop the WHY marker where three lines already carry it
* docs: say that runtime chunks can still cycle when hashing
Copy file name to clipboardExpand all lines: AGENTS.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -238,7 +238,7 @@ Every source file under `lib/` (and `hot/`, `tooling/`) opens with the MIT licen
238
238
239
239
**A plain comment is at most three lines. Count them.** This binds every `//` and `/* … */` in `lib/`, `hot/`, `tooling/` and `test/`, and every comment a generator emits into its output. A fourth line is over the limit however short each line is and however true every word — split the thought, cut it, or drop it.
240
240
241
-
`webpack/comment-length` reports it, so `yarn lint:code` is where you see it — over whole files rather than a diff, and it reads comment tokens, so comment-shaped lines inside a string are not comments. It is switched on for `test/`, `tooling/`and `hot/` only: `lib/` has never been swept, so until the TODO in `eslint.config.mjs` goes, the limit still binds there but nothing reports it for you.
241
+
`webpack/comment-length` reports it, so `yarn lint:code` is where you see it — over whole files rather than a diff, and it reads comment tokens, so comment-shaped lines inside a string are not comments. It is on for the whole repository, `lib/`included, so a comment over the limit fails `lint` rather than waiting for a reviewer. `examples/` is the one exception: a commented-out config there is what a reader copies, and the prose is the example's own documentation.
242
242
243
243
**Three things are exempt. JSDoc is a type contract rather than commentary, and the other two are not commentary either.** The block before a file's first statement documents the file, like the license header above it — the `"use strict"` directive between the two does not end it. And a comment whose first line opens `// WHY:` states why the code is shaped the way it is — the spec prose behind a `SUPPLEMENT` entry, a measured engine disagreement, a constraint some other file depends on — which is the one kind of explanation that cannot be made shorter without losing it:
0 commit comments