@ aurelienbn/ agentlint- 插件效果
3 Agentlint Results for Effect:Schema自有合同,有界回盘,层层已建成一次.
[尖叫声] 需要引擎
@aurelienbbn/agentlint>=0.3.0 <0.9.0作为同伴. 证据。 。 。 .
快开始
agentlint init --preset "@aurelienbbn/agentlint-plugin-effect#starterPreset"
agentlint rules test
agentlint rules scan --review
agentlint next --format json
init 保存已有的配置并打印安装命令;从未安装. 要求前校正绑定 agentlint check --all。 。 。 .
import { defineConfig } from "@aurelienbbn/agentlint";
import { layerIdentity, resiliencePolicy, strictPreset } from "@aurelienbbn/agentlint-plugin-effect";
export default defineConfig({ extends: [strictPreset], rules: [layerIdentity, resiliencePolicy] });
规则
| 规则 | 严格 | 启动 | 权力 | 标准折返 | 探测器 |
|---|---|---|---|---|---|
prefer-schema-contracts | ✅ | ✅ | 代理人 | 2个 | 2个 |
resilience-policy | 🧪 | 代理人 | 1个 | 1个 | |
layer-identity | 🧪 | 代理人 | 1个 | 1个 |
在预设中 \ \ 选入, 明确注册 。 预设忽略 **/*.d.ts。 。 。 .
export interface User {
id: string;
} // ❌ prefer-schema-contracts
export type User = (typeof User)["Type"]; // ✅ Schema-derived
Effect.tryPromise({ try: () => fetch(url), catch: toError }); // ❌ resilience-policy
Effect.tryPromise({ try: () => fetch(url), catch: toError }).pipe(Effect.timeout("2 seconds")); // ✅
const makeDbLayer = (config: DbConfig) => Layer.effect(Db, connect(config)); // ❌ layer-identity: new pool per call
const makeConfigLayer = (config: DbConfig) => Layer.succeed(Config, config); // ✅
prefer-schema-contracts:起火,无声拼写,来源
在导出接口和导出对象类型别名上起火,通过真实的解析器附加导出语句找到 。 内部编译时间界面和通用帮助者可能保持手动.
export type User = (typeof User)["Type"]; // ✅ silent
export type UserEncoded = typeof User.Encoded; // ✅ silent
export type User = Schema.Schema.Type<typeof User>; // ✅ silent
export type UserEncoded = Schema.Codec.Encoded<typeof User>; // ✅ silent
export interface User extends Schema.Schema.Type<typeof UserSchema> {} // ✅ silent
// also silent: typeof X["Encoded"], typeof X.Type
手动化名的修补:运行 @effect/tsgo是因为 typeToEffectSchema, (中文(简体) ), typeToEffectSchemaClass,或 structuralTypeToSchema (取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取.
拼写来源: 效果 4 Docs (effect/ai-docs/src/01_effect/02_schema/10_schema-basics.ts 内 [email protected])获得类型 typeof Contract["Type"] 编号 : typeof Contract["Encoded"]; 点和 Schema.Schema.Type<typeof Contract> 拼写也得到承认.
resilience-policy: 触发和选项
| 着火了 | 安静 |
|---|---|
每个 Effect.retry 编号 : Effect.retryOrElse 调用 | 测试文件 |
Effect.tryPromise, (中文(简体) ), HttpClient.get|post|put|patch|del|head|options|execute 电话 | 附加语句或函数显示超时或重试 |
request.pipe(Effect.retry(Schedule.exponential("100 millis"))); // ❌ fires: no bound
defineResiliencePolicy({ outboundCallPattern }) 替换输出的呼叫模式。 双胞胎 core/boundary-resilience。 。 。 .
layer-identity: 触发和沉默情况
层被引用来纪念:一个在两个组成地被召唤的工厂建造了两个池. 函数、箭头和方法起火返回 a Layer.* 表达式。 静曰: Layer.succeed, (中文(简体) ), Layer.empty, (中文(简体) ), Layer.fresh, (中文(简体) ), LayerMap 检查,测试文件。 法官点了整个仓库的呼叫站点.
const tenants = LayerMap.make((tenant: string) => Layer.effect(Db, connect(tenant))); // ✅ silent
Agentlint规则合同
| 事实 | 细节 |
|---|---|
| 规则形状 | lifecycle, (中文(简体) ), standard (订正), detector (版本), binding (id, 权威, 范围, 实质性选项) |
| 编译 | defineConfig({ extends: [preset] }) 或者说 defineConfig({ rules: [configuredRule] }); 重复使用需要不同的绑定标识 |
| 权力 | 默认允许代理接受;存储器所有者选择范围,并可以向 human |
| 接受结论 | 需要匹配当前证据 财务报告和审定财务报表 权力 |
| 固定装置 | @aurelienbbn/agentlint/testing 使用真实解析器运行嵌入式活性/静态固定装置 |
登记的合同库存
从软件包导出 pnpm catalog. 规则特定选项和限制在上文和源测试中都有描述.
| 规则/检查 | 触发或审查范围 |
|---|---|
layer-identity | 旗子函数返回新建的图层,所以调用站点会被审查重复的资源构建. |
prefer-schema-contracts | 旗子导出需要 Effect Schema 所有权的手工对象合同 . |
resilience-policy | Flags Effect. retrieving policy and outmext Effect 调用时没有显示超时,因此只能对约束、紧张、可重复的上游和一能性进行审查. |
贷项
starterPreset 登机:由Peter O'Malley拆卸而来的概念灵感;没有复制代码或指南.