standards-cli 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.
- package/README.md +11 -8
- package/package.json +1 -1
- package/src/commands/init.js +2 -2
package/README.md
CHANGED
|
@@ -25,14 +25,17 @@ npx standards-cli init
|
|
|
25
25
|
### 方式二:作为项目依赖安装 - 推荐用于团队项目
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
|
-
#
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
npm
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
#
|
|
35
|
-
|
|
28
|
+
# bun
|
|
29
|
+
bun add standards-cli
|
|
30
|
+
|
|
31
|
+
# npm
|
|
32
|
+
npm install standards-cli
|
|
33
|
+
|
|
34
|
+
# pnpm
|
|
35
|
+
pnpm add standards-cli
|
|
36
|
+
|
|
37
|
+
# yarn
|
|
38
|
+
yarn add standards-cli
|
|
36
39
|
```
|
|
37
40
|
|
|
38
41
|
安装后,通过 npm scripts 或 pnpm exec 运行:
|
package/package.json
CHANGED
package/src/commands/init.js
CHANGED
|
@@ -136,8 +136,8 @@ async function generateConfigFiles(pkg) {
|
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
// .lintstagedrc.cjs - 根据是否有 eslint/prettier 选择模板
|
|
139
|
-
const
|
|
140
|
-
const lintstagedTemplate =
|
|
139
|
+
const hasLintToolsInstalled = hasLintTools(pkg);
|
|
140
|
+
const lintstagedTemplate = hasLintToolsInstalled
|
|
141
141
|
? "require('standards-cli/templates/lint-staged/config.cjs')"
|
|
142
142
|
: "require('standards-cli/templates/lint-staged/config-simple.cjs')";
|
|
143
143
|
const lintstagedrcCreated = await writeFileIfMissing(
|