@violetflux/kerros 0.3.3 → 0.3.4
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 +4 -4
- package/README.zh-CN.md +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -286,7 +286,7 @@ Kerros uses the official `use-sync-external-store` shim for React 17 and prefers
|
|
|
286
286
|
|
|
287
287
|
## ESLint guardrails
|
|
288
288
|
|
|
289
|
-
Install the
|
|
289
|
+
Install the lightweight plugin for file-local Kerros conventions:
|
|
290
290
|
|
|
291
291
|
```sh
|
|
292
292
|
npm install --save-dev @violetflux/eslint-plugin-kerros @typescript-eslint/parser
|
|
@@ -295,12 +295,12 @@ npm install --save-dev @violetflux/eslint-plugin-kerros @typescript-eslint/parse
|
|
|
295
295
|
```js
|
|
296
296
|
import kerros from '@violetflux/eslint-plugin-kerros'
|
|
297
297
|
|
|
298
|
-
export default [kerros.configs.
|
|
298
|
+
export default [kerros.configs.recommended]
|
|
299
299
|
```
|
|
300
300
|
|
|
301
|
-
`
|
|
301
|
+
`recommended` is the plugin's only preset and does not enable TypeScript `projectService`. It recognizes direct `createStore` and `bindStore` imports, including local aliases and namespace imports, then checks the Store bindings and Hook calls created in the same file. Cross-file re-exports, wrappers, and imported Store Hooks are intentionally outside this lightweight boundary. See the [measured ESLint benchmark](https://github.com/violetflux/kerros/blob/main/benchmarks/eslint/RESULTS.md).
|
|
302
302
|
|
|
303
|
-
|
|
303
|
+
The six included rules cover factory scope, model and binding names, selector parameter names, whole-Store selectors, and broad access to file-local selector-free snapshots. The plugin favors bounded memory and predictable diagnostics over cross-file inference.
|
|
304
304
|
|
|
305
305
|
For maintainers, npm Trusted Publisher entries must be configured for both `@violetflux/kerros` and `@violetflux/eslint-plugin-kerros`. That npm-side configuration is the only release step outside this repository; CI checks and publishes the runtime first, then the plugin.
|
|
306
306
|
|
package/README.zh-CN.md
CHANGED
|
@@ -278,7 +278,7 @@ React 17 使用官方 `use-sync-external-store` shim;React 18 和 19 可用时
|
|
|
278
278
|
|
|
279
279
|
## ESLint 防护规则
|
|
280
280
|
|
|
281
|
-
|
|
281
|
+
建议安装轻量插件,检查当前文件内的 Kerros 约束:
|
|
282
282
|
|
|
283
283
|
```sh
|
|
284
284
|
npm install --save-dev @violetflux/eslint-plugin-kerros @typescript-eslint/parser
|
|
@@ -287,12 +287,12 @@ npm install --save-dev @violetflux/eslint-plugin-kerros @typescript-eslint/parse
|
|
|
287
287
|
```js
|
|
288
288
|
import kerros from '@violetflux/eslint-plugin-kerros'
|
|
289
289
|
|
|
290
|
-
export default [kerros.configs.
|
|
290
|
+
export default [kerros.configs.recommended]
|
|
291
291
|
```
|
|
292
292
|
|
|
293
|
-
`
|
|
293
|
+
`recommended` 是插件唯一的预设,不启用 TypeScript `projectService`。它识别直接导入的 `createStore`、`bindStore`、本地别名和 namespace 导入,并检查同一文件内生成的 Store 绑定与 Hook 调用。跨文件转导出、包装函数和从其他文件导入的 Store Hook 有意留在轻量边界之外。请参考[真实 ESLint 压测](https://github.com/violetflux/kerros/blob/main/benchmarks/eslint/RESULTS.md)。
|
|
294
294
|
|
|
295
|
-
|
|
295
|
+
预设包含六条规则,覆盖工厂作用域、Model 与绑定命名、selector 参数名、返回完整 Store,以及对当前文件无 selector 快照的宽泛访问。插件优先保证内存有界和诊断稳定,不追踪跨文件类型身份。
|
|
296
296
|
|
|
297
297
|
维护者还需要分别为 `@violetflux/kerros` 和 `@violetflux/eslint-plugin-kerros` 配置 npm Trusted Publisher。这是唯一的仓库外发布步骤;仓库内工作流会先检查并发布运行库,再发布插件。
|
|
298
298
|
|