Stylelint Autofix Review: What to Check Before You Commit

A Stylelint autofix review should check more than the message shown when a command finishes. In our small local comparison, one synthetic CSS fixture kept a duplicate after the first 18.0.0 autofix call. Version 18.1.0 removed it in that call. Neither result proves that a website still behaves as intended.

We ran three fixtures with both versions on Node v22.23.1. The same configuration enabled two rules and an explicit fallback exception. You can inspect the six result rows, source code and blank review sheet below. These are measured lint results, not browser rendering tests or a success rate for real projects.

Stylelint autofix review: what changed on 20 November?

The 18.1.0 changelog reports a fix for problems introduced during autofixing. The fix option guide describes repeated fixing passes, stopping when a pass makes no change or the ten-pass limit is reached. It says the PostCSS plugin runs one pass. Keep that runner distinction in your notes.

A fixing pass is not a separate command invocation. The final diagnostic check is also a different operation. Our charts count the warnings from a new read-only lint call and the declarations returned by autofix calls. They do not measure the number of internal passes or infer rule order from configuration key order.

The fixture that exposed the difference

.card { -webkit-transition: opacity 1s; transition: opacity 1s; }

The example contains valid CSS. With our chosen rules, removing the property prefix can leave two ordinary declarations. A duplicate check therefore needs another opportunity to inspect the changed code. The maintainer’s upstream change includes a related transition fixture. Our local run is separate evidence, using the versions and configuration recorded here.

Separate read-only rerun warnings for clean, prefix-interaction and unit-fallback fixtures:18.0.0 gives0,1,0;18.1.0 gives0,0,0
The first autofix call is followed by an independent read-only check. Only the prefix-interaction fixture differed in these six version-by-fixture runs.
Fixture18.0.0 rerun warnings18.1.0 rerun warningsBrowser behaviour
Clean control00Not tested
Prefix interaction10Not tested
Unit fallback00Not tested
Observed local Node.js API results. Counts refer to the stated configuration, not all possible CSS errors.

For 18.0.0, the first fixed output contained two identical transition declarations. Its read-only rerun reported one warning. A second autofix call reduced the output to one declaration. In contrast, 18.1.0 returned one declaration on the first call and left that output unchanged on the next call.

Input,first fix and second fix declaration counts are2,2,1 for18.0.0 and2,1,1 for18.1.0
An external autofix call may contain internal passes. The line joins three recorded stages of one fixture; it is not a time series or performance chart.

Keep an intentional fallback control

Our second nontrivial fixture uses consecutive font sizes: 16px followed by 1rem. The configuration explicitly ignores consecutive duplicate properties with different value syntaxes. The duplicate-property documentation describes that option. Both tested versions retained the two declarations and reported no warning in this setup.

That result shows what our configured exception allowed. It does not establish that the fallback is necessary, sufficient or visually equivalent in your supported browsers. A changed root font size, for example, can change what a rem value means. Decide why the fallback exists before accepting its removal or changing the exception.

The clean control held one ordinary transition declaration. Both versions left it unchanged. Controls make a lab easier to interpret: they show that the observed difference was not present in every sample. Three invented fixtures still provide a narrow demonstration, not representative coverage of production stylesheets.

Use three independent acceptance checks

Three evidence checks distinguish read-only diagnostics,second-fix stability and intended CSS behaviour
A stable output and a clean lint result answer different questions. Neither replaces reviewing the diff and checking the supported-browser behaviour that matters to the change.

First, preserve the original and inspect the actual diff. Identify removed declarations, changed values and lost comments. Ask which product behaviour each change could affect. Our CSS debugging guide gives broader troubleshooting context; this lab focuses on accepting an automatic edit.

Next, lint the fixed copy without enabling fixes. Record the exact diagnostics rather than treating an exit message as proof of correctness. Then run autofix on another copy of that result. Compare bytes or a normal diff. An unchanged second output establishes stability for that input and configuration only.

Finally, check the relevant page and supported browser builds. Record the journey, viewport, expected state and observed state. Use our browser build record guide to keep release labels separate from installed versions. We did not run that browser acceptance check for these fixtures, so the worksheet leaves it unresolved.

Reproduce the comparison without touching your project

Use a disposable directory and the supplied source pack. Install the two exact package versions as documented in its README. The script supplies CSS strings to the Node.js API; it does not modify a real repository. Its outputs retain the input, configuration, warning lists and first and second fixed strings.

Record your Node version before running. The 18.0 migration guide lists supported minimums by Node branch; our v22.23.1 run meets the listed 22.x minimum. Do not silently substitute a global linter, plugin runner or shareable configuration and call it the same comparison.

Method, limits and downloads

We ran the six combinations on 23 November 2026 with Stylelint 18.0.0 and 18.1.0 through the Node.js API. Every combination used the same two-rule configuration. For each input we recorded initial diagnostics, the first fixed output, a separate read-only rerun and a second fix for stability. We checked the warning counts against the retained JSON.

Tech Consulting Tailored to Your Coding Journey

Get expert guidance in coding with a personalized consultation. Receive unique, actionable insights delivered in 1-3 business days.

Get Started

No timing benchmark, cross-browser result, universal idempotence claim or production upgrade recommendation follows from this lab. The PostCSS one-pass behaviour is a documented distinction, not a runner we measured. Use the review sheet to record evidence for your own change before committing it.

Suggested citation: Learn Coding USA, “Stylelint Autofix Review: What to Check Before You Commit”, 23 November 2026. Retain the version, runner and fixture scope when citing the result.