stylelint-config-hcl 0.0.3-alpha.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.
Files changed (4) hide show
  1. package/LICENSE +1 -0
  2. package/README.md +29 -0
  3. package/index.js +88 -0
  4. package/package.json +46 -0
package/LICENSE ADDED
@@ -0,0 +1 @@
1
+ MIT
package/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # stylelint-config-hcl
2
+
3
+ > 基于 stylelint 配置的基础通用的CSS规范
4
+
5
+ 支持配套的 [stylelint 可共享配置](https://stylelint.io/user-guide/configure)。
6
+
7
+ ## 安装
8
+
9
+ 需要先行安装 [stylelint](https://www.npmjs.com/package/stylelint) 和 [stylelint-scss](https://www.npmjs.com/package/stylelint-scss):
10
+
11
+ ```bash
12
+ npm install stylelint stylelint-scss --save-dev
13
+ ```
14
+
15
+ 安装本包:
16
+
17
+ ```bash
18
+ npm install stylelint-config-hcl --save-dev
19
+ ```
20
+
21
+ ## 使用
22
+
23
+ 在 `.stylelintrc` 中继承本包:
24
+
25
+ ```json
26
+ {
27
+ "extends": "stylelint-config-hcl"
28
+ }
29
+ ```
package/index.js ADDED
@@ -0,0 +1,88 @@
1
+ export default {
2
+ defaultSeverity: 'warning',
3
+ plugins: [
4
+ 'stylelint-scss',
5
+ ],
6
+ rules: {
7
+ /**
8
+ * Possible errors
9
+ * @link https://stylelint.io/user-guide/rules/#possible-errors
10
+ */
11
+ 'at-rule-no-unknown': null,
12
+ 'scss/at-rule-no-unknown': true,
13
+ 'block-no-empty': null,
14
+ 'color-no-invalid-hex': true,
15
+ 'comment-no-empty': true,
16
+ 'declaration-block-no-duplicate-properties': [
17
+ true,
18
+ {
19
+ ignore: ['consecutive-duplicates-with-different-values'],
20
+ },
21
+ ],
22
+ 'declaration-block-no-shorthand-property-overrides': true,
23
+ 'font-family-no-duplicate-names': true,
24
+ 'function-calc-no-unspaced-operator': true,
25
+ 'function-linear-gradient-no-nonstandard-direction': true,
26
+ 'keyframe-declaration-no-important': true,
27
+ 'media-feature-name-no-unknown': true,
28
+ 'no-descending-specificity': null, // @reason 实际有很多这样用的,且多数人熟悉 css 优先级
29
+ 'no-duplicate-at-import-rules': true,
30
+ 'no-duplicate-selectors': true,
31
+ 'no-empty-source': null,
32
+ 'no-invalid-double-slash-comments': true,
33
+ 'property-no-unknown': true,
34
+ 'selector-pseudo-class-no-unknown': [
35
+ true,
36
+ {
37
+ ignorePseudoClasses: ['global', 'local', 'export'],
38
+ },
39
+ ],
40
+ 'selector-pseudo-element-no-unknown': true,
41
+ 'string-no-newline': true,
42
+ 'unit-no-unknown': [
43
+ true,
44
+ {
45
+ ignoreUnits: ['rpx'],
46
+ },
47
+ ],
48
+
49
+ /**
50
+ * Stylistic issues v17版本中已废弃
51
+ * @link https://stylelint.io/user-guide/rules/list#stylistic-issues
52
+ */
53
+ // indentation: 2,
54
+ // 'block-closing-brace-newline-before': 'always-multi-line',
55
+ // 'block-closing-brace-space-before': 'always-single-line',
56
+ // 'block-opening-brace-newline-after': 'always-multi-line',
57
+ // 'block-opening-brace-space-before': 'always',
58
+ // 'block-opening-brace-space-after': 'always-single-line',
59
+ // 'color-hex-case': 'lower',
60
+ 'color-hex-length': 'short',
61
+ 'comment-whitespace-inside': 'always',
62
+ // 'declaration-colon-space-before': 'never',
63
+ // 'declaration-colon-space-after': 'always',
64
+ // 'declaration-block-single-line-max-declarations': 1,
65
+ // 'declaration-block-trailing-semicolon': [
66
+ // 'always',
67
+ // {
68
+ // severity: 'error',
69
+ // },
70
+ // ],
71
+ 'length-zero-no-unit': [
72
+ true,
73
+ {
74
+ ignore: ['custom-properties'],
75
+ },
76
+ ],
77
+ // 'max-line-length': 100,
78
+ 'selector-max-id': 0,
79
+ // 'value-list-comma-space-after': 'always-single-line',
80
+
81
+ /**
82
+ * stylelint-scss rules
83
+ * @link https://www.npmjs.com/package/stylelint-scss
84
+ */
85
+ 'scss/double-slash-comment-whitespace-inside': 'always',
86
+ },
87
+ ignoreFiles: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx'],
88
+ };
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "stylelint-config-hcl",
3
+ "version": "0.0.3-alpha.0",
4
+ "description": "基于 stylelint 配置的基础通用的样式规范",
5
+ "license": "ISC",
6
+ "author": "hechenglong <1104907547@qq.com>",
7
+ "main": "index.js",
8
+ "files": [
9
+ "index.js"
10
+ ],
11
+ "keywords": [
12
+ "style",
13
+ "lint"
14
+ ],
15
+ "type": "module",
16
+ "scripts": {
17
+ "test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest"
18
+ },
19
+ "jest": {
20
+ "transform": {},
21
+ "testEnvironment": "node"
22
+ },
23
+ "publishConfig": {
24
+ "registry": "https://registry.npmjs.org/",
25
+ "access": "public"
26
+ },
27
+ "homepage": "https://github.com/15272410401/front-end-coding-specification#readme",
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "git+https://github.com/15272410401/front-end-coding-specification.git"
31
+ },
32
+ "bugs": {
33
+ "url": "https://github.com/15272410401/front-end-coding-specification/issues"
34
+ },
35
+ "devDependencies": {
36
+ "cross-env": "^10.1.0",
37
+ "jest": "^30.4.2",
38
+ "stylelint": "^17.14.0",
39
+ "stylelint-scss": "^7.2.0"
40
+ },
41
+ "peerDependencies": {
42
+ "stylelint": ">=17.14.0",
43
+ "stylelint-scss": ">=7.2.0"
44
+ },
45
+ "gitHead": "2cf5f56362c04886dc8f937985cabd5794615f4d"
46
+ }