stylelint-order 7.0.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/README.md +1 -1
- package/package.json +17 -17
- package/rules/order/README.md +8 -1
- package/rules/order/index.js +1 -0
- package/rules/properties-alphabetical-order/index.js +1 -0
- package/rules/properties-order/index.js +1 -0
- package/utils/getContainingNode.js +1 -1
- package/utils/validateType.js +3 -3
package/README.md
CHANGED
|
@@ -52,7 +52,7 @@ Every rule supports autofixing with `stylelint --fix`. [postcss-sorting] is used
|
|
|
52
52
|
|
|
53
53
|
Automatic sorting has some limitations that are described for every rule, if any. Please, take a look at [how comments are handled](https://github.com/hudochenkov/postcss-sorting#handling-comments) by `postcss-sorting`.
|
|
54
54
|
|
|
55
|
-
CSS-in-JS styles with template interpolation [
|
|
55
|
+
CSS-in-JS styles with template interpolation [has limited autofixing](https://github.com/hudochenkov/postcss-sorting#css-in-js) to avoid style corruption.
|
|
56
56
|
|
|
57
57
|
Autofixing in Less syntax may work but isn't officially supported.
|
|
58
58
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stylelint-order",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"description": "A collection of order related linting rules for Stylelint.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"stylelint-plugin",
|
|
@@ -26,33 +26,33 @@
|
|
|
26
26
|
"node": ">=20.19.0"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"postcss": "^8.5.
|
|
30
|
-
"postcss-sorting": "^
|
|
29
|
+
"postcss": "^8.5.8",
|
|
30
|
+
"postcss-sorting": "^10.0.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"stylelint": "^16.18.0"
|
|
33
|
+
"stylelint": "^16.18.0 || ^17.0.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"eslint": "^9.
|
|
37
|
-
"eslint-config-hudochenkov": "^
|
|
38
|
-
"eslint-config-prettier": "^10.1.
|
|
39
|
-
"globals": "^
|
|
36
|
+
"eslint": "^9.39.4",
|
|
37
|
+
"eslint-config-hudochenkov": "^13.0.0",
|
|
38
|
+
"eslint-config-prettier": "^10.1.8",
|
|
39
|
+
"globals": "^17.4.0",
|
|
40
40
|
"husky": "^9.1.7",
|
|
41
|
-
"jest": "^
|
|
42
|
-
"jest-light-runner": "^0.7.
|
|
43
|
-
"jest-preset-stylelint": "^
|
|
44
|
-
"jest-watch-typeahead": "^
|
|
45
|
-
"lint-staged": "^
|
|
46
|
-
"postcss-html": "^1.8.
|
|
41
|
+
"jest": "^30.2.0",
|
|
42
|
+
"jest-light-runner": "^0.7.11",
|
|
43
|
+
"jest-preset-stylelint": "^9.1.0",
|
|
44
|
+
"jest-watch-typeahead": "^3.0.1",
|
|
45
|
+
"lint-staged": "^16.3.2",
|
|
46
|
+
"postcss-html": "^1.8.1",
|
|
47
47
|
"postcss-less": "^6.0.0",
|
|
48
48
|
"postcss-styled-syntax": "^0.7.1",
|
|
49
|
-
"prettier": "~3.
|
|
49
|
+
"prettier": "~3.8.1",
|
|
50
50
|
"prettier-config-hudochenkov": "^0.4.0",
|
|
51
|
-
"stylelint": "^
|
|
51
|
+
"stylelint": "^17.4.0"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
54
|
"lint": "eslint . --max-warnings 0 && prettier '**/*.js' --check",
|
|
55
|
-
"test": "
|
|
55
|
+
"test": "jest",
|
|
56
56
|
"watch": "npm run test -- --watch",
|
|
57
57
|
"coverage": "npm run test -- --coverage",
|
|
58
58
|
"fix": "eslint . --fix --max-warnings 0 && prettier '**/*.js' --write",
|
package/rules/order/README.md
CHANGED
|
@@ -15,7 +15,14 @@ Specify the order of content within declaration blocks.
|
|
|
15
15
|
```ts
|
|
16
16
|
type PrimaryOption = Array<Keyword | AtRule | Rule>;
|
|
17
17
|
|
|
18
|
-
type Keyword =
|
|
18
|
+
type Keyword =
|
|
19
|
+
| 'custom-properties'
|
|
20
|
+
| 'dollar-variables'
|
|
21
|
+
| 'at-variables'
|
|
22
|
+
| 'declarations'
|
|
23
|
+
| 'rules'
|
|
24
|
+
| 'at-rules'
|
|
25
|
+
| 'less-mixins';
|
|
19
26
|
|
|
20
27
|
type AtRule = {
|
|
21
28
|
type: 'at-rule';
|
package/rules/order/index.js
CHANGED
|
@@ -8,7 +8,7 @@ export function getContainingNode(node) {
|
|
|
8
8
|
return node.parent;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
//
|
|
11
|
+
// postcss-html `style` attributes: declarations are children of Root node
|
|
12
12
|
if (node.parent?.document?.nodes?.some((item) => item.type === 'root')) {
|
|
13
13
|
return node.parent;
|
|
14
14
|
}
|
package/utils/validateType.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @returns {boolean}
|
|
5
5
|
*/
|
|
6
6
|
export function isBoolean(value) {
|
|
7
|
-
return typeof value === 'boolean'
|
|
7
|
+
return typeof value === 'boolean';
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -13,7 +13,7 @@ export function isBoolean(value) {
|
|
|
13
13
|
* @returns {boolean}
|
|
14
14
|
*/
|
|
15
15
|
export function isNumber(value) {
|
|
16
|
-
return typeof value === 'number'
|
|
16
|
+
return typeof value === 'number';
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -31,7 +31,7 @@ export function isRegExp(value) {
|
|
|
31
31
|
* @returns {boolean}
|
|
32
32
|
*/
|
|
33
33
|
export function isString(value) {
|
|
34
|
-
return typeof value === 'string'
|
|
34
|
+
return typeof value === 'string';
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
/**
|