@tomjs/stylelint 4.0.1 → 5.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 +6 -6
- package/README.zh_CN.md +8 -9
- package/dist/{config.mjs → config.js} +4 -9
- package/dist/{index.mjs → index.js} +0 -1
- package/package.json +28 -36
- package/dist/config.cjs +0 -81
- package/dist/index.cjs +0 -11
package/README.md
CHANGED
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
pnpm add -D stylelint prettier @tomjs/stylelint
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
- Modify `.
|
|
17
|
+
- Modify `.stylelint.config.{js,ts,mjs,mts}` configuration
|
|
18
18
|
|
|
19
19
|
```js
|
|
20
|
-
|
|
21
|
-
extends: [
|
|
20
|
+
export default {
|
|
21
|
+
extends: ['tomjs/stylelint'],
|
|
22
22
|
};
|
|
23
23
|
```
|
|
24
24
|
|
|
@@ -27,8 +27,8 @@ module.exports = {
|
|
|
27
27
|
```bash
|
|
28
28
|
pnpm add --save-peer prettier stylelint
|
|
29
29
|
pnpm add postcss postcss-html postcss-less postcss-scss
|
|
30
|
-
pnpm add stylelint-prettier stylelint-config-
|
|
31
|
-
pnpm add stylelint-
|
|
30
|
+
pnpm add stylelint-prettier stylelint-config-recommended stylelint-config-recommended-scss stylelint-config-recommended-vue
|
|
31
|
+
pnpm add stylelint-config-recess-order
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
- [stylelint-prettier](https://www.npmjs.com/package/stylelint-prettier): Run Prettier as a stylelint rule and report differences as a single stylelint issue
|
|
@@ -36,7 +36,7 @@ pnpm add stylelint-order stylelint-config-property-sort-order-smacss
|
|
|
36
36
|
- [stylelint-config-standard-scss](https://www.npmjs.com/package/stylelint-config-standard-scss): Standard scss shared configuration for stylelint
|
|
37
37
|
- [stylelint-config-recommended-vue](https://www.npmjs.com/package/stylelint-config-recommended-vue): stylelint’s recommended vue shared configuration
|
|
38
38
|
- [stylelint-order](https://www.npmjs.com/package/stylelint-order): A plug-in package that provides sorting-related prompt rules for stylelint
|
|
39
|
-
- [stylelint-config-
|
|
39
|
+
- [stylelint-config-recess-order](https://www.npmjs.com/package/stylelint-config-recess-order): A [Stylelint](https://github.com/stylelint/stylelint) config that sorts CSS properties the way [Recess](https://github.com/twitter/recess/blob/29bccc870b7b4ccaa0a138e504caf608a6606b59/lib/lint/strict-property-order.js) did and Bootstrap [did](https://github.com/twbs/bootstrap/blob/f58997a0dae54dc98d11892afef9acb85bdc6a1e/.scss-lint.yml#L136)/[does](https://github.com/twbs/stylelint-config-twbs-bootstrap/blob/ad67be6e4ceb48809fa1dce13b7892f9d2018995/css/index.js#L38).
|
|
40
40
|
|
|
41
41
|
## Reference project
|
|
42
42
|
|
package/README.zh_CN.md
CHANGED
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
pnpm add -D stylelint prettier @tomjs/stylelint
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
- 修改 `.
|
|
17
|
+
- 修改 `.stylelint.config.{js,ts,mjs,mts}` 配置
|
|
18
18
|
|
|
19
19
|
```js
|
|
20
|
-
|
|
21
|
-
extends: [
|
|
20
|
+
export default {
|
|
21
|
+
extends: ['tomjs/stylelint'],
|
|
22
22
|
};
|
|
23
23
|
```
|
|
24
24
|
|
|
@@ -27,16 +27,15 @@ module.exports = {
|
|
|
27
27
|
```bash
|
|
28
28
|
pnpm add --save-peer prettier stylelint
|
|
29
29
|
pnpm add postcss postcss-html postcss-less postcss-scss
|
|
30
|
-
pnpm add stylelint-prettier stylelint-config-
|
|
31
|
-
pnpm add stylelint-
|
|
30
|
+
pnpm add stylelint-prettier stylelint-config-recommended stylelint-config-recommended-scss stylelint-config-recommended-vue
|
|
31
|
+
pnpm add stylelint-config-recess-order
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
- [stylelint-prettier](https://www.npmjs.com/package/stylelint-prettier):将 Prettier 作为 stylelint 规则运行,并将差异报告为单个 stylelint 问题
|
|
35
|
-
- [stylelint-config-
|
|
36
|
-
- [stylelint-config-
|
|
35
|
+
- [stylelint-config-recommended](https://www.npmjs.com/package/stylelint-config-recommended):它扩展了 stylelint-config-recommended,并开启了附加规则,以执行 CSS 规范中的现代约定
|
|
36
|
+
- [stylelint-config-recommended-scss](https://www.npmjs.com/package/stylelint-config-recommended-scss):stylelint 的标准 scss 共享配置
|
|
37
37
|
- [stylelint-config-recommended-vue](https://www.npmjs.com/package/stylelint-config-recommended-vue):stylelint 的推荐 vue 共享配置
|
|
38
|
-
- [stylelint-order](https://www.npmjs.com/package/stylelint-order)
|
|
39
|
-
- [stylelint-config-property-sort-order-smacss](https://www.npmjs.com/package/stylelint-config-property-sort-order-smacss):基于 [SMACSS](http://smacss.com/) 方法的属性排序
|
|
38
|
+
- [stylelint-config-recess-order](https://www.npmjs.com/package/stylelint-config-recess-order):一个 [Stylelint](https://github.com/stylelint/stylelint) 配置,它按照 [Recess](https://github.com/twitter/recess/blob/29bccc870b7b4ccaa0a138e504caf608a6606b59/lib/lint/strict-property-order.js) 和 Bootstrap [did](https://github.com/twbs/bootstrap/blob/f58997a0dae54dc98d11892afef9acb85bdc6a1e/.scss-lint.yml#L136)/[does](https://github.com/twbs/stylelint-config-twbs-bootstrap/blob/ad67be6e4ceb48809fa1dce13b7892f9d2018995/css/index.js#L38)的方式对 CSS 属性进行排序。
|
|
40
39
|
|
|
41
40
|
## 参考项目
|
|
42
41
|
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
|
|
2
1
|
//#region src/globs.ts
|
|
2
|
+
/**
|
|
3
|
+
* https://github.com/antfu/eslint-config/blob/5af1d9bf96609ab1d0a820cee0f83cd6948a0c5d/src/globs.ts#L56C14-L56C26
|
|
4
|
+
*/
|
|
3
5
|
const GLOB_EXCLUDE = [
|
|
4
6
|
"**/node_modules",
|
|
5
7
|
"**/dist",
|
|
6
|
-
"**/package-lock.json",
|
|
7
|
-
"**/yarn.lock",
|
|
8
|
-
"**/pnpm-lock.yaml",
|
|
9
|
-
"**/bun.lockb",
|
|
10
8
|
"**/output",
|
|
11
9
|
"**/coverage",
|
|
12
10
|
"**/temp",
|
|
@@ -25,13 +23,10 @@ const GLOB_EXCLUDE = [
|
|
|
25
23
|
"**/.output",
|
|
26
24
|
"**/.vite-inspect",
|
|
27
25
|
"**/.yarn",
|
|
28
|
-
"**/vite.config.*.timestamp-*",
|
|
29
26
|
"**/CHANGELOG*.md",
|
|
30
27
|
"**/*.min.*",
|
|
31
28
|
"**/LICENSE*",
|
|
32
|
-
"**/__snapshots__"
|
|
33
|
-
"**/auto-import?(s).d.ts",
|
|
34
|
-
"**/components.d.ts"
|
|
29
|
+
"**/__snapshots__"
|
|
35
30
|
];
|
|
36
31
|
|
|
37
32
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tomjs/stylelint",
|
|
3
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "5.0.0",
|
|
4
5
|
"description": "stylelint config for tomjs",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Tom Gao",
|
|
8
|
+
"email": "tom@tomgao.cc"
|
|
9
|
+
},
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"homepage": "https://github.com/tomjs/config/tree/main/packages/stylelint#readme",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/tomjs/config.git",
|
|
15
|
+
"directory": "packages/stylelint"
|
|
16
|
+
},
|
|
5
17
|
"keywords": [
|
|
6
18
|
"stylelint",
|
|
7
19
|
"lint",
|
|
@@ -12,30 +24,23 @@
|
|
|
12
24
|
"scss",
|
|
13
25
|
"vue"
|
|
14
26
|
],
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
},
|
|
19
|
-
"license": "MIT",
|
|
20
|
-
"repository": {
|
|
21
|
-
"type": "git",
|
|
22
|
-
"url": "git+https://github.com/tomjs/config.git",
|
|
23
|
-
"directory": "packages/stylelint"
|
|
27
|
+
"exports": {
|
|
28
|
+
".": "./dist/index.js",
|
|
29
|
+
"./config": "./dist/config.js"
|
|
24
30
|
},
|
|
25
|
-
"homepage": "https://github.com/tomjs/config/tree/main/packages/stylelint#readme",
|
|
26
31
|
"files": [
|
|
27
32
|
"dist"
|
|
28
33
|
],
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
34
|
+
"engines": {
|
|
35
|
+
"node": ">=18.12.0"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"prettier": "^3.0.0",
|
|
39
|
+
"stylelint": "^16.8.2"
|
|
40
|
+
},
|
|
41
|
+
"peerDependenciesMeta": {
|
|
42
|
+
"prettier": {
|
|
43
|
+
"optional": true
|
|
39
44
|
}
|
|
40
45
|
},
|
|
41
46
|
"dependencies": {
|
|
@@ -46,23 +51,10 @@
|
|
|
46
51
|
"stylelint-config-recess-order": "^6.0.0",
|
|
47
52
|
"stylelint-config-recommended": "^14.0.1",
|
|
48
53
|
"stylelint-config-recommended-scss": "^14.1.0",
|
|
49
|
-
"stylelint-config-recommended-vue": "
|
|
54
|
+
"stylelint-config-recommended-vue": "~1.5.0",
|
|
50
55
|
"stylelint-prettier": "^5.0.3"
|
|
51
56
|
},
|
|
52
|
-
"peerDependencies": {
|
|
53
|
-
"prettier": "^3.0.0",
|
|
54
|
-
"stylelint": "^16.8.2"
|
|
55
|
-
},
|
|
56
|
-
"peerDependenciesMeta": {
|
|
57
|
-
"prettier": {
|
|
58
|
-
"optional": true
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
"engines": {
|
|
62
|
-
"node": ">=18.12.0"
|
|
63
|
-
},
|
|
64
57
|
"scripts": {
|
|
65
|
-
"build": "
|
|
66
|
-
"clean": "rimraf ./dist"
|
|
58
|
+
"build": "tsdown"
|
|
67
59
|
}
|
|
68
60
|
}
|
package/dist/config.cjs
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
//#region src/globs.ts
|
|
4
|
-
const GLOB_EXCLUDE = [
|
|
5
|
-
"**/node_modules",
|
|
6
|
-
"**/dist",
|
|
7
|
-
"**/package-lock.json",
|
|
8
|
-
"**/yarn.lock",
|
|
9
|
-
"**/pnpm-lock.yaml",
|
|
10
|
-
"**/bun.lockb",
|
|
11
|
-
"**/output",
|
|
12
|
-
"**/coverage",
|
|
13
|
-
"**/temp",
|
|
14
|
-
"**/.temp",
|
|
15
|
-
"**/tmp",
|
|
16
|
-
"**/.tmp",
|
|
17
|
-
"**/.history",
|
|
18
|
-
"**/.vitepress/cache",
|
|
19
|
-
"**/.nuxt",
|
|
20
|
-
"**/.next",
|
|
21
|
-
"**/.svelte-kit",
|
|
22
|
-
"**/.vercel",
|
|
23
|
-
"**/.changeset",
|
|
24
|
-
"**/.idea",
|
|
25
|
-
"**/.cache",
|
|
26
|
-
"**/.output",
|
|
27
|
-
"**/.vite-inspect",
|
|
28
|
-
"**/.yarn",
|
|
29
|
-
"**/vite.config.*.timestamp-*",
|
|
30
|
-
"**/CHANGELOG*.md",
|
|
31
|
-
"**/*.min.*",
|
|
32
|
-
"**/LICENSE*",
|
|
33
|
-
"**/__snapshots__",
|
|
34
|
-
"**/auto-import?(s).d.ts",
|
|
35
|
-
"**/components.d.ts"
|
|
36
|
-
];
|
|
37
|
-
|
|
38
|
-
//#endregion
|
|
39
|
-
//#region src/config.ts
|
|
40
|
-
const config = {
|
|
41
|
-
extends: [
|
|
42
|
-
"stylelint-config-recommended",
|
|
43
|
-
"stylelint-config-recommended-scss",
|
|
44
|
-
"stylelint-config-recommended-vue/scss",
|
|
45
|
-
"stylelint-config-html/vue",
|
|
46
|
-
"stylelint-config-recess-order"
|
|
47
|
-
],
|
|
48
|
-
overrides: [{
|
|
49
|
-
files: ["**/*.{vue,html}"],
|
|
50
|
-
customSyntax: "postcss-html"
|
|
51
|
-
}, {
|
|
52
|
-
files: ["**/*.{css,scss}"],
|
|
53
|
-
customSyntax: "postcss-scss"
|
|
54
|
-
}],
|
|
55
|
-
rules: {
|
|
56
|
-
"alpha-value-notation": "number",
|
|
57
|
-
"color-function-notation": null,
|
|
58
|
-
"font-family-no-missing-generic-family-keyword": null,
|
|
59
|
-
"import-notation": null,
|
|
60
|
-
"media-feature-range-notation": "prefix",
|
|
61
|
-
"named-grid-areas-no-invalid": null,
|
|
62
|
-
"no-descending-specificity": null,
|
|
63
|
-
"no-duplicate-selectors": null,
|
|
64
|
-
"no-empty-source": null,
|
|
65
|
-
"rule-empty-line-before": ["always", { ignore: ["after-comment", "first-nested"] }],
|
|
66
|
-
"selector-class-pattern": null,
|
|
67
|
-
"selector-not-notation": null,
|
|
68
|
-
"selector-pseudo-class-no-unknown": [true, { ignorePseudoClasses: ["global", "deep"] }]
|
|
69
|
-
},
|
|
70
|
-
ignoreFiles: [
|
|
71
|
-
...GLOB_EXCLUDE,
|
|
72
|
-
"**/*.js",
|
|
73
|
-
"**/*.jsx",
|
|
74
|
-
"**/*.tsx",
|
|
75
|
-
"**/*.ts"
|
|
76
|
-
]
|
|
77
|
-
};
|
|
78
|
-
var config_default = config;
|
|
79
|
-
|
|
80
|
-
//#endregion
|
|
81
|
-
module.exports = config_default;
|