Skip to content

refactor!: fold quiet into reportAs - #317

Merged
alexander-akait merged 1 commit into
mainfrom
refactor/errors-only
Sep 8, 2026
Merged

refactor!: fold quiet into reportAs#317
alexander-akait merged 1 commit into
mainfrom
refactor/errors-only

Conversation

@alexander-akait

@alexander-akait alexander-akait commented Sep 8, 2026

Copy link
Copy Markdown
Member

Summary

reportAs says what a check reports its results as. One value covers its errors and its warnings alike; an object sets them apart, and a severity the object leaves out keeps its own. quiet has nothing left to say and goes.

type reportAs = Severity | { errors?: Severity; warnings?: Severity };
type Severity = "error" | "warning" | false;

Every state, measured on real builds rather than reasoned about:

reportAs An error lands in A warning lands in
unset (default) errors warnings
"error" errors errors
"warning" warnings warnings
false dropped dropped
{ warnings: false } errors dropped
{ warnings: "error" } errors errors
{ errors: false } dropped warnings
{ errors: "warning" } warnings warnings
{ errors: "warning", warnings: false } warnings dropped

Each severity independently becomes a webpack error, a webpack warning, or nothing — so the nine states that gives are the whole space, and there is nothing left for a second option to express.

Every option this replaces now has a spelling, including two the scalar alone could not say:

Was Is
quiet: true, emitWarning: false reportAs: { warnings: false }
emitError: false reportAs: { errors: false }
emitError: false and emitWarning: false reportAs: false
failOnError: true the default
failOnError: false reportAs: "warning"
failOnWarning: true reportAs: { warnings: "error" }

A partial object is what keeps it short. { warnings: false } says nothing about the errors, so the two severities stay independent and the common cases stay one key long. An empty object is the default.

What kind of change does this PR introduce?

refactor (breaking).

Did you add tests for your changes?

Yes. test/quiet.test.js and test/stylelint/quiet.test.js are gone; report-as.test.js covers the scalar, the object, a partial object leaving the other severity alone, a warning made fatal, an error made non-fatal, and what the schema refuses — for both checks. 118 passing.

Does this PR introduce a breaking change?

Yes: quiet is gone, spelled reportAs: { warnings: false }. Nothing has shipped under this package name, so it lands in the same unreleased major as reportAs itself. The README's migration table maps every old option onto the new one.

If relevant, what needs to be documented once your changes are merged or what have you already documented?

Documented here: the Errors and warnings section rewritten around the one option, a value table covering the scalar and the object forms, the adapter contract in Adding a check, and the migration table — which no longer has a "no counterpart" row. The changeset is a major.

Use of AI

Written with Claude Code, driven interactively. I asked for the option list, said to fix quiet, then to remove it and fold it into reportAs, and then to let reportAs take an object so each severity can be set on its own. Its first attempt was a rename, its second read the value as a threshold and dropped two behaviours to fit — I turned both down, and the object recovers them. It enumerated what the options expressed at each step rather than guessing, measured every value of the final shape on real builds, and corrected its own earlier claim that one option would need seven values. I reviewed the result.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GzZci4NQeiqwdrVfd7dGXy

@alexander-akait alexander-akait changed the title refactor!: rename quiet to errorsOnly refactor!: fold quiet into reportAs Sep 8, 2026
`reportAs` says what a check reports its results as. One value covers its
errors and its warnings alike, an object sets them apart, and a severity the
object leaves out keeps its own:

    reportAs: "warning"                 // nothing fails the build
    reportAs: { warnings: false }       // the errors alone   (was quiet: true)
    reportAs: { warnings: "error" }     // warnings fail it too
    reportAs: false                     // nothing is reported

Each severity independently becomes an error, a warning or nothing, so the
nine states that gives are the whole space, and every option this replaces has
a spelling: `emitError: false` is `{ errors: false }` and `failOnWarning:
true` is `{ warnings: "error" }`, neither of which the scalar alone could say.

A partial object reading its missing severity from the default is what keeps
the common cases short — naming the warnings says nothing about the errors.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GzZci4NQeiqwdrVfd7dGXy
@alexander-akait
alexander-akait merged commit 35ec519 into main Sep 8, 2026
13 checks passed
@alexander-akait
alexander-akait deleted the refactor/errors-only branch September 8, 2026 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant