@tomjs/stylelint 5.0.0 → 7.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,10 +11,10 @@
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 `.stylelint.config.{js,ts,mjs,mts}` configuration
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 prettier stylelint
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-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
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 prettier @tomjs/stylelint
14
+ pnpm add -D stylelint @tomjs/stylelint
15
15
  ```
16
16
 
17
- - 修改 `.stylelint.config.{js,ts,mjs,mts}` 配置
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 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-recommended stylelint-config-recommended-scss stylelint-config-recommended-vue
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 的标准 scss 共享配置
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
 
@@ -0,0 +1,36 @@
1
+ //#region src/globs.ts
2
+ /**
3
+ * https://github.com/antfu/eslint-config/blob/5af1d9bf96609ab1d0a820cee0f83cd6948a0c5d/src/globs.ts#L56C14-L56C26
4
+ */
5
+ const IGNORE_FILES = [
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
+ "**/__snapshots__",
27
+ "**/*.js",
28
+ "**/*.jsx",
29
+ "**/*.tsx",
30
+ "**/*.ts",
31
+ "**/*.json",
32
+ "**/*.md"
33
+ ];
34
+
35
+ //#endregion
36
+ export { IGNORE_FILES as t };
package/dist/globs.mjs ADDED
@@ -0,0 +1,3 @@
1
+ import { t as IGNORE_FILES } from "./globs-DiC_9FJQ.mjs";
2
+
3
+ export { IGNORE_FILES };
package/dist/index.mjs ADDED
@@ -0,0 +1,63 @@
1
+ import { t as IGNORE_FILES } from "./globs-DiC_9FJQ.mjs";
2
+
3
+ //#region src/index.ts
4
+ const config = {
5
+ extends: ["stylelint-config-recommended", "stylelint-config-recess-order"],
6
+ plugins: ["stylelint-order", "stylelint-scss"],
7
+ ignoreFiles: [...IGNORE_FILES],
8
+ overrides: [{
9
+ customSyntax: "postcss-html",
10
+ files: ["*.(html|vue)", "**/*.(html|vue)"],
11
+ rules: {
12
+ "selector-pseudo-class-no-unknown": [true, { ignorePseudoClasses: ["global", "deep"] }],
13
+ "selector-pseudo-element-no-unknown": [true, { ignorePseudoElements: [
14
+ "v-deep",
15
+ "v-global",
16
+ "v-slotted"
17
+ ] }]
18
+ }
19
+ }, {
20
+ files: ["*.scss", "**/*.scss"],
21
+ customSyntax: "postcss-scss",
22
+ extends: ["stylelint-config-recommended-scss", "stylelint-config-recommended-vue/scss"]
23
+ }],
24
+ rules: {
25
+ "alpha-value-notation": "number",
26
+ "color-function-notation": null,
27
+ "font-family-no-missing-generic-family-keyword": null,
28
+ "import-notation": null,
29
+ "media-feature-range-notation": "prefix",
30
+ "named-grid-areas-no-invalid": null,
31
+ "no-descending-specificity": null,
32
+ "no-duplicate-selectors": null,
33
+ "no-empty-source": null,
34
+ "rule-empty-line-before": ["always", { ignore: ["after-comment", "first-nested"] }],
35
+ "selector-class-pattern": null,
36
+ "selector-not-notation": null,
37
+ "at-rule-no-unknown": [true, { ignoreAtRules: [
38
+ "extends",
39
+ "ignores",
40
+ "include",
41
+ "mixin",
42
+ "if",
43
+ "else",
44
+ "media",
45
+ "for",
46
+ "at-root",
47
+ "tailwind",
48
+ "apply",
49
+ "variants",
50
+ "responsive",
51
+ "screen",
52
+ "function",
53
+ "each",
54
+ "use",
55
+ "forward",
56
+ "return"
57
+ ] }]
58
+ }
59
+ };
60
+ var src_default = config;
61
+
62
+ //#endregion
63
+ export { src_default as default };
@@ -0,0 +1,12 @@
1
+ //#region src/uniapp.ts
2
+ var uniapp_default = {
3
+ extends: ["./index"],
4
+ rules: {
5
+ "unit-no-unknown": [true, { ignoreUnits: ["rpx"] }],
6
+ "declaration-property-value-no-unknown": [true, { ignoreProperties: { "/.+/": ["/rpx$/", "/$/"] } }],
7
+ "selector-type-no-unknown": [true, { ignoreTypes: ["page"] }]
8
+ }
9
+ };
10
+
11
+ //#endregion
12
+ export { uniapp_default as default };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tomjs/stylelint",
3
3
  "type": "module",
4
- "version": "5.0.0",
4
+ "version": "7.0.0",
5
5
  "description": "stylelint config for tomjs",
6
6
  "author": {
7
7
  "name": "Tom Gao",
@@ -25,8 +25,8 @@
25
25
  "vue"
26
26
  ],
27
27
  "exports": {
28
- ".": "./dist/index.js",
29
- "./config": "./dist/config.js"
28
+ ".": "./dist/index.mjs",
29
+ "./uniapp": "./dist/uniapp.mjs"
30
30
  },
31
31
  "files": [
32
32
  "dist"
@@ -35,24 +35,19 @@
35
35
  "node": ">=18.12.0"
36
36
  },
37
37
  "peerDependencies": {
38
- "prettier": "^3.0.0",
39
- "stylelint": "^16.8.2"
40
- },
41
- "peerDependenciesMeta": {
42
- "prettier": {
43
- "optional": true
44
- }
38
+ "stylelint": "^16.25.0"
45
39
  },
46
40
  "dependencies": {
47
- "postcss": "^8.5.3",
41
+ "postcss": "^8.5.6",
48
42
  "postcss-html": "^1.8.0",
49
43
  "postcss-scss": "^4.0.9",
50
44
  "stylelint-config-html": "^1.1.0",
51
- "stylelint-config-recess-order": "^6.0.0",
52
- "stylelint-config-recommended": "^14.0.1",
53
- "stylelint-config-recommended-scss": "^14.1.0",
54
- "stylelint-config-recommended-vue": "~1.5.0",
55
- "stylelint-prettier": "^5.0.3"
45
+ "stylelint-config-recess-order": "^7.4.0",
46
+ "stylelint-config-recommended": "^17.0.0",
47
+ "stylelint-config-recommended-scss": "^16.0.2",
48
+ "stylelint-config-recommended-vue": "^1.6.1",
49
+ "stylelint-order": "^7.0.0",
50
+ "stylelint-scss": "^6.12.1"
56
51
  },
57
52
  "scripts": {
58
53
  "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 };
package/dist/index.js DELETED
@@ -1,9 +0,0 @@
1
- //#region src/index.ts
2
- const config = {
3
- extends: ["@tomjs/stylelint/config"],
4
- plugins: ["stylelint-prettier"]
5
- };
6
- var src_default = config;
7
-
8
- //#endregion
9
- export { src_default as default };