| name | upgrading-stylelint |
| description | Upgrades a project’s Stylelint version or configuration |
| license | MIT |
Overview
Comprehensive project and dependencies review to identify needed changes to upgrade this project to a new Stylelint version, including stylesheet code changes, and potential opt-in improvements based on any changes in the Stylelint release.
Methodology
Goals
- Upgrade the project to the target Stylelint release, including any needed dependencies upgrades.
- Baseline QA that the upgrade works correctly - linting passes, test suite passes, all with no deprecation warnings if possible.
- A thorough upgrade report for the user (upgrade methodology, what changed, what further tests to do, links to relevant information), ideally with guidance on opt-in changes to consider.
Guardrails
- Prefer minimal, reviewable changes. Avoid introducing technical debt.
- Make dependency updates explicit and reproducible (lockfile updates included).
- No fixes unrelated to the upgrade, unless required for the QA checks to pass.
- If a change is ambiguous, choose the option with the least technical debt. Ask for further input if needed.
- When there are issues that seem like bugs in the dependencies, encourage the user to report back with feedback for maintainers.
Input
To detect from the context or request from the user if unclear:
- Agent mode: whether we want to provide an audit of the needed work for an upgrade, or actually directly do the upgrade. Default: assume "direct update on current code".
- Current versions of Node, Stylelint. Default: read from project configuration (
node --version, npm info . devDependencies)
- Current versions of any Stylelint-related packages, like shared configurations. Default: read from project configuration (
npm info . devDependencies)
- Target version for Stylelint. Default: assume "latest", fetch the CHANGELOG and check which version is latest based on the current date.
- How to run styles linting. Default: read from project documentation or output of task runner like
npm run.
- Location of the project’s Stylelint config. Default: look for files containing "stylelint" in root directory.
Reference data sources
Always fetch latest information from the official Stylelint docs and any package docs if possible.
Combine it with project-specific information:
- Guidance for contributors in
CONTRIBUTING.md or other docs.
- Upgrade considerations / test plans / documentation on customizations.
Reporting
Upgrades are sensitive tasks, it’s critical to provide clear information to the user throughout the upgrade tasks, with clear requests for any extra input. And as a comprehensive report at the end.
- Use text formatting if supported (tables, lists, Markdown links)
- Link directly to release notes and other documentation pages where relevant.
- When sharing docs references in reporting, make sure to link to the HTML pages.
- Report on both the methodology, and the outcome.
- Use artifacts in addition to messages if supported.
Commit and pull request strategy
If the current task mode is to work directly on the project code, commit regularly on a new branch unless otherwise noted by project instructions.
Commit for:
- Version upgrades of dependencies
- Fixes in the code
- Fixes / additions in test suites
- Documentation updates
Push if allowed from current permissions or after user confirmation, when:
- We want to see results from Continuous Integration tools.
- We want human review.
- We think the work is done.
Quality Assurance
Options to check that the upgrade works correctly, to use as needed through upgrade steps:
- Stylelint linting passes
- Stylesheets auto-formatting passes
- Other project-specific QA checks
Look for any deprecation warnings coming from Stylelint in particular.
Definition of done
- Dependency files updated and consistent (
package.json and lockfile)
- Test suite / QA tools / CI all passing
- No new deprecation warnings introduced (or explicitly documented)
- Any relevant project doc is updated
- Upgrade report created
Steps
Confirm upgrade path
At this stage, if there are multiple Stylelint versions on the upgrade path, make sure that all subsequent work is done in sequence for every one of those versions. For example, upgrading from Stylelint v14 to v16 should involve running through all the steps in this file with v15 as the target; then asking the user to confirm the successful v15 upgrade; then restarting this all from v15 to v16.
Baseline setup and QA
Dependencies audit and upgrades
This may need to be done in a different order depending on whether dependency compatibility issues are reported when upgrading to the new Stylelint version.
Note any warnings or errors from npm or from the project’s QA tools. Those might indicate further actions needed for the upgrades to be successful. Those might require moving on to the subsequent steps to resolve.
Apply official upgrade guidance
Stylesheets and rules updates
This is crucial for the success of the upgrade. The upgrade of Stylelint or of related packages may include changes to linting rules, which might surface new issues with the project.
Update documentation
Produce the upgrade report