@tomjs/stylelint 4.0.2 → 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 CHANGED
@@ -11,32 +11,31 @@
11
11
  - Install dependencies
12
12
 
13
13
  ```bash
14
- pnpm add -D stylelint prettier @tomjs/stylelint
14
+ pnpm add -D stylelint @tomjs/stylelint
15
15
  ```
16
16
 
17
- - Modify `.stylelintrc.{js,cjs}` configuration
17
+ - Modify `stylelint.config.{js,ts,mjs,mts}` configuration
18
18
 
19
19
  ```js
20
- module.exports = {
21
- extends: [require.resolve('@tomjs/stylelint')],
20
+ export default {
21
+ extends: ['tomjs/stylelint'],
22
22
  };
23
23
  ```
24
24
 
25
25
  #### Make configuration
26
26
 
27
27
  ```bash
28
- pnpm add --save-peer prettier stylelint
28
+ pnpm add --save-peer stylelint
29
29
  pnpm add postcss postcss-html postcss-less postcss-scss
30
- pnpm add stylelint-prettier stylelint-config-standard stylelint-config-standard-scss stylelint-config-recommended-vue
31
- pnpm add stylelint-order stylelint-config-property-sort-order-smacss
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
- - [stylelint-prettier](https://www.npmjs.com/package/stylelint-prettier): Run Prettier as a stylelint rule and report differences as a single stylelint issue
35
- - [stylelint-config-standard](https://www.npmjs.com/package/stylelint-config-standard): It extends stylelint-config-recommended and turns on additional rules to enforce modernization in the CSS specification Agreement
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
- - [stylelint-config-property-sort-order-smacss](https://www.npmjs.com/package/stylelint-config-property-sort-order-smacss): Based on [SMACSS](http://smacss .com/) method attribute sorting
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).
40
39
 
41
40
  ## Reference project
42
41
 
package/README.zh_CN.md CHANGED
@@ -11,32 +11,30 @@
11
11
  - 安装依赖
12
12
 
13
13
  ```bash
14
- pnpm add -D stylelint prettier @tomjs/stylelint
14
+ pnpm add -D stylelint @tomjs/stylelint
15
15
  ```
16
16
 
17
- - 修改 `.stylelintrc.{js,cjs}` 配置
17
+ - 修改 `stylelint.config.{js,ts,mjs,mts}` 配置
18
18
 
19
19
  ```js
