Skip to content

Commit 02d1e48

Browse files
tobigumoclaudemizdra
authored
feat(stylelint-plugin): support stylelint v17 (#346)
* feat(stylelint-plugin): support stylelint v17 - Fix `utils.report()` index/endIndex to use node-relative offsets instead of absolute file offsets, as required by stylelint v17's stricter position argument handling (stylelint/stylelint#8217) - Update devDependency to stylelint v17 - Add CI job to test with stylelint v16 for backward compatibility - Add changeset Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: npm i * ci: install stylelint@16 before setup-node-and-node-modules to avoid cache collision `setup-node-and-node-modules` caches `node_modules` keyed by `package-lock.json`. Installing stylelint@16 beforehand changes the lock file so that the cache key differs from the stylelint@17 run, preventing the wrong `node_modules` from being restored. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * ci: run only stylelint-plugin tests in CI stylelint job The stylelint job was using `npx vitest --run --project unit` which ran all unit tests filtered by path, instead of `npm run test` which correctly runs only the specified package's tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * ci: remove vite/vitest cache from `test-stylelint-v16` job to avoid cache collision with `test` job Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: mizdra <pp.mizdra@gmail.com>
1 parent 597e6ad commit 02d1e48

6 files changed

Lines changed: 417 additions & 131 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@css-modules-kit/stylelint-plugin': minor
3+
---
4+
5+
feat(stylelint-plugin): support stylelint v17

.github/workflows/ci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,18 @@ jobs:
5151
key: test-tools-${{ runner.arch }}-${{ runner.os }}-node-${{ matrix.node }}-${{ github.sha }}
5252
restore-keys: test-tools-${{ runner.arch }}-${{ runner.os }}-node-${{ matrix.node }}
5353
- run: npm run test
54+
test-stylelint-v16:
55+
runs-on: ubuntu-24.04-arm
56+
steps:
57+
- uses: actions/checkout@v4
58+
- uses: actions/setup-node@v4
59+
with:
60+
node-version: 22
61+
- run: npm i -D stylelint@16
62+
- uses: ./.github/actions/setup-node-and-node-modules
63+
with:
64+
node-version: 22
65+
- run: npm run test -- packages/stylelint-plugin
5466
vscode-test:
5567
strategy:
5668
fail-fast: false

0 commit comments

Comments
 (0)