{"_id":"@boring-stack-pkg/eslint-plugin-cache-keys","_rev":"2-9018a94d78a7c7eac2a19f907783e376","name":"@boring-stack-pkg/eslint-plugin-cache-keys","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.1":{"name":"@boring-stack-pkg/eslint-plugin-cache-keys","version":"0.1.1","keywords":["eslint","eslintplugin","typescript","cache","redis","ttl"],"author":"","license":"MIT","_id":"@boring-stack-pkg/eslint-plugin-cache-keys@0.1.1","maintainers":[{"name":"agjs","email":"hi@aleksandar.xyz"}],"homepage":"https://github.com/AI-Starter-Templates/eslint-plugins#readme","bugs":{"url":"https://github.com/AI-Starter-Templates/eslint-plugins/issues"},"dist":{"shasum":"d5251655794f5d1092463b0a448306836ffc3931","tarball":"https://registry.npmjs.org/@boring-stack-pkg/eslint-plugin-cache-keys/-/eslint-plugin-cache-keys-0.1.1.tgz","fileCount":13,"integrity":"sha512-na4raplW0RIhKCQ/u5hbTduIQTSSuWQYpv+z2k8SPxP0oZ1xMoCvXu4dy8ZPPyDfrHyRZ/nIfySt2jht9yMVDw==","signatures":[{"sig":"MEQCIHrly7pFkl1wKvIUsYtwanQ2XOMCkNFFIJ6HSKTu5CCoAiAFBHch6iXIllC2iMAEWUIyDKI1U8Y0+i4vdq2M2hEPPQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@boring-stack-pkg%2feslint-plugin-cache-keys@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":37506},"main":"./dist/index.cjs","type":"module","_from":"file:boring-stack-pkg-eslint-plugin-cache-keys-0.1.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"scripts":{"test":"vitest run","build":"tsup src/index.ts --format esm,cjs --dts --clean","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"agjs","email":"hi@aleksandar.xyz"},"_resolved":"/tmp/9b54c6a7609812cb9f4a2722cdfaab5b/boring-stack-pkg-eslint-plugin-cache-keys-0.1.1.tgz","_integrity":"sha512-na4raplW0RIhKCQ/u5hbTduIQTSSuWQYpv+z2k8SPxP0oZ1xMoCvXu4dy8ZPPyDfrHyRZ/nIfySt2jht9yMVDw==","repository":{"url":"git+https://github.com/AI-Starter-Templates/eslint-plugins.git","type":"git","directory":"eslint-plugin-cache-keys"},"_npmVersion":"10.9.7","description":"ESLint rules preventing cache-layer bugs: missing TTLs, unprefixed keys that collide on shared Redis, and inline keys that bypass the helper layer.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","dependencies":{"@typescript-eslint/utils":"8.0.0"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"tsup":"8.0.0","eslint":"9.0.0","vitest":"2.0.0","@eslint/js":"9.0.0","typescript":"6.0.3","@types/node":"22.0.0","@typescript-eslint/parser":"8.0.0","@typescript-eslint/rule-tester":"8.0.0"},"peerDependencies":{"eslint":"8.57.0 || ^9.0.0","typescript":">=5.0.0","@typescript-eslint/parser":">=8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/eslint-plugin-cache-keys_0.1.1_1779219579752_0.33901940287543564","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@boring-stack-pkg/eslint-plugin-cache-keys","version":"0.1.2","description":"ESLint rules preventing cache-layer bugs: missing TTLs, unprefixed keys that collide on shared Redis, and inline keys that bypass the helper layer.","type":"module","license":"MIT","author":"","repository":{"type":"git","url":"git+https://github.com/boringstack-xyz/eslint-plugins.git","directory":"eslint-plugin-cache-keys"},"publishConfig":{"access":"public"},"sideEffects":false,"main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"keywords":["eslint","eslintplugin","typescript","cache","redis","ttl"],"peerDependencies":{"@typescript-eslint/parser":">=8.0.0","eslint":"8.57.0 || ^9.0.0","typescript":">=5.0.0"},"dependencies":{"@typescript-eslint/utils":"8.0.0"},"devDependencies":{"@eslint/js":"9.0.0","@types/node":"22.0.0","@typescript-eslint/parser":"8.0.0","@typescript-eslint/rule-tester":"8.0.0","eslint":"9.0.0","tsup":"8.0.0","typescript":"6.0.3","vitest":"2.0.0"},"scripts":{"build":"tsup src/index.ts --format esm,cjs --dts --clean","typecheck":"tsc --noEmit","test":"vitest run","test:watch":"vitest"},"_id":"@boring-stack-pkg/eslint-plugin-cache-keys@0.1.2","bugs":{"url":"https://github.com/boringstack-xyz/eslint-plugins/issues"},"homepage":"https://github.com/boringstack-xyz/eslint-plugins#readme","_integrity":"sha512-WBlEOhGetPLMwQPg/77KkkmHY76l5cecly76gV9853EIcuwzhyN0yNsYkqLew5Sat/K5qi1Qgz9ypYueufio9w==","_resolved":"/tmp/6ebf013e1e90157f34b967407ebd1711/boring-stack-pkg-eslint-plugin-cache-keys-0.1.2.tgz","_from":"file:boring-stack-pkg-eslint-plugin-cache-keys-0.1.2.tgz","_nodeVersion":"22.22.3","_npmVersion":"11.15.0","dist":{"integrity":"sha512-WBlEOhGetPLMwQPg/77KkkmHY76l5cecly76gV9853EIcuwzhyN0yNsYkqLew5Sat/K5qi1Qgz9ypYueufio9w==","shasum":"cb213833a182de458ca4594508b96ad23c299191","tarball":"https://registry.npmjs.org/@boring-stack-pkg/eslint-plugin-cache-keys/-/eslint-plugin-cache-keys-0.1.2.tgz","fileCount":13,"unpackedSize":37754,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICk8d+YBCiFTzuRkrLTLqgVRriD2GzsOVOtTAZIWwZWkAiEA3BxM6gkkkMhBIo7a/p93nywKlHzEr50QHB9n1GgRIC0="}]},"_npmUser":{"name":"agjs","email":"hi@aleksandar.xyz"},"directories":{},"maintainers":[{"name":"agjs","email":"hi@aleksandar.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/eslint-plugin-cache-keys_0.1.2_1779695633859_0.0007326121677351249"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-19T19:39:39.653Z","modified":"2026-05-25T07:53:54.180Z","0.1.1":"2026-05-19T19:39:39.894Z","0.1.2":"2026-05-25T07:53:54.024Z"},"bugs":{"url":"https://github.com/boringstack-xyz/eslint-plugins/issues"},"license":"MIT","homepage":"https://github.com/boringstack-xyz/eslint-plugins#readme","keywords":["eslint","eslintplugin","typescript","cache","redis","ttl"],"repository":{"type":"git","url":"git+https://github.com/boringstack-xyz/eslint-plugins.git","directory":"eslint-plugin-cache-keys"},"description":"ESLint rules preventing cache-layer bugs: missing TTLs, unprefixed keys that collide on shared Redis, and inline keys that bypass the helper layer.","maintainers":[{"name":"agjs","email":"hi@aleksandar.xyz"}],"readme":"# eslint-plugin-cache-keys\n\n[![npm](https://img.shields.io/npm/v/@boring-stack-pkg/eslint-plugin-cache-keys?logo=npm)](https://www.npmjs.com/package/@boring-stack-pkg/eslint-plugin-cache-keys) [![source](https://img.shields.io/badge/source-github-blue?logo=github)](https://github.com/boringstack-xyz/eslint-plugins/tree/main/eslint-plugin-cache-keys)\n\nESLint rules preventing the most common cache-layer bugs:\n\n- **`cache-set-must-have-ttl`** — cache writes without a TTL field\n  accumulate forever and OOM Redis.\n- **`cache-key-must-be-prefixed`** — cache keys must start with a\n  configured namespace prefix to prevent collisions when multiple apps\n  share a Redis instance.\n- **`cache-key-from-helper`** _(opt-in)_ — cache keys must come from a\n  configured helper function. Forces a single source of truth and makes\n  invalidation tractable across a codebase.\n\nThe recommended config enables rules 1 and 2 at `error`. Rule 3 is opt-in\nbecause it requires you to declare your project's key-builder helpers.\n\n## Install\n\n```sh\npnpm add -D @boring-stack-pkg/eslint-plugin-cache-keys\n```\n\nPeer deps: `eslint >= 8.57`, `@typescript-eslint/parser >= 8`,\n`typescript >= 5`.\n\n## Use (flat config)\n\n```js\nimport tsParser from \"@typescript-eslint/parser\";\nimport cacheKeys from \"@boring-stack-pkg/eslint-plugin-cache-keys\";\n\nexport default [\n  {\n    files: [\"**/*.{ts,tsx}\"],\n    languageOptions: { parser: tsParser },\n    plugins: { \"cache-keys\": cacheKeys },\n    rules: {\n      \"cache-keys/cache-set-must-have-ttl\": \"error\",\n      \"cache-keys/cache-key-must-be-prefixed\": \"error\",\n      \"cache-keys/cache-key-from-helper\": [\n        \"error\",\n        { helperNames: [\"userCacheKey\", \"stripeEventCacheKey\"] },\n      ],\n    },\n  },\n];\n```\n\nOr use the bundled config (rules 1–2 enabled, rule 3 off):\n\n```js\nimport cacheKeys from \"@boring-stack-pkg/eslint-plugin-cache-keys\";\n\nexport default [cacheKeys.configs.recommended];\n```\n\n## Rules\n\n| Rule                                                                     | Description                              | Default in recommended |\n| ------------------------------------------------------------------------ | ---------------------------------------- | ---------------------- |\n| [`cache-set-must-have-ttl`](docs/rules/cache-set-must-have-ttl.md)       | `.set` calls must include `ttlSeconds`   | `error`                |\n| [`cache-key-must-be-prefixed`](docs/rules/cache-key-must-be-prefixed.md) | Keys must start with a configured prefix | `error`                |\n| [`cache-key-from-helper`](docs/rules/cache-key-from-helper.md)           | Keys must be built by configured helpers | `off` (opt-in)         |\n\n## License\n\nMIT.\n","readmeFilename":"README.md"}