20
- module.exports = {
21
- extends: [require.resolve('@tomjs/stylelint')],
20
+ export default {
21
+ extends: ['tomjs/stylelint'],
22
22
  };
23
23
  ```
24
24
 
25
25
  #### 制作配置
26
26
 
27
27
  ```bash
28
- pnpm add --save-peer prettier stylelint
28
+ pnpm add --save-peer stylelint
29
29
  pnpm add postcss postcss-html postcss-less postcss-scss
30
- pnpm add stylelint-prettier stylelint-config-standard stylelint-config-standard-scss stylelint-config-recommended-vue
31
- pnpm add stylelint-order stylelint-config-property-sort-order-smacss
30
+ pnpm add stylelint-config-recommended stylelint-config-recommended-scss stylelint-config-recommended-vue
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
- - [stylelint-config-standard](https://www.npmjs.com/package/stylelint-config-standard):它扩展了 stylelint-config-recommended,并开启了附加规则,以执行 CSS 规范中的现代约定
36
- - [stylelint-config-standard-scss](https://www.npmjs.com/package/stylelint-config-standard-scss):stylelint 的标准 scss 共享配置
34
+ - [stylelint-config-recommended](https://www.npmjs.com/package/stylelint-config-recommended):它扩展了 stylelint-config-recommended,并开启了附加规则,以执行 CSS 规范中的现代约定
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
- - [stylelint-order](https://www.npmjs.com/package/stylelint-order):为 stylelint 提供的与排序相关的提示规则的插件包
39
- - [stylelint-config-property-sort-order-smacss](https://www.npmjs.com/package/stylelint-config-property-sort-order-smacss):基于 [SMACSS](http://smacss.com/) 方法的属性排序
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 属性进行排序。
40
38
 
41
39
  ## 参考项目
42
40
 
@@ -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,17 +23,14 @@ 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
38
- //#region src/config.ts
33
+ //#region src/index.ts
39
34
  const config = {
40
35
  extends: [
41
36
  "stylelint-config-recommended",
@@ -74,7 +69,7 @@ const config = {
74
69
  "**/*.ts"
75
70
  ]
76
71
  };
77
- var config_default = config;
72
+ var src_default = config;
78
73
 
79
74
  //#endregion
80
- export { config_default as default };
75
+ export { src_default as default };
package/package.json CHANGED
@@ -1,42 +1,38 @@
1
1
  {
2
2
  "name": "@tomjs/stylelint",
3
- "version": "4.0.2",
3
+ "type": "module",
4
+ "version": "6.0.0",
4
5
  "description": "stylelint config for tomjs",
5
- "keywords": [
6
- "stylelint",
7
- "lint",
8
- "config",
9
- "style",
10
- "css",
11
- "less",
12
- "scss",
13
- "vue"
14
- ],
15
6
  "author": {
16
7
  "name": "Tom Gao",
17
8
  "email": "tom@tomgao.cc"
18
9
  },
19
10
  "license": "MIT",
11
+ "homepage": "https://github.com/tomjs/config/tree/main/packages/stylelint#readme",
20
12
  "repository": {
21
13
  "type": "git",
22
14
  "url": "git+https://github.com/tomjs/config.git",
23
15
  "directory": "packages/stylelint"
24
16
  },
25
- "homepage": "https://github.com/tomjs/config/tree/main/packages/stylelint#readme",
17
+ "keywords": [
18
+ "stylelint",
19
+ "lint",
20
+ "config",
21
+ "style",
22
+ "css",
23
+ "less",
24
+ "scss",
25
+ "vue"
26
+ ],
27
+ "exports": "./dist/index.js",
26
28
  "files": [
27
29
  "dist"
28
30
  ],
29
- "main": "./dist/index.cjs",
30
- "module": "./dist/index.mjs",
31
- "exports": {
32
- ".": {
33
- "require": "./dist/index.cjs",
34
- "import": "./dist/index.mjs"
35
- },
36
- "./config": {
37
- "require": "./dist/config.cjs",
38
- "import": "./dist/config.mjs"
39
- }
31
+ "engines": {
32
+ "node": ">=18.12.0"
33
+ },
34
+ "peerDependencies": {
35
+ "stylelint": "^16.8.2"
40
36
  },
41
37
  "dependencies": {
42
38
  "postcss": "^8.5.3",
@@ -46,23 +42,9 @@
46
42
  "stylelint-config-recess-order": "^6.0.0",
47
43
  "stylelint-config-recommended": "^14.0.1",
48
44
  "stylelint-config-recommended-scss": "^14.1.0",
49
- "stylelint-config-recommended-vue": "~1.5.0",
50
- "stylelint-prettier": "^5.0.3"
51
- },
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"
45
+ "stylelint-config-recommended-vue": "~1.5.0"
63
46
  },
64
47
  "scripts": {
65
- "build": "npm run clean && rolldown -c",
66
- "clean": "rimraf ./dist"
48
+ "build": "tsdown"
67
49
  }
68
50
  }
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;
package/dist/index.cjs DELETED
@@ -1,11 +0,0 @@
1
- "use strict";
2
-
3
- //#region src/index.ts
4
- const config = {
5
- extends: ["@tomjs/stylelint/config"],
6
- plugins: ["stylelint-prettier"]
7
- };
8
- var src_default = config;
9
-
10
- //#endregion
11
- module.exports = src_default;
package/dist/index.mjs DELETED
@@ -1,10 +0,0 @@
1
-
2
- //#region src/index.ts
3
- const config = {
4
- extends: ["@tomjs/stylelint/config"],
5
- plugins: ["stylelint-prettier"]
6
- };
7
- var src_default = config;
8
-
9
- //#endregion
10
- export { src_default as default };