@deslop/coding-standards

中文文档
0.1.1214发布于 2026/11/01ES Module构建来源已验证

A syntax-only Vite+ lint preset, a strict compiler configuration with Effect diagnostics, and three skills for Claude Code and Codex: lint-companion, pull-requests and review. Installing over a release that shipped writing-code leaves that directo

原始使用文档

@deslop/coding-standards

A syntax-only Vite+ lint preset, a strict compiler configuration with Effect diagnostics, and three skills for Claude Code and Codex: lint-companion, pull-requests and review. Installing over a release that shipped writing-code leaves that directory behind; delete it.

Vite+ owns syntax linting and plugin authoring APIs; Effect-patched tsrs owns compiler diagnostics.

vpx @deslop/coding-standards@latest
vp add -D @deslop/coding-standards@latest @effect/tsgo@latest tsrs@latest
import {defineConfig} from 'vite-plus'

import {lint} from '@deslop/coding-standards'

export default defineConfig({lint: {extends: [lint]}})
// package.json
{
    "scripts": {
        "prepare": "effect-tsgo patch --no-typescript --tsrs",
        "typecheck": "tsrs --noEmit --checkerAssignment go",
        "check": "vp check && vp run typecheck"
    }
}
// tsconfig.json
{"extends": "@deslop/coding-standards/tsconfig.json"}
  • Project settings go beside extends; the preset ignores nothing, so add **/*.gen.ts to your own ignores.
  • Native rules by name, every category off: tool upgrades opt into nothing. Deslop rules come from the local plugin registry, with no second list of names. Native rules own what they can express; custom rules cover the remaining Effect and React contracts.
  • Syntax only. typescript plugin rules such as no-explicit-any, consistent-type-imports and method-signature-style need no type information; typeAware: false disables inferred-type rules such as no-floating-promises; typeCheck: false leaves compiler errors to the Effect-patched tsrs check.

Collection performance

no-accumulating-copy checks inline Effect Array.reduce/reduceRight callbacks, including captured accumulator reads in nested callbacks:

-Array.reduce(items, [], (all, item) => [...all, transform(item)])
+Array.map(items, transform)
  • Also flags Effect array append/prepend, Record.set and computed-key record spreads.
  • Instead: Array.mapAccum for stateful selection; MutableList/MutableHashMap for local collectors.
  • Valid: scalar folds, persistent HashMap.set, noncomputed object-property updates.
  • Intentional snapshots, bounded windows or bounded key sets take a reasoned inline disable; the rule infers no growth and rewrites nothing.
  • Array.contains is structural; for identity use Array.containsWith(Equivalence.strictEqual()), since a syntax-only preset can't infer the intended equality.

版本与发布记录

@deslop/coding-standards 共发布 129 个版本,首次发布于 2026/10/03;过去 12 个月发布了 129 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.1.1214latest2026/11/012 天前
0.1.12132026/11/012 天前
0.1.12122026/11/012 天前
0.1.12112026/10/312 天前
0.1.12102026/10/312 天前
0.1.12092026/10/312 天前

关于 @deslop/coding-standards 的常见问题

@deslop/coding-standards 是什么?

仅语法的Vite+ lint预设,具有Effect诊断的严格编译器配置,以及Claude Code和Codex的三个技能: lint-companion, pull-requests 和 review. 在已发布的版本上安装 writing-code 直接离开

如何安装 @deslop/coding-standards?

在项目目录运行 npm install @deslop/coding-standards,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:vite-plus(^1.3)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。它还提供命令行工具 deslop-coding-standards,可以用 npx deslop-coding-standards 直接运行。

@deslop/coding-standards 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/deslop__coding-standards 是否存在。

@deslop/coding-standards 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@deslop/coding-standards 可以商用吗?

@deslop/coding-standards 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@deslop/coding-standards 还在维护吗?

最新版本 0.1.1214 发布于 2026/11/01(2 天前);至今共发布 129 个版本,其中过去 12 个月发布了 129 个;首次发布于 2026/10/03。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。