@cgzair/stylelint-config-cgz 0.0.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 cgzjs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,25 @@
1
+ # stylelint-config-cgz
2
+
3
+ 本包提供了《信息技术部前端编码手册》配套的 stylelint 可共享配置。
4
+
5
+ ## 使用
6
+
7
+ 安装
8
+
9
+ ```bash
10
+ yarn add @cgzair/stylelint-config-cgz
11
+ ```
12
+
13
+ ### 配置
14
+
15
+ 在 `.stylelintrc.js` 中继承配置:
16
+
17
+ ```js
18
+ module.exports = {
19
+ extends: ['@cgzair/cgz'],
20
+ };
21
+ ```
22
+
23
+ ## IDE 插件配套集成
24
+
25
+ 推荐使用 `vscode` 作为开发工具,然后安装 `stylelint` 插件,安装地址:<https://marketplace.visualstudio.com/items?itemName=stylelint.vscode-stylelint>。
package/index.js ADDED
@@ -0,0 +1,102 @@
1
+ const miniappTags = require("./miniapp-tags");
2
+
3
+ module.exports = {
4
+ extends: [
5
+ "stylelint-config-standard",
6
+ "stylelint-config-standard-scss",
7
+ "stylelint-config-html",
8
+ "stylelint-config-css-modules",
9
+ "stylelint-config-prettier",
10
+ ],
11
+ plugins: ["stylelint-declaration-block-no-ignored-properties"],
12
+ rules: {
13
+ "at-rule-no-unknown": null,
14
+ "color-function-notation": "legacy",
15
+ "scss/at-function-pattern": null,
16
+ "scss/at-mixin-pattern": null,
17
+ "scss/at-rule-no-unknown": true,
18
+ "scss/at-import-no-partial-leading-underscore": null,
19
+ "scss/at-import-partial-extension": null,
20
+ "scss/dollar-variable-pattern": null,
21
+ "block-no-empty": null,
22
+ "color-no-invalid-hex": true,
23
+ "comment-no-empty": true,
24
+ "declaration-block-no-duplicate-properties": [
25
+ true,
26
+ {
27
+ ignore: ["consecutive-duplicates-with-different-values"],
28
+ },
29
+ ],
30
+ "declaration-block-no-shorthand-property-overrides": true,
31
+ "font-family-no-duplicate-names": true,
32
+ "font-family-no-missing-generic-family-keyword": null,
33
+ "function-calc-no-unspaced-operator": true,
34
+ "function-linear-gradient-no-nonstandard-direction": true,
35
+ "keyframe-declaration-no-important": true,
36
+ "media-feature-name-no-unknown": true,
37
+ "no-descending-specificity": null,
38
+ "no-duplicate-at-import-rules": true,
39
+ "no-duplicate-selectors": true,
40
+ "no-empty-source": null,
41
+ "no-extra-semicolons": true,
42
+ "no-invalid-double-slash-comments": true,
43
+ "property-no-unknown": true,
44
+ "selector-pseudo-class-no-unknown": [
45
+ true,
46
+ {
47
+ ignorePseudoClasses: ["global", "local", "export"],
48
+ },
49
+ ],
50
+ "selector-pseudo-element-no-unknown": [true, { ignorePseudoElements: ["v-deep"] }],
51
+ "selector-type-no-unknown": [
52
+ true,
53
+ {
54
+ ignore: ["custom-elements"],
55
+ ignoreTypes: miniappTags,
56
+ },
57
+ ],
58
+ "string-no-newline": true,
59
+ "unit-no-unknown": [
60
+ true,
61
+ {
62
+ ignoreUnits: ["rpx"],
63
+ },
64
+ ],
65
+ indentation: 2,
66
+ "block-closing-brace-newline-before": "always-multi-line",
67
+ "block-closing-brace-space-before": "always-single-line",
68
+ "block-opening-brace-newline-after": "always-multi-line",
69
+ "block-opening-brace-space-before": "always",
70
+ "block-opening-brace-space-after": "always-single-line",
71
+ "color-hex-case": "lower",
72
+ "color-hex-length": "short",
73
+ "comment-whitespace-inside": "always",
74
+ "declaration-colon-space-before": "never",
75
+ "declaration-colon-space-after": "always",
76
+ "declaration-block-single-line-max-declarations": 1,
77
+ "declaration-block-trailing-semicolon": [
78
+ "always",
79
+ {
80
+ severity: "error",
81
+ },
82
+ ],
83
+ "length-zero-no-unit": [
84
+ true,
85
+ {
86
+ ignore: ["custom-properties"],
87
+ },
88
+ ],
89
+ "max-line-length": 100,
90
+ "selector-max-id": null,
91
+ "value-list-comma-space-after": "always-single-line",
92
+ "scss/double-slash-comment-whitespace-inside": "always",
93
+ "function-url-quotes": null,
94
+ "selector-class-pattern": null,
95
+ "selector-attribute-quotes": "always",
96
+ "number-leading-zero": "always",
97
+ "plugin/declaration-block-no-ignored-properties": true,
98
+ "value-keyword-case": ["lower", { ignoreProperties: ["composes"] }],
99
+ "alpha-value-notation": null,
100
+ },
101
+ ignoreFiles: ["**/*.js", "**/*.jsx", "**/*.tsx", "**/*.ts"],
102
+ };
@@ -0,0 +1,61 @@
1
+ /*
2
+ * 小程序使用的非标准选择器,支付宝扩展组件由于官方停止更新,暂不包含
3
+ */
4
+
5
+ module.exports = [
6
+ // 视图容器
7
+ "cover-image",
8
+ "cover-view",
9
+ "match-media",
10
+ "movable-area",
11
+ "movable-view",
12
+ "page-container",
13
+ "scroll-view",
14
+ "share-element",
15
+ "swiper",
16
+ "swiper-item",
17
+ "page",
18
+ "view",
19
+ // 基础内容
20
+ "icon",
21
+ "progress",
22
+ "rich-text",
23
+ "text",
24
+ // 表单组件
25
+ "checkbox",
26
+ "checkbox-group",
27
+ "editor",
28
+ "keyboard-accessory",
29
+ "picker",
30
+ "picker-view",
31
+ "picker-view-column",
32
+ "radio",
33
+ "radio-group",
34
+ "slider",
35
+ "switch",
36
+ // 导航
37
+ "navigator",
38
+ "functional-page-navigator",
39
+ // 媒体组件
40
+ "camera",
41
+ "image",
42
+ "live-player",
43
+ "live-pusher",
44
+ "voip-room",
45
+ "lottie",
46
+ // 地图
47
+ "map",
48
+ // 开发能力
49
+ "ad",
50
+ "ad-custom",
51
+ "official-account",
52
+ "open-data",
53
+ "web-view",
54
+ "lifestyle",
55
+ "contact-button",
56
+ "error-view",
57
+ // 导航栏
58
+ "navigation-bar",
59
+ // 页面属性节点
60
+ "page-meta",
61
+ ];
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@cgzair/stylelint-config-cgz",
3
+ "version": "0.0.1",
4
+ "description": "Stylelint shareable configuration for cgz frontend Guidelines",
5
+ "main": "index.js",
6
+ "keywords": [
7
+ "stylelint",
8
+ "stylelint-config-cgz"
9
+ ],
10
+ "scripts": {
11
+ "test": "jest",
12
+ "test:coverage": "jest --coverage"
13
+ },
14
+ "files": [
15
+ "index.js",
16
+ "miniapp-tags.js",
17
+ "README.md",
18
+ "package.json"
19
+ ],
20
+ "author": "cgz",
21
+ "dependencies": {
22
+ "stylelint": "~14.2.0",
23
+ "stylelint-config-css-modules": "^2.3.0",
24
+ "stylelint-config-html": "^1.0.0",
25
+ "stylelint-config-prettier": "^9.0.3",
26
+ "stylelint-config-standard": "^24.0.0",
27
+ "stylelint-config-standard-scss": "^3.0.0",
28
+ "stylelint-declaration-block-no-ignored-properties": "^2.5.0"
29
+ },
30
+ "devDependencies": {
31
+ "jest": "^27.3.1"
32
+ },
33
+ "publishConfig": {
34
+ "access": "public"
35
+ },
36
+ "engines": {
37
+ "node": ">=12.0.0"
38
+ },
39
+ "license": "MIT",
40
+ "jest": {
41
+ "coverageReporters": [
42
+ "lcov",
43
+ "cobertura"
44
+ ]
45
+ },
46
+ "gitHead": "41595a9ec08fa8e9a3bfde408cf1249aa3d401f5"
47
+ }