ワンクリックで
upgrading-shared-stylelint-config
Upgrades a Stylelint configuration to a new Stylelint major release
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Upgrades a Stylelint configuration to a new Stylelint major release
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | upgrading-shared-stylelint-config |
| description | Upgrades a Stylelint configuration to a new Stylelint major release |
| license | MIT |
| metadata | {"audience":"maintainers","internal":true,"disable-model-invocation":true} |
Comprehensive project and dependencies review to identify needed changes to upgrade this project to a new Stylelint version, and potential opt-in improvements based on any changes in the release.
To detect from the context or request from the user if unclear:
node --version, npm info . peerDependencies)Always fetch latest information from the official Stylelint docs if possible.
Combine it with project-specific information:
CONTRIBUTING.md.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.
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:
Push if allowed from current permissions or after user confirmation, when:
Options to check that the upgrade works correctly, to use as needed through upgrade steps:
npm run lintnpm run testnpm run test:rulesnpm run build:docsLook for any deprecation warnings coming from Stylelint in particular.
package.json and package-lock.json)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.
upgrade-stylelint-vX)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.
npm info . devDependencies, npm info . dependencies, npm info . peerDependencies to confirm the current versions of all of the project’s dependencies ahead of the upgrades.dependencies with npm (not dev or peer dependencies).npm install --save-dev --save-exact stylelint@<version> stylelint-find-new-rules@<version> to install the target Stylelint and stylelint-find-new-rules versions.dependencies definition in package.json to be in the same lines of the file it was before.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.
This is crucial for the success of the upgrade, and we have bespoke tools to facilitate this.
npm run test:rules to determine which new rules have been introduced.src/unused.js, making sure to add any new rules in the correct section (look at the guidance inside the file).toReview array so this can be further reviewed at a later date.npm run test -- -u to update the project’s snapshots. This is crucial to understand which rule changes will affect users of this project.Add a new entry in the CHANGELOG, following this set template, with examples replaced with the rules updates relevant for this release:
### Features
- Update stylelint to v<version> and up.
- If relevant: Update all config dependencies to their latest releases, compatible with stylelint v<version>.
- If relevant: Change enforced rules from Stylelint and `stylelint-config-standard-scss` (see list below).
### BREAKING CHANGES
The configuration now mandates stylelint v<version>. {Add commentary about the major highlights of the release if relevant}. See Stylelint’s official [Migrating to <version>](https://stylelint.io/migration-guide/to-<version>) documentation.
#### New rules configuration
| Rule | Purpose | Set to | Was set to |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ---------- |
| [`at-rule-no-deprecated`](https://stylelint.io/user-guide/rules/at-rule-no-deprecated/) | Disallow deprecated at-rules | `true` | New rule |
| [`scss/load-no-partial-leading-underscore`](https://github.com/stylelint-scss/stylelint-scss/blob/master/src/rules/load-no-partial-leading-underscore/README.md) | Replaces `scss/at-import-no-partial-leading-underscore` Disallow leading underscore in partial names in `@import`, `@use`, `@forward`, and [`meta.load-css`](https://sass-lang.com/documentation/modules/meta/#load-css) `$url` parameter | `true` | New rule |
| [`scss/dollar-variable-colon-space-after`](https://github.com/stylelint-scss/stylelint-scss/blob/master/src/rules/dollar-variable-colon-space-after/README.md) | Require or disallow whitespace after the colon in `$`-variable declarations. | `always-single-line` | `always` |
#### New unused rules
- [`unit-allowed-list`](https://stylelint.io/user-guide/rules/unit-allowed-list/)
- [`unit-disallowed-list`](https://stylelint.io/user-guide/rules/unit-disallowed-list/)
For the key rules sections,
src/__snapshots__/semver.test.js.snap.src/__snapshots__/semver.test.js.snap.src/unused.js.