jest-preset-stylelint 4.1.1 → 4.2.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/README.md +7 -3
- package/getTestRule.js +3 -0
- package/package.json +18 -18
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
9
|
-
Install the preset alongside
|
|
9
|
+
Install the preset alongside Jest and Stylelint:
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
12
|
npm install jest-preset-stylelint jest stylelint --save-dev
|
|
@@ -116,7 +116,7 @@ Turn on autofix.
|
|
|
116
116
|
|
|
117
117
|
### `plugins` \[array\<string\>\]
|
|
118
118
|
|
|
119
|
-
Maps to
|
|
119
|
+
Maps to Stylelint's [`plugins` configuration property](https://stylelint.io/user-guide/configure#plugins).
|
|
120
120
|
|
|
121
121
|
Path to the file that exports the plugin object, relative to the root. Usually it's the same path as a `main` property in plugin's `package.json`.
|
|
122
122
|
|
|
@@ -140,7 +140,11 @@ Skip [basic checks](https://github.com/stylelint/stylelint/blob/master/lib/testU
|
|
|
140
140
|
|
|
141
141
|
### `customSyntax` \<string\>
|
|
142
142
|
|
|
143
|
-
Maps to
|
|
143
|
+
Maps to Stylelint's [`customSyntax` option](https://stylelint.io/user-guide/usage/options#customsyntax).
|
|
144
|
+
|
|
145
|
+
### `codeFilename` \<string\>
|
|
146
|
+
|
|
147
|
+
Maps to Stylelint's [`codeFilename` option](https://stylelint.io/user-guide/usage/options#codefilename).
|
|
144
148
|
|
|
145
149
|
## Shared test case properties
|
|
146
150
|
|
package/getTestRule.js
CHANGED
|
@@ -22,6 +22,7 @@ const { basicChecks, lint } = require('stylelint');
|
|
|
22
22
|
* @property {boolean} [skipBasicChecks]
|
|
23
23
|
* @property {boolean} [fix]
|
|
24
24
|
* @property {Syntax} [customSyntax] - PostCSS Syntax (https://postcss.org/api/#syntax)
|
|
25
|
+
* @property {string} [codeFilename]
|
|
25
26
|
* @property {boolean} [only]
|
|
26
27
|
* @property {boolean} [skip]
|
|
27
28
|
*/
|
|
@@ -54,6 +55,7 @@ function getTestRule(options = {}) {
|
|
|
54
55
|
code: testCase.code,
|
|
55
56
|
config: stylelintConfig,
|
|
56
57
|
customSyntax: schema.customSyntax,
|
|
58
|
+
codeFilename: schema.codeFilename,
|
|
57
59
|
};
|
|
58
60
|
|
|
59
61
|
const output = await lint(stylelintOptions);
|
|
@@ -80,6 +82,7 @@ function getTestRule(options = {}) {
|
|
|
80
82
|
code: testCase.code,
|
|
81
83
|
config: stylelintConfig,
|
|
82
84
|
customSyntax: schema.customSyntax,
|
|
85
|
+
codeFilename: schema.codeFilename,
|
|
83
86
|
};
|
|
84
87
|
|
|
85
88
|
const outputAfterLint = await lint(stylelintOptions);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jest-preset-stylelint",
|
|
3
|
-
"version": "4.
|
|
4
|
-
"description": "Jest preset for
|
|
3
|
+
"version": "4.2.0",
|
|
4
|
+
"description": "Jest preset for Stylelint plugins.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"stylelint",
|
|
7
7
|
"jest",
|
|
@@ -24,12 +24,8 @@
|
|
|
24
24
|
"lint:md": "remark . --quiet --frail ",
|
|
25
25
|
"release": "np",
|
|
26
26
|
"test": "jest",
|
|
27
|
-
"watch": "jest --watch"
|
|
28
|
-
|
|
29
|
-
"husky": {
|
|
30
|
-
"hooks": {
|
|
31
|
-
"pre-commit": "lint-staged"
|
|
32
|
-
}
|
|
27
|
+
"watch": "jest --watch",
|
|
28
|
+
"prepare": "husky install"
|
|
33
29
|
},
|
|
34
30
|
"lint-staged": {
|
|
35
31
|
"*.js": "eslint --cache --fix",
|
|
@@ -39,7 +35,11 @@
|
|
|
39
35
|
"eslintConfig": {
|
|
40
36
|
"extends": [
|
|
41
37
|
"stylelint"
|
|
42
|
-
]
|
|
38
|
+
],
|
|
39
|
+
"globals": {
|
|
40
|
+
"module": true,
|
|
41
|
+
"require": true
|
|
42
|
+
}
|
|
43
43
|
},
|
|
44
44
|
"remarkConfig": {
|
|
45
45
|
"plugins": [
|
|
@@ -48,17 +48,17 @@
|
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@stylelint/prettier-config": "^2.0.0",
|
|
51
|
-
"@stylelint/remark-preset": "^
|
|
52
|
-
"eslint": "^
|
|
53
|
-
"eslint-config-stylelint": "^
|
|
54
|
-
"husky": "^
|
|
55
|
-
"jest": "^27.
|
|
56
|
-
"lint-staged": "^11.
|
|
51
|
+
"@stylelint/remark-preset": "^3.0.0",
|
|
52
|
+
"eslint": "^8.2.0",
|
|
53
|
+
"eslint-config-stylelint": "^15.0.0",
|
|
54
|
+
"husky": "^7.0.4",
|
|
55
|
+
"jest": "^27.3.1",
|
|
56
|
+
"lint-staged": "^11.2.6",
|
|
57
57
|
"np": "^7.5.0",
|
|
58
58
|
"npm-run-all": "^4.1.5",
|
|
59
|
-
"prettier": "^2.
|
|
60
|
-
"remark-cli": "^
|
|
61
|
-
"stylelint": "^
|
|
59
|
+
"prettier": "^2.4.1",
|
|
60
|
+
"remark-cli": "^10.0.0",
|
|
61
|
+
"stylelint": "^14.0.1"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"jest": "^25.3.0 || ^26.0.1 || ^27.0.1"
|