@tomjs/stylelint 5.0.0 → 6.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 +5 -6
- package/README.zh_CN.md +5 -6
- package/dist/index.js +68 -2
- package/package.json +3 -13
- package/dist/config.js +0 -75
package/README.md
CHANGED
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
- Install dependencies
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
pnpm add -D stylelint
|
|
14
|
+
pnpm add -D stylelint @tomjs/stylelint
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
- Modify
|
|
17
|
+
- Modify `stylelint.config.{js,ts,mjs,mts}` configuration
|
|
18
18
|
|
|
19
19
|
```js
|
|
20
20
|
export default {
|
|
@@ -25,15 +25,14 @@ export default {
|
|
|
25
25
|
#### Make configuration
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
|
-
pnpm add --save-peer
|
|
28
|
+
pnpm add --save-peer stylelint
|
|
29
29
|
pnpm add postcss postcss-html postcss-less postcss-scss
|
|
30
30
|
pnpm add stylelint-prettier stylelint-config-recommended stylelint-config-recommended-scss stylelint-config-recommended-vue
|
|
31
31
|
pnpm add stylelint-config-recess-order
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
- [stylelint-
|
|
35
|
-
- [stylelint-config-
|
|
36
|
-
- [stylelint-config-standard-scss](https://www.npmjs.com/package/stylelint-config-standard-scss): Standard scss shared configuration for stylelint
|
|
34
|
+
- [stylelint-config-recommended](https://www.npmjs.com/package/stylelint-config-recommended): It extends stylelint-config-recommended and turns on additional rules to enforce modernization in the CSS specification Agreement
|
|
35
|
+
- [stylelint-config-recommended-scss](https://www.npmjs.com/package/stylelint-config-recommended-scss): Recommended scss shared configuration for stylelint
|
|
37
36
|
- [stylelint-config-recommended-vue](https://www.npmjs.com/package/stylelint-config-recommended-vue): stylelint’s recommended vue shared configuration
|
|
38
37
|
- [stylelint-order](https://www.npmjs.com/package/stylelint-order): A plug-in package that provides sorting-related prompt rules for stylelint
|
|
39
38
|
- [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).
|
package/README.zh_CN.md
CHANGED
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
- 安装依赖
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
pnpm add -D stylelint
|
|
14
|
+
pnpm add -D stylelint @tomjs/stylelint
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
- 修改
|
|
17
|
+
- 修改 `stylelint.config.{js,ts,mjs,mts}` 配置
|
|
18
18
|
|
|
19
19
|
```js
|
|
20
20
|
export default {
|
|
@@ -25,15 +25,14 @@ export default {
|
|
|
25
25
|
#### 制作配置
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
|
-
pnpm add --save-peer
|
|
28
|
+
pnpm add --save-peer stylelint
|
|
29
29
|
pnpm add postcss postcss-html postcss-less postcss-scss
|
|
30
|
-
pnpm add stylelint-
|
|
30
|
+
pnpm add stylelint-config-recommended stylelint-config-recommended-scss stylelint-config-recommended-vue
|
|
31
31
|
pnpm add stylelint-config-recess-order
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
- [stylelint-prettier](https://www.npmjs.com/package/stylelint-prettier):将 Prettier 作为 stylelint 规则运行,并将差异报告为单个 stylelint 问题
|
|
35
34
|
- [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
|
|
35
|
+
- [stylelint-config-recommended-scss](https://www.npmjs.com/package/stylelint-config-recommended-scss):stylelint 的推荐 scss 共享配置
|
|
37
36
|
- [stylelint-config-recommended-vue](https://www.npmjs.com/package/stylelint-config-recommended-vue):stylelint 的推荐 vue 共享配置
|
|
38
37
|
- [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 属性进行排序。
|
|
39
38
|
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,73 @@
|
|
|
1
|
+
//#region src/globs.ts
|
|
2
|
+
/**
|
|
3
|
+
* https://github.com/antfu/eslint-config/blob/5af1d9bf96609ab1d0a820cee0f83cd6948a0c5d/src/globs.ts#L56C14-L56C26
|
|
4
|
+
*/
|
|
5
|
+
const GLOB_EXCLUDE = [
|
|
6
|
+
"**/node_modules",
|
|
7
|
+
"**/dist",
|
|
8
|
+
"**/output",
|
|
9
|
+
"**/coverage",
|
|
10
|
+
"**/temp",
|
|
11
|
+
"**/.temp",
|
|
12
|
+
"**/tmp",
|
|
13
|
+
"**/.tmp",
|
|
14
|
+
"**/.history",
|
|
15
|
+
"**/.vitepress/cache",
|
|
16
|
+
"**/.nuxt",
|
|
17
|
+
"**/.next",
|
|
18
|
+
"**/.svelte-kit",
|
|
19
|
+
"**/.vercel",
|
|
20
|
+
"**/.changeset",
|
|
21
|
+
"**/.idea",
|
|
22
|
+
"**/.cache",
|
|
23
|
+
"**/.output",
|
|
24
|
+
"**/.vite-inspect",
|
|
25
|
+
"**/.yarn",
|
|
26
|
+
"**/CHANGELOG*.md",
|
|
27
|
+
"**/*.min.*",
|
|
28
|
+
"**/LICENSE*",
|
|
29
|
+
"**/__snapshots__"
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
1
33
|
//#region src/index.ts
|
|
2
34
|
const config = {
|
|
3
|
-
extends: [
|
|
4
|
-
|
|
35
|
+
extends: [
|
|
36
|
+
"stylelint-config-recommended",
|
|
37
|
+
"stylelint-config-recommended-scss",
|
|
38
|
+
"stylelint-config-recommended-vue/scss",
|
|
39
|
+
"stylelint-config-html/vue",
|
|
40
|
+
"stylelint-config-recess-order"
|
|
41
|
+
],
|
|
42
|
+
overrides: [{
|
|
43
|
+
files: ["**/*.{vue,html}"],
|
|
44
|
+
customSyntax: "postcss-html"
|
|
45
|
+
}, {
|
|
46
|
+
files: ["**/*.{css,scss}"],
|
|
47
|
+
customSyntax: "postcss-scss"
|
|
48
|
+
}],
|
|
49
|
+
rules: {
|
|
50
|
+
"alpha-value-notation": "number",
|
|
51
|
+
"color-function-notation": null,
|
|
52
|
+
"font-family-no-missing-generic-family-keyword": null,
|
|
53
|
+
"import-notation": null,
|
|
54
|
+
"media-feature-range-notation": "prefix",
|
|
55
|
+
"named-grid-areas-no-invalid": null,
|
|
56
|
+
"no-descending-specificity": null,
|
|
57
|
+
"no-duplicate-selectors": null,
|
|
58
|
+
"no-empty-source": null,
|
|
59
|
+
"rule-empty-line-before": ["always", { ignore: ["after-comment", "first-nested"] }],
|
|
60
|
+
"selector-class-pattern": null,
|
|
61
|
+
"selector-not-notation": null,
|
|
62
|
+
"selector-pseudo-class-no-unknown": [true, { ignorePseudoClasses: ["global", "deep"] }]
|
|
63
|
+
},
|
|
64
|
+
ignoreFiles: [
|
|
65
|
+
...GLOB_EXCLUDE,
|
|
66
|
+
"**/*.js",
|
|
67
|
+
"**/*.jsx",
|
|
68
|
+
"**/*.tsx",
|
|
69
|
+
"**/*.ts"
|
|
70
|
+
]
|
|
5
71
|
};
|
|
6
72
|
var src_default = config;
|
|
7
73
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tomjs/stylelint",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "6.0.0",
|
|
5
5
|
"description": "stylelint config for tomjs",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Tom Gao",
|
|
@@ -24,10 +24,7 @@
|
|
|
24
24
|
"scss",
|
|
25
25
|
"vue"
|
|
26
26
|
],
|
|
27
|
-
"exports":
|
|
28
|
-
".": "./dist/index.js",
|
|
29
|
-
"./config": "./dist/config.js"
|
|
30
|
-
},
|
|
27
|
+
"exports": "./dist/index.js",
|
|
31
28
|
"files": [
|
|
32
29
|
"dist"
|
|
33
30
|
],
|
|
@@ -35,14 +32,8 @@
|
|
|
35
32
|
"node": ">=18.12.0"
|
|
36
33
|
},
|
|
37
34
|
"peerDependencies": {
|
|
38
|
-
"prettier": "^3.0.0",
|
|
39
35
|
"stylelint": "^16.8.2"
|
|
40
36
|
},
|
|
41
|
-
"peerDependenciesMeta": {
|
|
42
|
-
"prettier": {
|
|
43
|
-
"optional": true
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
37
|
"dependencies": {
|
|
47
38
|
"postcss": "^8.5.3",
|
|
48
39
|
"postcss-html": "^1.8.0",
|
|
@@ -51,8 +42,7 @@
|
|
|
51
42
|
"stylelint-config-recess-order": "^6.0.0",
|
|
52
43
|
"stylelint-config-recommended": "^14.0.1",
|
|
53
44
|
"stylelint-config-recommended-scss": "^14.1.0",
|
|
54
|
-
"stylelint-config-recommended-vue": "~1.5.0"
|
|
55
|
-
"stylelint-prettier": "^5.0.3"
|
|
45
|
+
"stylelint-config-recommended-vue": "~1.5.0"
|
|
56
46
|
},
|
|
57
47
|
"scripts": {
|
|
58
48
|
"build": "tsdown"
|
package/dist/config.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
//#region src/globs.ts
|
|
2
|
-
/**
|
|
3
|
-
* https://github.com/antfu/eslint-config/blob/5af1d9bf96609ab1d0a820cee0f83cd6948a0c5d/src/globs.ts#L56C14-L56C26
|
|
4
|
-
*/
|
|
5
|
-
const GLOB_EXCLUDE = [
|
|
6
|
-
"**/node_modules",
|
|
7
|
-
"**/dist",
|
|
8
|
-
"**/output",
|
|
9
|
-
"**/coverage",
|
|
10
|
-
"**/temp",
|
|
11
|
-
"**/.temp",
|
|
12
|
-
"**/tmp",
|
|
13
|
-
"**/.tmp",
|
|
14
|
-
"**/.history",
|
|
15
|
-
"**/.vitepress/cache",
|
|
16
|
-
"**/.nuxt",
|
|
17
|
-
"**/.next",
|
|
18
|
-
"**/.svelte-kit",
|
|
19
|
-
"**/.vercel",
|
|
20
|
-
"**/.changeset",
|
|
21
|
-
"**/.idea",
|
|
22
|
-
"**/.cache",
|
|
23
|
-
"**/.output",
|
|
24
|
-
"**/.vite-inspect",
|
|
25
|
-
"**/.yarn",
|
|
26
|
-
"**/CHANGELOG*.md",
|
|
27
|
-
"**/*.min.*",
|
|
28
|
-
"**/LICENSE*",
|
|
29
|
-
"**/__snapshots__"
|
|
30
|
-
];
|
|
31
|
-
|
|
32
|
-
//#endregion
|
|
33
|
-
//#region src/config.ts
|
|
34
|
-
const config = {
|
|
35
|
-
extends: [
|
|
36
|
-
"stylelint-config-recommended",
|
|
37
|
-
"stylelint-config-recommended-scss",
|
|
38
|
-
"stylelint-config-recommended-vue/scss",
|
|
39
|
-
"stylelint-config-html/vue",
|
|
40
|
-
"stylelint-config-recess-order"
|
|
41
|
-
],
|
|
42
|
-
overrides: [{
|
|
43
|
-
files: ["**/*.{vue,html}"],
|
|
44
|
-
customSyntax: "postcss-html"
|
|
45
|
-
}, {
|
|
46
|
-
files: ["**/*.{css,scss}"],
|
|
47
|
-
customSyntax: "postcss-scss"
|
|
48
|
-
}],
|
|
49
|
-
rules: {
|
|
50
|
-
"alpha-value-notation": "number",
|
|
51
|
-
"color-function-notation": null,
|
|
52
|
-
"font-family-no-missing-generic-family-keyword": null,
|
|
53
|
-
"import-notation": null,
|
|
54
|
-
"media-feature-range-notation": "prefix",
|
|
55
|
-
"named-grid-areas-no-invalid": null,
|
|
56
|
-
"no-descending-specificity": null,
|
|
57
|
-
"no-duplicate-selectors": null,
|
|
58
|
-
"no-empty-source": null,
|
|
59
|
-
"rule-empty-line-before": ["always", { ignore: ["after-comment", "first-nested"] }],
|
|
60
|
-
"selector-class-pattern": null,
|
|
61
|
-
"selector-not-notation": null,
|
|
62
|
-
"selector-pseudo-class-no-unknown": [true, { ignorePseudoClasses: ["global", "deep"] }]
|
|
63
|
-
},
|
|
64
|
-
ignoreFiles: [
|
|
65
|
-
...GLOB_EXCLUDE,
|
|
66
|
-
"**/*.js",
|
|
67
|
-
"**/*.jsx",
|
|
68
|
-
"**/*.tsx",
|
|
69
|
-
"**/*.ts"
|
|
70
|
-
]
|
|
71
|
-
};
|
|
72
|
-
var config_default = config;
|
|
73
|
-
|
|
74
|
-
//#endregion
|
|
75
|
-
export { config_default as default };
|