@huangjunsen/markdownlint-config 1.0.0 → 1.0.2

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 (3) hide show
  1. package/README.md +95 -2
  2. package/index.json +111 -111
  3. package/package.json +15 -6
package/README.md CHANGED
@@ -1,3 +1,96 @@
1
- # `markdownlint-config`
1
+ # @huangjunsen/markdownlint-config
2
2
 
3
- > TODO: description
3
+ Markdown 文档的共享检查规范,适用于 README、文档站点与技术方案等 Markdown 文件。
4
+
5
+ ---
6
+
7
+ ## 安装
8
+
9
+ ```bash
10
+ npm install @huangjunsen/markdownlint-config markdownlint --save-dev
11
+ ```
12
+
13
+ > `markdownlint` 为可选的 peer 依赖(`>=0.25.0`)。
14
+
15
+ ---
16
+
17
+ ## 使用
18
+
19
+ 在项目根目录创建 `.markdownlint.json`:
20
+
21
+ ```json
22
+ {
23
+ "extends": "@huangjunsen/markdownlint-config"
24
+ }
25
+ ```
26
+
27
+ ---
28
+
29
+ ## 规范内容
30
+
31
+ 配置以 `markdownlint` 的 `default: true` 为基线(即开启全部规则),再按「文档写作习惯」逐项调整。
32
+
33
+ ### 收紧的规则
34
+
35
+ | 规则 | 配置 | 说明 |
36
+ | --- | --- | --- |
37
+ | `ul-style` | `dash` | 无序列表统一使用 `-` |
38
+ | `no-trailing-spaces` | `br_spaces: 0`、`list_item_empty_lines: false` | 禁止行尾空格,列表项之间不留空行也不允许用行尾空格占位 |
39
+ | `fenced-code-language` | `true` | 围栏代码块必须声明语言 |
40
+
41
+ ### 放宽 / 关闭的规则
42
+
43
+ | 规则 | 配置 | 原因 |
44
+ | --- | --- | --- |
45
+ | `line-length` | `false` | 中文文档按字符数限制行长意义不大 |
46
+ | `list-marker-space` | `false` | 与 Prettier 的列表输出保持一致 |
47
+ | `no-inline-html` | `false` | 允许 Badge、`<details>` 等内联 HTML |
48
+ | `no-duplicate-header` | `false` | 允许不同章节下出现同名子标题 |
49
+ | `proper-names.code_blocks` | `false` | 不检查代码块内的专有名词大小写 |
50
+
51
+ ### `proper-names` 专有名词表
52
+
53
+ 内置约 100 个前端领域的专有名词,命中错误大小写时给出提示,例如:
54
+
55
+ ```text
56
+ Javascript → JavaScript Github → GitHub
57
+ Http → HTTP Npm → npm
58
+ Vuejs → Vue.js Typescript → TypeScript
59
+ ```
60
+
61
+ ---
62
+
63
+ ## 配置文件格式
64
+
65
+ | 格式 | 文件名 |
66
+ | --- | --- |
67
+ | 官方推荐 | `.markdownlint.{jsonc,json,yaml,yml,cjs,mjs}` |
68
+ | cli2 专用 | `.markdownlint-cli2.{jsonc,yaml,cjs,mjs}` |
69
+ | cli2 忽略 | `.markdownlint-cli2.jsonc` 中的 `ignores` 字段 |
70
+
71
+ > ⚠️ `markdownlint-cli2` **不支持** `.markdownlintrc` 与 `.markdownlintignore`。
72
+ > `encode-fe-lint` 会读取项目根目录的 `.markdownlintignore`,并与内置忽略规则合并。
73
+
74
+ ---
75
+
76
+ ## 与 `encode-fe-lint` 的协作方式
77
+
78
+ `encode-fe-lint` 按以下优先级确定 markdownlint 配置:
79
+
80
+ 1. 项目存在 `.markdownlint.*` 或 `.markdownlint-cli2.*`
81
+ → 加载项目配置;
82
+ 2. 以上均无 → 使用 `@huangjunsen/markdownlint-config` 作为默认配置。
83
+
84
+ ---
85
+
86
+ ## 相关包
87
+
88
+ - [`@huangjunsen/encode-fe-lint`](https://www.npmjs.com/package/@huangjunsen/encode-fe-lint) —— 一键接入与扫描的 CLI
89
+ - [`@huangjunsen/eslint-config`](https://www.npmjs.com/package/@huangjunsen/eslint-config)
90
+ - [`@huangjunsen/stylelint-config`](https://www.npmjs.com/package/@huangjunsen/stylelint-config)
91
+ - [`@huangjunsen/prettier-config`](https://www.npmjs.com/package/@huangjunsen/prettier-config)
92
+ - [`@huangjunsen/commitlint-config`](https://www.npmjs.com/package/@huangjunsen/commitlint-config)
93
+
94
+ ## 文档
95
+
96
+ 完整说明见 [项目文档](https://huangjunsen0406.github.io/js-encode-fe-spec/packages/markdownlint-config.html)。
package/index.json CHANGED
@@ -1,112 +1,112 @@
1
- {
2
- "$schema": "https://raw.githubusercontent.com/DavidAnson/markdownlint/main/schema/markdownlint-config-schema.json",
3
- "default": true,
4
- "ul-style": {
5
- "style": "dash"
6
- },
7
- "no-trailing-spaces": {
8
- "br_spaces": 0,
9
- "list_item_empty_lines": false
10
- },
11
- "list-marker-space": false,
12
- "line-length": false,
13
- "no-inline-html": false,
14
- "no-duplicate-header": false,
15
- "fenced-code-language": true,
16
- "proper-names": {
17
- "names": [
18
- "JavaScript",
19
- "HTML",
20
- "CSS",
21
- "AJAX",
22
- "JSON",
23
- "DOM",
24
- "BOM",
25
- "Less",
26
- "Sass",
27
- "SCSS",
28
- "HTTP",
29
- "HTTPS",
30
- "WebSocket",
31
- "ECMAScript",
32
- "ECMAScript 2015",
33
- "ECMAScript 6",
34
- "ES6",
35
- "ES2015",
36
- "jQuery",
37
- "jQuery Mobile",
38
- "React",
39
- "React Native",
40
- "Bootstrap",
41
- "Gulp",
42
- "Grunt",
43
- "webpack",
44
- "Yeoman",
45
- "npm",
46
- "spm",
47
- "Babel",
48
- "Mocha",
49
- "Jasmine",
50
- "PHP",
51
- "Java",
52
- "Node.js",
53
- "NodeJS",
54
- "MySQL",
55
- "MongoDB",
56
- "Redis",
57
- "Apache",
58
- "Nginx",
59
- "NGINX",
60
- "GitHub",
61
- "GitLab",
62
- "GitCafe",
63
- "Chrome",
64
- "Firefox",
65
- "Safari",
66
- "Internet Explore",
67
- "IE",
68
- "IE 7",
69
- "Opera",
70
- "UC",
71
- "Android",
72
- "iOS",
73
- "Windows",
74
- "OS X",
75
- "Ubuntu",
76
- "Linux",
77
- "Debian",
78
- "PC",
79
- "Mobile",
80
- "H5",
81
- "MacBook",
82
- "MacBook Pro",
83
- "MacBook Air",
84
- "iMac",
85
- "Mac Pro",
86
- "iPad",
87
- "Mac mini",
88
- "iPad Air",
89
- "iPad Air 2",
90
- "iPad mini",
91
- "iPhone",
92
- "iPhone 6s",
93
- "iPhone 6s Plus",
94
- "Apple Watch",
95
- "Alibaba",
96
- "Taobao",
97
- "Google",
98
- "Alphabet",
99
- "Apple",
100
- "Microsoft",
101
- "Yahoo",
102
- "FPS",
103
- "UI",
104
- "URL",
105
- "URI",
106
- "URLs",
107
- "URIs",
108
- "Visual Studio Code"
109
- ],
110
- "code_blocks": false
111
- }
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/DavidAnson/markdownlint/main/schema/markdownlint-config-schema.json",
3
+ "default": true,
4
+ "ul-style": {
5
+ "style": "dash"
6
+ },
7
+ "no-trailing-spaces": {
8
+ "br_spaces": 0,
9
+ "list_item_empty_lines": false
10
+ },
11
+ "list-marker-space": false,
12
+ "line-length": false,
13
+ "no-inline-html": false,
14
+ "no-duplicate-header": false,
15
+ "fenced-code-language": true,
16
+ "proper-names": {
17
+ "names": [
18
+ "JavaScript",
19
+ "HTML",
20
+ "CSS",
21
+ "AJAX",
22
+ "JSON",
23
+ "DOM",
24
+ "BOM",
25
+ "Less",
26
+ "Sass",
27
+ "SCSS",
28
+ "HTTP",
29
+ "HTTPS",
30
+ "WebSocket",
31
+ "ECMAScript",
32
+ "ECMAScript 2015",
33
+ "ECMAScript 6",
34
+ "ES6",
35
+ "ES2015",
36
+ "jQuery",
37
+ "jQuery Mobile",
38
+ "React",
39
+ "React Native",
40
+ "Bootstrap",
41
+ "Gulp",
42
+ "Grunt",
43
+ "webpack",
44
+ "Yeoman",
45
+ "npm",
46
+ "spm",
47
+ "Babel",
48
+ "Mocha",
49
+ "Jasmine",
50
+ "PHP",
51
+ "Java",
52
+ "Node.js",
53
+ "NodeJS",
54
+ "MySQL",
55
+ "MongoDB",
56
+ "Redis",
57
+ "Apache",
58
+ "Nginx",
59
+ "NGINX",
60
+ "GitHub",
61
+ "GitLab",
62
+ "GitCafe",
63
+ "Chrome",
64
+ "Firefox",
65
+ "Safari",
66
+ "Internet Explore",
67
+ "IE",
68
+ "IE 7",
69
+ "Opera",
70
+ "UC",
71
+ "Android",
72
+ "iOS",
73
+ "Windows",
74
+ "OS X",
75
+ "Ubuntu",
76
+ "Linux",
77
+ "Debian",
78
+ "PC",
79
+ "Mobile",
80
+ "H5",
81
+ "MacBook",
82
+ "MacBook Pro",
83
+ "MacBook Air",
84
+ "iMac",
85
+ "Mac Pro",
86
+ "iPad",
87
+ "Mac mini",
88
+ "iPad Air",
89
+ "iPad Air 2",
90
+ "iPad mini",
91
+ "iPhone",
92
+ "iPhone 6s",
93
+ "iPhone 6s Plus",
94
+ "Apple Watch",
95
+ "Alibaba",
96
+ "Taobao",
97
+ "Google",
98
+ "Alphabet",
99
+ "Apple",
100
+ "Microsoft",
101
+ "Yahoo",
102
+ "FPS",
103
+ "UI",
104
+ "URL",
105
+ "URI",
106
+ "URLs",
107
+ "URIs",
108
+ "Visual Studio Code"
109
+ ],
110
+ "code_blocks": false
111
+ }
112
112
  }
package/package.json CHANGED
@@ -1,7 +1,11 @@
1
1
  {
2
2
  "name": "@huangjunsen/markdownlint-config",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "main": "index.json",
5
+ "files": [
6
+ "index.json",
7
+ "README.md"
8
+ ],
5
9
  "description": "markdown文档规范",
6
10
  "keywords": [
7
11
  "encode",
@@ -9,16 +13,21 @@
9
13
  "lint"
10
14
  ],
11
15
  "author": "Huangjunsen <951434130@qq.com>",
12
- "homepage": "https://github.com/Huang-junsen/js-encode-fe-spec#readme",
16
+ "homepage": "https://huangjunsen0406.github.io/js-encode-fe-spec/packages/markdownlint-config.html",
13
17
  "license": "ISC",
14
- "dependencies": {
15
- "markdownlint": "^0.34.0"
18
+ "peerDependencies": {
19
+ "markdownlint": ">=0.25.0"
20
+ },
21
+ "peerDependenciesMeta": {
22
+ "markdownlint": {
23
+ "optional": true
24
+ }
16
25
  },
17
26
  "repository": {
18
27
  "type": "git",
19
- "url": "git+https://github.com/Huang-junsen/js-encode-fe-spec.git"
28
+ "url": "git+https://github.com/huangjunsen0406/js-encode-fe-spec.git"
20
29
  },
21
30
  "bugs": {
22
- "url": "https://github.com/Huang-junsen/js-encode-fe-spec/issues"
31
+ "url": "https://github.com/huangjunsen0406/js-encode-fe-spec/issues"
23
32
  }
24
33
  }