Skip to content

Commit 0dbcccb

Browse files
Migrate plugins to nodeFieldIndices.mjs and upgrade to stylelint 17
Co-authored-by: francinelucca <40550942+francinelucca@users.noreply.github.com>
1 parent 327c3f3 commit 0dbcccb

File tree

10 files changed

+433
-184
lines changed

10 files changed

+433
-184
lines changed

.stylelintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "extends": ["./dist/index.cjs"], "ignoreFiles": ["**/*.js", "**/*.cjs", "**/*.ts", "**/*.mjs"], "cache": false }
1+
{ "extends": ["./dist/index.mjs"], "ignoreFiles": ["**/*.js", "**/*.cjs", "**/*.ts", "**/*.mjs"], "cache": false }

__tests__/utils/setup.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
import {jest} from '@jest/globals'
2+
import stylelint from 'stylelint'
3+
4+
// Stylelint 17 is ESM-only. CJS plugins (e.g. stylelint-browser-compat) that call
5+
// require('stylelint') would cause Jest to throw ERR_REQUIRE_ESM. jest.mock intercepts
6+
// the CJS require() path (checked before the ESM guard) and returns the real stylelint
7+
// instance loaded via this file's static ESM import.
8+
jest.mock('stylelint', () => ({__esModule: true, default: stylelint, ...stylelint}))
9+
110
expect.extend({
211
toHaveErrored(data) {
312
return {

0 commit comments

Comments
 (0)