chore(lint): make max-lines a warning (#149805)

* chore(lint): make max-lines a warning

Peter decided on 2026-09-16 that max-lines should warn in CI rather than
block main. The chat-pane-render.ts failure exposed unnecessary lint
burden after #149697.

Change all six max-lines scopes to warn while preserving every threshold
and all other rules. Document warning behavior and the retained suppression
ratchet. The runners and CI already preserve warning output and exit codes.

Proof: check-changed, formatting, and git diff --check pass. The current
chat-pane-render.ts passes single-file core lint; the exact 702-line
revision from failed main run 35060497703 prints one max-lines warning and
exits 0 through run-oxlint with CI-style output. The sample UI tsconfig
command hit the existing nested-checkout declaration boundary, so proof
uses CI's source-only core tsconfig.

* test(lint): expect max-lines warnings

Align the existing config-policy test with Peter’s 2026-09-16 decision. Preserve all six budgets and exclusions. The prior PR run correctly exposed the stale error expectations.

Proof: all 13 oxlint config tests, check-changed, and git diff --check pass. Fresh independent review found no actionable P0/P1 findings.
This commit is contained in:
Peter Steinberger 2026-09-16 00:04:18 -07:00 • committed by GitHub
parent 53031d66aa
commit 759bdc439e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 17 additions and 13 deletions

View file

@ -317,7 +317,7 @@
"src/wizard/i18n/locales/**"
],
"rules": {
"max-lines": ["error", { "max": 700, "skipBlankLines": true, "skipComments": true }]
"max-lines": ["warn", { "max": 700, "skipBlankLines": true, "skipComments": true }]
}
},
{
@ -338,7 +338,7 @@
"src/wizard/i18n/locales/**"
],
"rules": {
"max-lines": ["error", { "max": 700, "skipBlankLines": true, "skipComments": true }]
"max-lines": ["warn", { "max": 700, "skipBlankLines": true, "skipComments": true }]
}
},
{
@ -359,7 +359,7 @@
"src/wizard/i18n/locales/**"
],
"rules": {
"max-lines": ["error", { "max": 800, "skipBlankLines": true, "skipComments": true }]
"max-lines": ["warn", { "max": 800, "skipBlankLines": true, "skipComments": true }]
}
},
{
@ -379,19 +379,19 @@
"src/wizard/i18n/locales/**"
],
"rules": {
"max-lines": ["error", { "max": 1000, "skipBlankLines": true, "skipComments": true }]
"max-lines": ["warn", { "max": 1000, "skipBlankLines": true, "skipComments": true }]
}
},
{
"files": ["extensions/copilot/src/event-bridge.ts"],
"rules": {
"max-lines": ["error", { "max": 950, "skipBlankLines": true, "skipComments": true }]
"max-lines": ["warn", { "max": 950, "skipBlankLines": true, "skipComments": true }]
}
},
{
"files": ["extensions/copilot/src/attempt-transcript-journal.test.ts"],
"rules": {
"max-lines": ["error", { "max": 1200, "skipBlankLines": true, "skipComments": true }]
"max-lines": ["warn", { "max": 1200, "skipBlankLines": true, "skipComments": true }]
}
},
{

View file

@ -23,6 +23,10 @@ When you touch tests or want extra confidence:
- Informational V8 coverage report: `pnpm test:coverage`
- E2E suite: `pnpm test:e2e`
Oxlint's `max-lines` rule warns when files exceed the per-scope limits in
`.oxlintrc.json`; these warnings remain visible in lint logs and do not fail CI.
The suppression baseline ratchet remains a required check.
## Test suites (what runs where)
Think of the suites as "increasing realism" (and increasing flakiness/cost).

View file

@ -479,7 +479,7 @@ describe("oxlint config", () => {
]);
});
it("enforces scoped max-lines budgets while excluding generated output", () => {
it("warns on scoped max-lines budgets while excluding generated output", () => {
const config = readJson(".oxlintrc.json") as OxlintConfig;
const maxLinesOverrides = (config.overrides ?? []).filter(
(override) => override.rules?.["max-lines"],
@ -489,10 +489,10 @@ describe("oxlint config", () => {
expect(scopedBudgets).toHaveLength(4);
expect(scopedBudgets.map((override) => override.rules?.["max-lines"])).toEqual([
["error", { max: 700, skipBlankLines: true, skipComments: true }],
["error", { max: 700, skipBlankLines: true, skipComments: true }],
["error", { max: 800, skipBlankLines: true, skipComments: true }],
["error", { max: 1000, skipBlankLines: true, skipComments: true }],
["warn", { max: 700, skipBlankLines: true, skipComments: true }],
["warn", { max: 700, skipBlankLines: true, skipComments: true }],
["warn", { max: 800, skipBlankLines: true, skipComments: true }],
["warn", { max: 1000, skipBlankLines: true, skipComments: true }],
]);
for (const override of scopedBudgets) {
expect(override.excludeFiles).toContain("**/protocol-gen/**");
@ -515,13 +515,13 @@ describe("oxlint config", () => {
{
files: ["extensions/copilot/src/event-bridge.ts"],
rules: {
"max-lines": ["error", { max: 950, skipBlankLines: true, skipComments: true }],
"max-lines": ["warn", { max: 950, skipBlankLines: true, skipComments: true }],
},
},
{
files: ["extensions/copilot/src/attempt-transcript-journal.test.ts"],
rules: {
"max-lines": ["error", { max: 1200, skipBlankLines: true, skipComments: true }],
"max-lines": ["warn", { max: 1200, skipBlankLines: true, skipComments: true }],
},
},
]);