jest-preset-stylelint 7.2.0 → 7.3.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 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": "7.2.0",
3
+ "version": "7.3.0",
4
4
  "description": "Jest preset for Stylelint plugins.",
5
5
  "keywords": [
6
6
  "stylelint",
@@ -63,19 +63,19 @@
63
63
  "@stylelint/prettier-config": "^3.0.0",
64
64
  "@stylelint/remark-preset": "^5.1.1",
65
65
  "@types/jest": "^29.5.14",
66
- "eslint": "^9.17.0",
66
+ "eslint": "^9.21.0",
67
67
  "eslint-config-stylelint": "^23.0.0",
68
- "eslint-plugin-jest": "^28.10.0",
68
+ "eslint-plugin-jest": "^28.11.0",
69
69
  "husky": "^9.1.7",
70
70
  "jest": "^29.7.0",
71
71
  "jest-light-runner": "^0.6.0",
72
- "lint-staged": "^15.3.0",
73
- "np": "^10.1.0",
72
+ "lint-staged": "^15.4.3",
73
+ "np": "^10.2.0",
74
74
  "npm-run-all": "^4.1.5",
75
- "prettier": "^3.4.2",
75
+ "prettier": "^3.5.2",
76
76
  "remark-cli": "^12.0.1",
77
- "stylelint": "^16.14.0",
78
- "typescript": "^5.7.2"
77
+ "stylelint": "^16.15.0",
78
+ "typescript": "^5.8.2"
79
79
  },
80
80
  "peerDependencies": {
81
81
  "jest": "^29.0.2"