{"_id":"@dyyz1993/eslint-plugin-rpc","name":"@dyyz1993/eslint-plugin-rpc","dist-tags":{"latest":"1.1.0"},"versions":{"1.1.0":{"name":"@dyyz1993/eslint-plugin-rpc","version":"1.1.0","description":"ESLint rules enforcing @dyyz1993/rpc-core usage conventions","repository":{"type":"git","url":"git+https://github.com/dyyz1993/pi-agent-template.git","directory":"packages/eslint-plugin-rpc"},"main":"index.js","keywords":["eslint","eslintplugin","eslint-plugin","rpc"],"peerDependencies":{"eslint":">=8.0.0"},"engines":{"node":">=18"},"license":"MIT","scripts":{"test":"bun test tests/"},"_id":"@dyyz1993/eslint-plugin-rpc@1.1.0","bugs":{"url":"https://github.com/dyyz1993/pi-agent-template/issues"},"homepage":"https://github.com/dyyz1993/pi-agent-template#readme","_integrity":"sha512-oGzcxj7x256oXEiRK5DMt8KvxGLXHUBJCK0a9M/FznhlSecKQ82f+hiVYFTcAezv4OxcSPi/rO5CvGTpvo+dpg==","_resolved":"/private/var/folders/j9/bv0n54t96556fycmy511r2rc0000gn/T/aac554ea3b1c1f7b7c13b252c1cce41c/dyyz1993-eslint-plugin-rpc-1.1.0.tgz","_from":"file:dyyz1993-eslint-plugin-rpc-1.1.0.tgz","_nodeVersion":"25.2.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-oGzcxj7x256oXEiRK5DMt8KvxGLXHUBJCK0a9M/FznhlSecKQ82f+hiVYFTcAezv4OxcSPi/rO5CvGTpvo+dpg==","shasum":"e5b8d01f1e32d3d3a02beccf58fe83aeeb9ecf5e","tarball":"https://registry.npmjs.org/@dyyz1993/eslint-plugin-rpc/-/eslint-plugin-rpc-1.1.0.tgz","fileCount":12,"unpackedSize":29051,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDtTBydlinGjt24BIkehbnuK9AVUwtt10iAD4nGC+4CYAiBqpjNEZ/VXuGs+wwU7AAnOA3s1+75S46oIqYf+VoFz9Q=="}]},"_npmUser":{"name":"dyyz1993","email":"dyyz1993@qq.com"},"directories":{},"maintainers":[{"name":"dyyz1993","email":"dyyz1993@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/eslint-plugin-rpc_1.1.0_1788931839197_0.7322406008178324"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-09T05:30:39.033Z","1.1.0":"2026-09-09T05:30:39.340Z","modified":"2026-09-09T05:30:39.512Z"},"maintainers":[{"name":"dyyz1993","email":"dyyz1993@qq.com"}],"description":"ESLint rules enforcing @dyyz1993/rpc-core usage conventions","homepage":"https://github.com/dyyz1993/pi-agent-template#readme","keywords":["eslint","eslintplugin","eslint-plugin","rpc"],"repository":{"type":"git","url":"git+https://github.com/dyyz1993/pi-agent-template.git","directory":"packages/eslint-plugin-rpc"},"bugs":{"url":"https://github.com/dyyz1993/pi-agent-template/issues"},"license":"MIT","readme":"# @dyyz1993/eslint-plugin-rpc\n\nESLint rules enforcing the RPC conventions of\n[`@dyyz1993/rpc-core`](../rpc-core) in projects created from\n`@dyyz1993/create-agent`. The plugin is vendored into every template\n(`./eslint-plugin-rpc/index.js`) so generated projects work without an extra\nnpm dependency.\n\n## Usage (flat config)\n\n```js\n// eslint.config.mjs\nimport rpcPlugin from \"./eslint-plugin-rpc/index.js\";\n\nexport default tseslint.config(\n\t// ...\n\trpcPlugin.configs[\"flat/recommended\"]\n);\n```\n\n## Rules\n\n| Rule                           | Description                                                                               |\n| ------------------------------ | ----------------------------------------------------------------------------------------- |\n| `rpc/no-bare-method`           | `register/call/subscribe/emitEvent` 方法名必须使用 `module.action` 格式                   |\n| `rpc/no-direct-register`       | `server.register()` 只允许出现在 `shared/handlers/` 目录                                  |\n| `rpc/schema-merge-only`        | `rpc-schema.ts` 只允许 `extends` 合并，禁止直接定义方法（interface 和 type alias 都检查） |\n| `rpc/module-file-naming`       | `modules/` 下文件必须导出 `XxxMethods` 接口，方法/事件 key 必须以 `module.` 为前缀        |\n| `rpc/require-typed-register`   | 入口文件必须导入并调用 `registerAllHandlers`（支持别名导入）                              |\n| `rpc/require-api-client`       | `mainview/` 下禁止直接操作 WebSocket（含 `window.WebSocket`）或裸传输层 `.send()`         |\n| `rpc/no-hardcoded-strings`     | JSX 禁止硬编码英文字符串，提示走 i18n `t()`（`warn` 级别）                                |\n| `rpc/no-deep-relative-imports` | 禁止超过 2 层 `../` 的相对路径导入（含 `export ... from`），应使用 `@shared/*` 别名       |\n\n## Options\n\n```js\n// rpc/no-bare-method — which receiver names are treated as RPC entry points\n\"rpc/no-bare-method\": [\"error\", { objectNames: [\"apiClient\", \"server\"] }]\n\n// rpc/no-direct-register\n\"rpc/no-direct-register\": [\"error\", {\n  serverNames: [\"server\", \"rpcServer\"],\n  entryFiles: [\"bun/index.ts\", \"server.ts\"],\n  handlersDirs: [\"shared/handlers\"],\n}]\n\n// rpc/require-typed-register\n\"rpc/require-typed-register\": [\"error\", { entryFiles: [\"bun/index.ts\"] }]\n\n// rpc/require-api-client — exact variable names treated as raw transports\n\"rpc/require-api-client\": [\"error\", { transportNames: [\"ws\", \"websocket\", \"socket\"] }]\n\n// rpc/no-hardcoded-strings\n\"rpc/no-hardcoded-strings\": [\"warn\", {\n  ignoreAttributes: [\"className\", \"href\", /* ... */],\n  ignoreComponents: [\"Icon\", \"Panel\"],  // suppress everything inside these components\n  ignorePrefixes: [\"bg-\", \"https://\"],\n}]\n\n// rpc/no-deep-relative-imports\n\"rpc/no-deep-relative-imports\": [\"error\", { maxDepth: 2 }]\n```\n\n## Tests\n\n```bash\ncd packages/eslint-plugin-rpc\nbun test tests/\n```\n","readmeFilename":"README.md","_rev":"1-1b1802a4737dddfacab5cc0ed6b0e550"}