{"_id":"@boring-stack-pkg/eslint-plugin-structured-logging","_rev":"2-f25a5c20e2cff00697e7e49b8a64211e","name":"@boring-stack-pkg/eslint-plugin-structured-logging","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.1":{"name":"@boring-stack-pkg/eslint-plugin-structured-logging","version":"0.1.1","keywords":["eslint","eslintplugin","typescript","logging","structured-logging","pii","observability"],"author":"","license":"MIT","_id":"@boring-stack-pkg/eslint-plugin-structured-logging@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":"0a50d82b25ee223c79e980fca450d109e3db17af","tarball":"https://registry.npmjs.org/@boring-stack-pkg/eslint-plugin-structured-logging/-/eslint-plugin-structured-logging-0.1.1.tgz","fileCount":13,"integrity":"sha512-9aZ3GEqAozaLDRwJDtvH3fFdml4xg/oH0xKz0d+y5bI208TDuXlelL3aMMpr2Sc23oiRZK/8jgKJ5QgOBcmnqA==","signatures":[{"sig":"MEUCIQDsqukmdgmIgtQjxuLgrg3RKHqvwAWgXIW88O5ws1inUwIgbUqx7g0b/wLBCdwg5q4jF8HgSaEgEAFrjsdiZNaBWh0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@boring-stack-pkg%2feslint-plugin-structured-logging@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":62636},"main":"./dist/index.cjs","type":"module","_from":"file:boring-stack-pkg-eslint-plugin-structured-logging-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/fc82be38a4d8a9da96a9f4365f40523b/boring-stack-pkg-eslint-plugin-structured-logging-0.1.1.tgz","_integrity":"sha512-9aZ3GEqAozaLDRwJDtvH3fFdml4xg/oH0xKz0d+y5bI208TDuXlelL3aMMpr2Sc23oiRZK/8jgKJ5QgOBcmnqA==","repository":{"url":"git+https://github.com/AI-Starter-Templates/eslint-plugins.git","type":"git","directory":"eslint-plugin-structured-logging"},"_npmVersion":"10.9.7","description":"ESLint rules that enforce structured logging conventions: required event fields, masked PII in log payloads, and no stringified errors.","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-structured-logging_0.1.1_1779219600662_0.7341044440829165","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@boring-stack-pkg/eslint-plugin-structured-logging","version":"0.1.2","description":"ESLint rules that enforce structured logging conventions: required event fields, masked PII in log payloads, and no stringified errors.","type":"module","license":"MIT","author":"","repository":{"type":"git","url":"git+https://github.com/boringstack-xyz/eslint-plugins.git","directory":"eslint-plugin-structured-logging"},"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","logging","structured-logging","pii","observability"],"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-structured-logging@0.1.2","bugs":{"url":"https://github.com/boringstack-xyz/eslint-plugins/issues"},"homepage":"https://github.com/boringstack-xyz/eslint-plugins#readme","_integrity":"sha512-P9MuL88AUsHzqLWJ1bmiyJojv8kejXn8GlkDE79cwY8nN/fODU6/ZwrIWsH4kRw2LH2E+4p1NBhat/OJO8mkzw==","_resolved":"/tmp/a6b2c8f7dda6e98565637714ee5dbe96/boring-stack-pkg-eslint-plugin-structured-logging-0.1.2.tgz","_from":"file:boring-stack-pkg-eslint-plugin-structured-logging-0.1.2.tgz","_nodeVersion":"22.22.3","_npmVersion":"11.15.0","dist":{"integrity":"sha512-P9MuL88AUsHzqLWJ1bmiyJojv8kejXn8GlkDE79cwY8nN/fODU6/ZwrIWsH4kRw2LH2E+4p1NBhat/OJO8mkzw==","shasum":"d70d8c7fede169dfb046fbc7c15e7842475ec622","tarball":"https://registry.npmjs.org/@boring-stack-pkg/eslint-plugin-structured-logging/-/eslint-plugin-structured-logging-0.1.2.tgz","fileCount":13,"unpackedSize":63010,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCrPW/QI6a2S0pIMSqoCI0MCnEnqb/xaIraZzQCPHxz2gIgEoUqgg53nJIgjquA/JfwSfqm247lBTxw0/yGINPeiGo="}]},"_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-structured-logging_0.1.2_1779695646880_0.11634903029089672"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-19T19:40:00.196Z","modified":"2026-05-25T07:54:07.175Z","0.1.1":"2026-05-19T19:40:00.810Z","0.1.2":"2026-05-25T07:54:07.017Z"},"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","logging","structured-logging","pii","observability"],"repository":{"type":"git","url":"git+https://github.com/boringstack-xyz/eslint-plugins.git","directory":"eslint-plugin-structured-logging"},"description":"ESLint rules that enforce structured logging conventions: required event fields, masked PII in log payloads, and no stringified errors.","maintainers":[{"name":"agjs","email":"hi@aleksandar.xyz"}],"readme":"# eslint-plugin-structured-logging\n\n[![npm](https://img.shields.io/npm/v/@boring-stack-pkg/eslint-plugin-structured-logging?logo=npm)](https://www.npmjs.com/package/@boring-stack-pkg/eslint-plugin-structured-logging) [![source](https://img.shields.io/badge/source-github-blue?logo=github)](https://github.com/boringstack-xyz/eslint-plugins/tree/main/eslint-plugin-structured-logging)\n\nESLint rules that enforce structured-logging discipline:\n\n- **`require-event-field`** — every logger call carries a stable `event:`\n  identifier so log search isn't substring-matching.\n- **`mask-pii-fields`** — emails, tokens, passwords, etc. must be masked\n  before they hit the logger.\n- **`no-error-stringify`** — never `String(error)` / `${error}` /\n  `error.toString()`; use a configured extractor (default `getErrorMessage`)\n  that preserves the cause chain.\n\nAll three rules treat any call to a name in `loggerNames` (default\n`logger`, `log`, `reqLogger`, `requestLogger`) on a method in `loggerMethods`\n(default `fatal`/`error`/`warn`/`info`/`debug`/`trace`) as a logger call.\n\n## Install\n\n```sh\npnpm add -D @boring-stack-pkg/eslint-plugin-structured-logging\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 structuredLogging from \"@boring-stack-pkg/eslint-plugin-structured-logging\";\n\nexport default [\n  {\n    files: [\"**/*.{ts,tsx}\"],\n    languageOptions: { parser: tsParser },\n    plugins: { \"structured-logging\": structuredLogging },\n    rules: {\n      \"structured-logging/require-event-field\": \"error\",\n      \"structured-logging/mask-pii-fields\": \"error\",\n      \"structured-logging/no-error-stringify\": \"error\",\n    },\n  },\n];\n```\n\nOr use the bundled config:\n\n```js\nimport structuredLogging from \"@boring-stack-pkg/eslint-plugin-structured-logging\";\n\nexport default [structuredLogging.configs.recommended];\n```\n\n## Rules\n\n| Rule                                                       | Description                                                | Fixable                          |\n| ---------------------------------------------------------- | ---------------------------------------------------------- | -------------------------------- |\n| [`require-event-field`](docs/rules/require-event-field.md) | Require `event:` in logger payloads                        | –                                |\n| [`mask-pii-fields`](docs/rules/mask-pii-fields.md)         | Disallow unmasked PII                                      | –                                |\n| [`no-error-stringify`](docs/rules/no-error-stringify.md)   | Disallow `String(error)` / `${error}` / `error.toString()` | yes (when extractor is imported) |\n\n## License\n\nMIT.\n","readmeFilename":"README.md"}