@fast-china/eslint-config 2.0.5 → 2.0.6
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/CHANGELOG.md +8 -0
- package/CONTRIBUTING.md +62 -0
- package/README.md +19 -6
- package/README.zh.md +19 -6
- package/SECURITY.md +133 -0
- package/docs/engineering-audit.zh.md +2 -3
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,14 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
|
|
|
6
6
|
|
|
7
7
|
## Unreleased
|
|
8
8
|
|
|
9
|
+
## 2.0.6 - 2026-08-04
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- Standardized the bilingual README, repository ignores, editor settings, TypeScript checks, and tsdown output configuration across the Fast frontend SDK repositories.
|
|
14
|
+
- Simplified the test pipeline to runtime, type-contract, and package-contract verification by removing documentation- and comment-governance tests.
|
|
15
|
+
- Included contribution and security documents in the published package and refreshed the engineering guidance for the current workflow.
|
|
16
|
+
|
|
9
17
|
## 2.0.5 - 2026-08-02
|
|
10
18
|
|
|
11
19
|
### Changed
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thank you for improving `@fast-china/eslint-config`.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- A supported Node.js version from `package.json`
|
|
8
|
+
- pnpm `11.x`
|
|
9
|
+
|
|
10
|
+
## Local workflow
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
pnpm install
|
|
14
|
+
pnpm typegen
|
|
15
|
+
pnpm check
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Use `pnpm dev` to inspect the active Flat Config interactively while changing factories or rules.
|
|
19
|
+
|
|
20
|
+
Use `pnpm lint:fix` and `pnpm format` for safe mechanical fixes. `pnpm test` first rebuilds `dist`, then runs consumer type-contract, runtime integration, and package-contract suites. `pnpm check` is the same quality gate used by CI and adds source type-checking, full-repository linting, and formatting verification.
|
|
21
|
+
|
|
22
|
+
`src/typegen.d.ts` is generated from ESLint rule schemas and is part of the public type API. Run `pnpm typegen` after changing ESLint or plugin versions, inspect and commit the generated diff, and use `pnpm typegen:check` to verify it. Never edit the generated declaration manually.
|
|
23
|
+
|
|
24
|
+
## Changing rules or factory behavior
|
|
25
|
+
|
|
26
|
+
1. Keep correctness rules separate from formatting rules.
|
|
27
|
+
2. Scope every rule group with `files` unless it is intentionally global.
|
|
28
|
+
3. Register each plugin in a configuration that matches the same files as its rules.
|
|
29
|
+
4. Prefer upstream recommended configs before adding local overrides.
|
|
30
|
+
5. Keep organization-specific dependency restrictions out of this general-purpose package; projects should own those policies.
|
|
31
|
+
6. Explain the purpose, rationale, and important exception or risk immediately above every local rule override.
|
|
32
|
+
7. Mark disruptive defaults with `[高影响]`; verify `meta.fixable` before using `[可自动修复]`, and keep `docs/rules-risk.md` plus `docs/rules-risk.zh.md` synchronized.
|
|
33
|
+
8. Never sort a map whose key order has semantics, including conditional objects under `package.json#exports`.
|
|
34
|
+
9. Regenerate `src/typegen.d.ts` whenever ESLint or a bundled plugin changes; confirm new rules and changed option schemas intentionally.
|
|
35
|
+
10. Add or update an integration test for every parser, plugin, option, auto-fix, generated type, or public export change. The root API is intentionally limited to `fastConfig`, `defaultConfigOptions`, `defineRules`, and related types.
|
|
36
|
+
11. Document behavior changes in `CHANGELOG.md` and both README files.
|
|
37
|
+
|
|
38
|
+
## Pull requests
|
|
39
|
+
|
|
40
|
+
Keep changes focused and explain user-visible compatibility effects. Do not commit credentials or publish from a pull request. Changes to the Node.js, ESLint, TypeScript, Vue, React, Angular, Prettier, or module-format contract should be treated as release-significant changes.
|
|
41
|
+
|
|
42
|
+
## Releases
|
|
43
|
+
|
|
44
|
+
The package is ESM-only and publication is maintainer-controlled. Update `CHANGELOG.md` and `package.json`, commit the release state, then run:
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
pnpm check
|
|
48
|
+
pnpm pack --dry-run
|
|
49
|
+
pnpm publish --access public --registry https://registry.npmjs.org/
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
`prepack` reruns the complete quality gate before pnpm creates the publish archive. Inspect the dry-run list and verify that both root and `./rules` entry points contain JavaScript and declarations, together with the generated JavaScript and declaration source maps. After publication, verify the registry result and tag the exact commit:
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
pnpm view @fast-china/eslint-config version --registry https://registry.npmjs.org/
|
|
56
|
+
VERSION=$(node -p "require('./package.json').version")
|
|
57
|
+
git tag -a "v$VERSION" -m "release: v$VERSION"
|
|
58
|
+
git push origin master
|
|
59
|
+
git push origin "v$VERSION"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
npm versions are immutable; never reuse an already published version.
|
package/README.md
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="left">
|
|
2
|
+
<a href="./README.zh.md">简体中文</a> | <strong>English</strong>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<img src="./Fast.png" alt="logo" width="160" />
|
|
7
|
+
</p>
|
|
2
8
|
|
|
3
9
|
# @fast-china/eslint-config
|
|
4
10
|
|
|
5
11
|
A practical, typed ESLint Flat Config for Vue 3, React, Angular, Vite, TypeScript, and JavaScript projects.
|
|
6
12
|
|
|
7
|
-
[](https://www.npmjs.com/package/@fast-china/eslint-config)
|
|
8
|
-
[](./LICENSE)
|
|
13
|
+
[](https://www.npmjs.com/package/@fast-china/eslint-config) [](https://nodejs.org/) [](https://eslint.org/) [](./LICENSE)
|
|
9
14
|
|
|
10
15
|
## Highlights
|
|
11
16
|
|
|
@@ -334,18 +339,26 @@ pnpm exec prettier --check .
|
|
|
334
339
|
|
|
335
340
|
Set `prettier: false` if another formatter or stylistic rule set should remain fully in control.
|
|
336
341
|
|
|
342
|
+
## Documentation
|
|
343
|
+
|
|
344
|
+
- [Default rules and risk guide](./docs/rules-risk.md)
|
|
345
|
+
- [Engineering audit (Chinese)](./docs/engineering-audit.zh.md)
|
|
346
|
+
- [Contributing guide](./CONTRIBUTING.md)
|
|
347
|
+
- [Security policy](./SECURITY.md)
|
|
348
|
+
- [Changelog](./CHANGELOG.md)
|
|
349
|
+
|
|
337
350
|
## Development
|
|
338
351
|
|
|
339
352
|
```sh
|
|
340
|
-
pnpm install
|
|
353
|
+
pnpm install --frozen-lockfile
|
|
341
354
|
pnpm typegen
|
|
342
355
|
pnpm check
|
|
343
356
|
pnpm pack --dry-run
|
|
344
357
|
```
|
|
345
358
|
|
|
346
|
-
|
|
359
|
+
Use `pnpm dev` to inspect the active Flat Config interactively while changing factories or rules.
|
|
347
360
|
|
|
348
|
-
|
|
361
|
+
Run `pnpm typegen` after upgrading ESLint or a plugin and commit `src/typegen.d.ts`; never edit the generated file manually. `pnpm test` rebuilds the package before running consumer type-contract, runtime integration, and package-contract tests. `pnpm check` adds source type-checking, full-repository linting, and formatting verification.
|
|
349
362
|
|
|
350
363
|
## License
|
|
351
364
|
|
package/README.zh.md
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="left">
|
|
2
|
+
<strong>简体中文</strong> | <a href="./README.md">English</a>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<img src="./Fast.png" alt="logo" width="160" />
|
|
7
|
+
</p>
|
|
2
8
|
|
|
3
9
|
# @fast-china/eslint-config
|
|
4
10
|
|
|
5
11
|
面向 Vue 3、React、Angular、Vite、TypeScript 与 JavaScript 项目的实用型 ESLint Flat Config 规则库。
|
|
6
12
|
|
|
7
|
-
[](https://www.npmjs.com/package/@fast-china/eslint-config)
|
|
8
|
-
[](./LICENSE)
|
|
13
|
+
[](https://www.npmjs.com/package/@fast-china/eslint-config) [](https://nodejs.org/) [](https://eslint.org/) [](./LICENSE)
|
|
9
14
|
|
|
10
15
|
## 特性
|
|
11
16
|
|
|
@@ -334,18 +339,26 @@ pnpm exec prettier --check .
|
|
|
334
339
|
|
|
335
340
|
如果使用其他格式化工具,或希望保留完整的样式类 ESLint 规则,请设置 `prettier: false`。
|
|
336
341
|
|
|
342
|
+
## 文档
|
|
343
|
+
|
|
344
|
+
- [默认规则与风险指南](./docs/rules-risk.zh.md)
|
|
345
|
+
- [工程质量审查报告](./docs/engineering-audit.zh.md)
|
|
346
|
+
- [贡献指南](./CONTRIBUTING.md)
|
|
347
|
+
- [安全策略](./SECURITY.md)
|
|
348
|
+
- [更新日志](./CHANGELOG.md)
|
|
349
|
+
|
|
337
350
|
## 开发与贡献
|
|
338
351
|
|
|
339
352
|
```sh
|
|
340
|
-
pnpm install
|
|
353
|
+
pnpm install --frozen-lockfile
|
|
341
354
|
pnpm typegen
|
|
342
355
|
pnpm check
|
|
343
356
|
pnpm pack --dry-run
|
|
344
357
|
```
|
|
345
358
|
|
|
346
|
-
|
|
359
|
+
修改配置工厂或规则时,可使用 `pnpm dev` 交互检查实际生效的 Flat Config。
|
|
347
360
|
|
|
348
|
-
|
|
361
|
+
升级 ESLint 或插件后运行 `pnpm typegen` 并提交 `src/typegen.d.ts`;不要手工编辑生成文件。`pnpm test` 会先重新构建发布产物,再分别执行消费者类型契约、运行时集成和发布包契约测试。`pnpm check` 在此基础上增加源码类型检查、全仓 ESLint 和格式验证。
|
|
349
362
|
|
|
350
363
|
## 开源协议
|
|
351
364
|
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
[中文说明](#安全策略) | **English**
|
|
4
|
+
|
|
5
|
+
## Supported versions
|
|
6
|
+
|
|
7
|
+
Security fixes are provided for the latest release in the current major line.
|
|
8
|
+
Fixes are not backported to unsupported versions.
|
|
9
|
+
|
|
10
|
+
| Version | Supported |
|
|
11
|
+
| --------- | --------- |
|
|
12
|
+
| `2.0.6` | Yes |
|
|
13
|
+
| `< 2.0.6` | No |
|
|
14
|
+
|
|
15
|
+
## Reporting a vulnerability
|
|
16
|
+
|
|
17
|
+
Do not disclose a suspected vulnerability in a public Issue, Pull Request,
|
|
18
|
+
Discussion, or other public channel.
|
|
19
|
+
|
|
20
|
+
This project does not currently publish a dedicated security email address. To
|
|
21
|
+
request a private reporting channel, create a minimal issue in the
|
|
22
|
+
[Gitee issue tracker](https://gitee.com/FastDotnet/fast.eslint.config/issues/new)
|
|
23
|
+
with the title `[Security] Private report request`. Include only the affected
|
|
24
|
+
package version and a safe way for the maintainer to contact you. Do not include
|
|
25
|
+
technical details, proof-of-concept code, logs, attachments, credentials, or
|
|
26
|
+
other sensitive information in that issue.
|
|
27
|
+
|
|
28
|
+
After a private channel has been established, please provide:
|
|
29
|
+
|
|
30
|
+
- the affected package version and runtime environment;
|
|
31
|
+
- the vulnerability type and potential impact;
|
|
32
|
+
- the smallest reproducible example or proof of concept;
|
|
33
|
+
- the conditions required to reproduce the issue;
|
|
34
|
+
- any known workaround or suggested remediation; and
|
|
35
|
+
- your preferred disclosure timeline and attribution name, if any.
|
|
36
|
+
|
|
37
|
+
Never include real credentials, tokens, personal data, or third-party secrets
|
|
38
|
+
in a report or reproduction.
|
|
39
|
+
|
|
40
|
+
## Response and disclosure process
|
|
41
|
+
|
|
42
|
+
The maintainers aim to:
|
|
43
|
+
|
|
44
|
+
- acknowledge a report within 7 calendar days;
|
|
45
|
+
- provide an initial assessment within 14 calendar days; and
|
|
46
|
+
- send progress updates at least every 14 calendar days while remediation is in
|
|
47
|
+
progress.
|
|
48
|
+
|
|
49
|
+
These are response targets rather than guaranteed service-level commitments.
|
|
50
|
+
Validated reports will be handled through coordinated disclosure. Please avoid
|
|
51
|
+
public disclosure until a fixed release is available or another disclosure date
|
|
52
|
+
has been agreed upon. When appropriate, the fix will be accompanied by release
|
|
53
|
+
notes or a security advisory. Reporter attribution is optional and will follow
|
|
54
|
+
the reporter's preference.
|
|
55
|
+
|
|
56
|
+
## Scope
|
|
57
|
+
|
|
58
|
+
Examples of issues that may be security vulnerabilities include:
|
|
59
|
+
|
|
60
|
+
- unintended code execution while installing, importing, or running the
|
|
61
|
+
package;
|
|
62
|
+
- tampered or unexpected contents in a published package or release artifact;
|
|
63
|
+
- exposure of credentials or sensitive local project data caused by this
|
|
64
|
+
package; and
|
|
65
|
+
- a dependency or configuration weakness that is demonstrably exploitable
|
|
66
|
+
through this package.
|
|
67
|
+
|
|
68
|
+
The following are normally handled as regular bug reports:
|
|
69
|
+
|
|
70
|
+
- disagreements about rule defaults or formatting preferences;
|
|
71
|
+
- lint false positives or false negatives without a concrete security impact;
|
|
72
|
+
- issues that affect only unsupported versions; and
|
|
73
|
+
- vulnerabilities that exist solely in an upstream dependency and cannot be
|
|
74
|
+
exploited through this package.
|
|
75
|
+
|
|
76
|
+
When researching a potential vulnerability, act in good faith: avoid accessing
|
|
77
|
+
data that is not yours, degrading services, or disrupting other users.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## 安全策略
|
|
82
|
+
|
|
83
|
+
### 支持版本
|
|
84
|
+
|
|
85
|
+
安全修复仅面向当前主版本线中的最新发布版本,不会向已停止支持的版本回移植。
|
|
86
|
+
|
|
87
|
+
| 版本 | 是否支持 |
|
|
88
|
+
| --------- | -------- |
|
|
89
|
+
| `2.0.6` | 是 |
|
|
90
|
+
| `< 2.0.6` | 否 |
|
|
91
|
+
|
|
92
|
+
### 报告安全漏洞
|
|
93
|
+
|
|
94
|
+
请勿在公开的 Issue、Pull Request、讨论区或其他公开渠道中披露疑似漏洞的技术细节。
|
|
95
|
+
|
|
96
|
+
本项目目前没有公开专用的安全邮箱。如需建立私密报告渠道,请在
|
|
97
|
+
[Gitee Issue](https://gitee.com/FastDotnet/fast.eslint.config/issues/new)
|
|
98
|
+
中创建一个标题为 `[Security] Private report request` 的最小化 Issue。公开内容只能包含受影响的包版本,以及维护者可用于联系你的安全联系方式。请勿在该 Issue 中提交技术细节、概念验证代码、日志、附件、凭据或其他敏感信息。
|
|
99
|
+
|
|
100
|
+
建立私密渠道后,请尽量提供:
|
|
101
|
+
|
|
102
|
+
- 受影响的包版本和运行环境;
|
|
103
|
+
- 漏洞类型及潜在影响;
|
|
104
|
+
- 最小复现示例或概念验证;
|
|
105
|
+
- 复现所需的前置条件;
|
|
106
|
+
- 已知的临时规避方案或修复建议;
|
|
107
|
+
- 期望的披露时间,以及是否需要署名。
|
|
108
|
+
|
|
109
|
+
报告和复现内容中不得包含真实凭据、令牌、个人数据或第三方秘密信息。
|
|
110
|
+
|
|
111
|
+
### 响应与披露流程
|
|
112
|
+
|
|
113
|
+
维护者计划在 7 个自然日内确认收到报告,在 14 个自然日内给出初步评估;修复期间至少每 14 个自然日同步一次进展。这些时间是处理目标,不构成服务等级承诺。
|
|
114
|
+
|
|
115
|
+
确认有效的漏洞将采用协同披露流程。请在修复版本发布或双方约定的披露日期之前避免公开漏洞。必要时,修复版本会附带发布说明或安全公告。是否公开报告者署名,以报告者的意愿为准。
|
|
116
|
+
|
|
117
|
+
### 适用范围
|
|
118
|
+
|
|
119
|
+
以下问题可能属于安全漏洞:
|
|
120
|
+
|
|
121
|
+
- 安装、导入或运行本包时发生未预期的代码执行;
|
|
122
|
+
- npm 发布包或 Release 产物包含被篡改或未预期的内容;
|
|
123
|
+
- 本包导致凭据或本地项目敏感数据泄露;
|
|
124
|
+
- 依赖或配置缺陷能够通过本包被明确利用。
|
|
125
|
+
|
|
126
|
+
以下问题通常按普通 Bug 处理:
|
|
127
|
+
|
|
128
|
+
- 对默认规则或格式偏好的不同意见;
|
|
129
|
+
- 没有明确安全影响的误报或漏报;
|
|
130
|
+
- 仅影响已停止支持版本的问题;
|
|
131
|
+
- 仅存在于上游依赖、且无法通过本包利用的漏洞。
|
|
132
|
+
|
|
133
|
+
研究疑似漏洞时请遵循善意原则:不要访问不属于你的数据,不要降低服务可用性,也不要影响其他用户。
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
审查日期:2026-08-02
|
|
4
4
|
|
|
5
|
-
审查对象:`@fast-china/eslint-config` 2.0.
|
|
5
|
+
审查对象:`@fast-china/eslint-config` 2.0.6 工作区
|
|
6
6
|
|
|
7
7
|
## 结论
|
|
8
8
|
|
|
@@ -84,8 +84,7 @@ pnpm pack --dry-run
|
|
|
84
84
|
5. Prettier 格式检查。
|
|
85
85
|
6. 消费者类型契约测试。
|
|
86
86
|
7. 运行时配置集成测试。
|
|
87
|
-
8.
|
|
88
|
-
9. 发布元数据、入口文件和声明文件契约测试。
|
|
87
|
+
8. 发布元数据、入口文件和声明文件契约测试。
|
|
89
88
|
|
|
90
89
|
发布归档必须包含根入口和 `./configs`、`./constants`、`./rules` 子入口的 JavaScript 与声明文件,以及生成的 JavaScript、声明 source map;且不得包含源码缓存、测试缓存或本地依赖目录。
|
|
91
90
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fast-china/eslint-config",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.6",
|
|
4
4
|
"description": "Opinionated, typed ESLint Flat Config for Vue 3, React, Angular, Vite, TypeScript, JavaScript, and Node.js.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -27,10 +27,12 @@
|
|
|
27
27
|
"author": "小方",
|
|
28
28
|
"files": [
|
|
29
29
|
"CHANGELOG.md",
|
|
30
|
+
"CONTRIBUTING.md",
|
|
30
31
|
"Fast.png",
|
|
31
32
|
"LICENSE",
|
|
32
33
|
"README.md",
|
|
33
34
|
"README.zh.md",
|
|
35
|
+
"SECURITY.md",
|
|
34
36
|
"dist",
|
|
35
37
|
"docs"
|
|
36
38
|
],
|
|
@@ -75,10 +77,9 @@
|
|
|
75
77
|
"lint:fix": "eslint . --fix",
|
|
76
78
|
"format": "prettier --write .",
|
|
77
79
|
"format:check": "prettier --check .",
|
|
78
|
-
"test": "pnpm run build && pnpm run test:types && pnpm run test:runtime && pnpm run test:
|
|
80
|
+
"test": "pnpm run build && pnpm run test:types && pnpm run test:runtime && pnpm run test:package",
|
|
79
81
|
"test:types": "tsc --noEmit --project tests/tsconfig.json",
|
|
80
82
|
"test:runtime": "node --test tests/config.test.mjs",
|
|
81
|
-
"test:rules": "node --test tests/rules.test.mjs",
|
|
82
83
|
"test:package": "node --test tests/package.test.mjs",
|
|
83
84
|
"check": "pnpm run typecheck && pnpm run lint && pnpm run test && pnpm run format:check",
|
|
84
85
|
"prepack": "pnpm run check"
|