jest-preset-stylelint 7.2.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/getTestRule.js +10 -0
- package/index.d.ts +8 -0
- package/package.json +14 -14
package/getTestRule.js
CHANGED
|
@@ -7,6 +7,8 @@ const { inspect } = require('node:util');
|
|
|
7
7
|
* @typedef {import('.').TestSchema} TestSchema
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
/** @import {Config} from 'stylelint' */
|
|
11
|
+
|
|
10
12
|
/** @type {import('.').getTestRule} */
|
|
11
13
|
module.exports = function getTestRule(options = {}) {
|
|
12
14
|
return function testRule(schema) {
|
|
@@ -23,11 +25,13 @@ module.exports = function getTestRule(options = {}) {
|
|
|
23
25
|
});
|
|
24
26
|
|
|
25
27
|
describe(`${schema.ruleName}`, () => {
|
|
28
|
+
/** @type {Config} */
|
|
26
29
|
const stylelintConfig = {
|
|
27
30
|
plugins: options.plugins || schema.plugins,
|
|
28
31
|
rules: {
|
|
29
32
|
[schema.ruleName]: schema.config,
|
|
30
33
|
},
|
|
34
|
+
languageOptions: schema.languageOptions,
|
|
31
35
|
};
|
|
32
36
|
|
|
33
37
|
setupTestCases({
|
|
@@ -97,6 +101,12 @@ module.exports = function getTestRule(options = {}) {
|
|
|
97
101
|
};
|
|
98
102
|
|
|
99
103
|
for (const [key, value] of Object.entries(expectedWarning)) {
|
|
104
|
+
if (schema.computeEditInfo && key === 'fix') {
|
|
105
|
+
// When `computeEditInfo` is set the test should only pass when `fix` matches the expected outcome,
|
|
106
|
+
// both in having a value and what the value is.
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
|
|
100
110
|
if (value === undefined) {
|
|
101
111
|
// @ts-expect-error -- Allow a partial object.
|
|
102
112
|
delete expectedWarning[key];
|
package/index.d.ts
CHANGED
|
@@ -136,6 +136,14 @@ export type TestSchema = {
|
|
|
136
136
|
*/
|
|
137
137
|
plugins?: import('stylelint').Config['plugins'];
|
|
138
138
|
|
|
139
|
+
/**
|
|
140
|
+
* Maps to Stylelint's `languageOptions` configuration property.
|
|
141
|
+
* Allows customization of syntax for at-rules, properties, types, and CSS-wide keywords.
|
|
142
|
+
*
|
|
143
|
+
* @see https://stylelint.io/user-guide/configure/#languageoptions
|
|
144
|
+
*/
|
|
145
|
+
languageOptions?: import('stylelint').Config['languageOptions'];
|
|
146
|
+
|
|
139
147
|
/**
|
|
140
148
|
* Maps to Stylelint's `customSyntax` option.
|
|
141
149
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jest-preset-stylelint",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"description": "Jest preset for Stylelint plugins.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"stylelint",
|
|
@@ -62,25 +62,25 @@
|
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@stylelint/prettier-config": "^3.0.0",
|
|
64
64
|
"@stylelint/remark-preset": "^5.1.1",
|
|
65
|
-
"@types/jest": "^
|
|
66
|
-
"eslint": "^9.
|
|
67
|
-
"eslint-config-stylelint": "^
|
|
68
|
-
"eslint-plugin-jest": "^
|
|
65
|
+
"@types/jest": "^30.0.0",
|
|
66
|
+
"eslint": "^9.29.0",
|
|
67
|
+
"eslint-config-stylelint": "^24.0.0",
|
|
68
|
+
"eslint-plugin-jest": "^29.0.1",
|
|
69
69
|
"husky": "^9.1.7",
|
|
70
|
-
"jest": "^
|
|
71
|
-
"jest-light-runner": "^0.
|
|
72
|
-
"lint-staged": "^
|
|
73
|
-
"np": "^10.
|
|
70
|
+
"jest": "^30.0.2",
|
|
71
|
+
"jest-light-runner": "^0.7.9",
|
|
72
|
+
"lint-staged": "^16.1.2",
|
|
73
|
+
"np": "^10.2.0",
|
|
74
74
|
"npm-run-all": "^4.1.5",
|
|
75
|
-
"prettier": "^3.
|
|
75
|
+
"prettier": "^3.6.0",
|
|
76
76
|
"remark-cli": "^12.0.1",
|
|
77
|
-
"stylelint": "^16.
|
|
78
|
-
"typescript": "^5.
|
|
77
|
+
"stylelint": "^16.21.0",
|
|
78
|
+
"typescript": "^5.8.3"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
81
|
-
"jest": "^
|
|
81
|
+
"jest": "^30.0.2"
|
|
82
82
|
},
|
|
83
83
|
"engines": {
|
|
84
|
-
"node": ">=
|
|
84
|
+
"node": ">=20.19.0"
|
|
85
85
|
}
|
|
86
86
|
}
|