@infra-x/create-eslint-config 0.1.2 → 0.1.3
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 +14 -0
- package/dist/template/README.md +2 -55
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# @infra-x/create-eslint-config
|
|
2
|
+
|
|
3
|
+
CLI 工具,将完整的 ESLint 配置模板复制到 monorepo 的 `eslint-config/` 目录。
|
|
4
|
+
|
|
5
|
+
## 使用
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm dlx @infra-x/create-eslint-config
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
在 monorepo 根目录执行,会将 `eslint-config/` 目录(含规则定义和 `composeConfig` 工厂函数)
|
|
12
|
+
复制到当前工作目录。如果目标路径存在冲突文件,会提示确认是否覆盖。
|
|
13
|
+
|
|
14
|
+
完整集成说明见[根目录 README](../../README.md)。
|
package/dist/template/README.md
CHANGED
|
@@ -1,56 +1,3 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @infra-x/eslint-config
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## 安装
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
pnpm add -D @workspace/eslint-config eslint prettier typescript
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## 使用
|
|
12
|
-
|
|
13
|
-
```typescript
|
|
14
|
-
// eslint.config.mts
|
|
15
|
-
import { composeConfig } from '@workspace/eslint-config'
|
|
16
|
-
|
|
17
|
-
export default composeConfig({
|
|
18
|
-
typescript: { tsconfigRootDir: import.meta.dirname },
|
|
19
|
-
react: true,
|
|
20
|
-
imports: { typescript: true },
|
|
21
|
-
prettier: true,
|
|
22
|
-
})
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## 配置项
|
|
26
|
-
|
|
27
|
-
### 默认开启
|
|
28
|
-
|
|
29
|
-
- `ignores` - 忽略文件配置
|
|
30
|
-
- `javascript` - JavaScript 基础规则
|
|
31
|
-
- `typescript` - TypeScript 规则
|
|
32
|
-
- `stylistic` - 代码风格规则
|
|
33
|
-
- `unicorn` - 最佳实践
|
|
34
|
-
- `depend` - 依赖优化建议
|
|
35
|
-
|
|
36
|
-
### 可选配置
|
|
37
|
-
|
|
38
|
-
- `react` - React 规则
|
|
39
|
-
- `nextjs` - Next.js 规则
|
|
40
|
-
- `imports` - Import 排序和规则
|
|
41
|
-
- `prettier` - Prettier 格式化
|
|
42
|
-
- `a11y` - 无障碍访问规则
|
|
43
|
-
- `jsdoc` - JSDoc 文档规则
|
|
44
|
-
- `boundaries` - 模块边界规则
|
|
45
|
-
- `packageJson` - package.json 规则
|
|
46
|
-
- `vitest` - Vitest 测试规则
|
|
47
|
-
- `storybook` - Storybook 规则
|
|
48
|
-
|
|
49
|
-
每个配置项支持:
|
|
50
|
-
- `true` - 使用默认配置
|
|
51
|
-
- `{ ...options }` - 自定义配置
|
|
52
|
-
- `false` - 禁用(仅限默认开启的配置)
|
|
53
|
-
|
|
54
|
-
## License
|
|
55
|
-
|
|
56
|
-
PROPRIETARY
|
|
3
|
+
共享 ESLint flat config 配置工厂。完整使用说明见[根目录 README](../../README.md)。
|