@aranlucas/oxlint-plugin-反斜坡
意见 氧化剂 规则拒绝低证据 TypeScript 和 JavaScript 模式,为 npm 包装.
这是出版的叉子 dmmulroy/反斜坡。上游意在复制到每个仓库。 这个软件包将同样的规则编译为JavaScript,这样每个repo就可以安装一个版本的依赖性. 见 (原始内容存档于2012-10-12). UPSTREAM.md 上层的承诺和当地的变化。 规则文件和实例载于 上游读取。 。 。 .
安装
pnpm add -D oxlint @aranlucas/oxlint-plugin-anti-slop
要求数 oxlint 1.78或更新和节点22.18或更新.
配置
.oxlintrc.json数字 :
{
"jsPlugins": [{ "name": "anti-slop", "specifier": "@aranlucas/oxlint-plugin-anti-slop" }],
"rules": {
"oxc/no-accumulating-spread": "error",
"anti-slop/no-array-filter-map": "error",
"anti-slop/no-reduce-accumulator-copy": "error",
"anti-slop/no-chained-type-assertions": "error",
"anti-slop/no-conditional-empty-object-spread": "error",
"anti-slop/no-known-value-widening": "error",
"anti-slop/no-module-mocking": "error",
"anti-slop/no-object-parameters": "error",
"anti-slop/no-reflect-apply": "error",
"anti-slop/no-reflect-get": "error",
"anti-slop/no-runtime-typeof": "error",
"anti-slop/no-shape-in-symbol-names": "error",
"anti-slop/no-unknown-parameters": "error",
"anti-slop/no-unknown-returns": "error",
"anti-slop/no-unknown-type-aliases": "error",
"anti-slop/no-unsafe-dictionary-type": "error",
"anti-slop/no-widen-then-assert": "error",
"anti-slop/require-readable-spacing": "error",
"anti-slop/require-safety-comment-for-type-assertion": "error",
},
}
一样 jsPlugins 财务报告和审定财务报表 rules 下潜 lint 在一个 oxlint.config.ts 或作Vite+配置.
require-readable-spacing 将连续的单行装订放在任何范围内,包括出口装订。 带有自己领先评论的绑定开始一个新的组. 多行绑定和控制-流边界接收空白行;已存在的空白行被保留.
ESLint 语录
插件被包起来 eslintCompatPlugin,因此它们也会装入ESLint平面配置:
import antiSlop from "@aranlucas/oxlint-plugin-anti-slop";
export default [
{ plugins: { "anti-slop": antiSlop }, rules: { "anti-slop/no-reflect-get": "error" } },
];
开发
pnpm install
pnpm check # lint, typecheck, Vitest/RuleTester suites, build, dist smoke test
释放
弹出 version 内 package.json,然后创建标记的 GitHub 释放 vX.Y.Z。发布工作流程以出处发布到 npm.
许可证
麻省理工学院. 原始规则 狄伦·穆罗伊 销售商ESLint Stylistic 代码将自己的执照保存在 src/vendor/eslint-stylistic/LICENSE。 。 。 .
测试通过维特. pnpm test:watch 在开发期间重新运行规则测试器和本地CLI案例; pnpm test:dist 继续单独检查编译的软件包.