{"_id":"oxlint-json-to-sarif","_rev":"3-48cd5b61abc229f4718cf701abf1f742","name":"oxlint-json-to-sarif","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"oxlint-json-to-sarif","version":"0.1.0","keywords":["converter","lint","oxlint","oxc","sarif","static-analysis"],"author":{"name":"TonyRL"},"license":"MIT","_id":"oxlint-json-to-sarif@0.1.0","maintainers":[{"name":"tonyrl","email":"tony_lao+npmjs@outlook.com"}],"homepage":"https://github.com/TonyRL/oxlint-json-to-sarif#readme","bugs":{"url":"https://github.com/TonyRL/oxlint-json-to-sarif/issues"},"bin":{"oxlint-json-to-sarif":"dist/cli.js"},"dist":{"shasum":"657324df3374cef1c65e6887dde61fe967be4d54","tarball":"https://registry.npmjs.org/oxlint-json-to-sarif/-/oxlint-json-to-sarif-0.1.0.tgz","fileCount":6,"integrity":"sha512-/NbJW4cSapZP0ezHNfOt032T4XHSIsHp2cPM7dAJ6tO5BbC7gl7V9u2+2cxzEpAZ+RyfWp/Jm3uc/azTiVAXFw==","signatures":[{"sig":"MEYCIQChXZv4R8YA5g1FSmDS1Uu9Jm8lz2YlE9kGimgDr3wtNQIhAJP2l7OP2RZM61Ai64KQmuKQm8PFi7q8VhkAL4zDVmuP","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":91465},"main":"./dist/index.js","type":"module","_from":"file:oxlint-json-to-sarif-0.1.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=22"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"tsdown --watch","fmt":"oxfmt","lint":"oxlint --type-aware","test":"vitest run","build":"tsdown","lint:fix":"oxlint --type-aware --fix","fmt:check":"oxfmt --check","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"tonyrl","email":"tony_lao+npmjs@outlook.com"},"_resolved":"/tmp/59e53befba59691a262c897b6b3eec4b/oxlint-json-to-sarif-0.1.0.tgz","_integrity":"sha512-/NbJW4cSapZP0ezHNfOt032T4XHSIsHp2cPM7dAJ6tO5BbC7gl7V9u2+2cxzEpAZ+RyfWp/Jm3uc/azTiVAXFw==","repository":{"url":"git+https://github.com/TonyRL/oxlint-json-to-sarif.git","type":"git"},"_npmVersion":"11.8.0","description":"Convert oxlint JSON output to SARIF","directories":{},"_nodeVersion":"24.13.1","dependencies":{"commander":"^14.0.3","node-sarif-builder":"^3.4.0"},"_hasShrinkwrap":false,"devDependencies":{"oxfmt":"^0.35.0","oxlint":"^1.50.0","tsdown":"^0.20.3","vitest":"^4.0.18","typescript":"^5.7.3","@types/node":"^25.3.0","@types/sarif":"^2.1.7","oxlint-tsgolint":"^0.15.0","@vitest/coverage-v8":"^4.0.18"},"_npmOperationalInternal":{"tmp":"tmp/oxlint-json-to-sarif_0.1.0_1772255738203_0.12796887124961076","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"oxlint-json-to-sarif","version":"0.2.0","keywords":["converter","lint","oxlint","oxc","sarif","static-analysis"],"author":{"name":"TonyRL"},"license":"MIT","_id":"oxlint-json-to-sarif@0.2.0","maintainers":[{"name":"tonyrl","email":"tony_lao+npmjs@outlook.com"}],"homepage":"https://github.com/TonyRL/oxlint-json-to-sarif#readme","bugs":{"url":"https://github.com/TonyRL/oxlint-json-to-sarif/issues"},"bin":{"oxlint-json-to-sarif":"dist/cli.js"},"dist":{"shasum":"37c73514da1c15a0e0558d1d3c40c95ba4999254","tarball":"https://registry.npmjs.org/oxlint-json-to-sarif/-/oxlint-json-to-sarif-0.2.0.tgz","fileCount":6,"integrity":"sha512-pQolnGy0hxeHdeqmEcxAhSVZgtlFjIN9Z0KG59AI5ckvyoMAjoosD/mSKJBbtInEB8cyOdx2HDtf8yERqCIkKw==","signatures":[{"sig":"MEYCIQDbwfnpR5CQAC1bC1cIID/BH/56zmqn4qzHuxHKVE0NaAIhAMhDcepisMLX9GVG5gIiKL+21WUdaVLPWLlPuc3rz63t","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/oxlint-json-to-sarif@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":93573},"main":"./dist/index.js","type":"module","_from":"file:oxlint-json-to-sarif-0.2.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=22"},"exports":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"scripts":{"dev":"tsdown --watch","fmt":"oxfmt","lint":"oxlint --type-aware","test":"vitest run","build":"tsdown","lint:fix":"oxlint --type-aware --fix","fmt:check":"oxfmt --check","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:ab53034d-3ad7-4b74-8dea-aa6fd9e17fe7"}},"_resolved":"/tmp/8acfbdc2be451791233ebe71f4a26b8c/oxlint-json-to-sarif-0.2.0.tgz","_integrity":"sha512-pQolnGy0hxeHdeqmEcxAhSVZgtlFjIN9Z0KG59AI5ckvyoMAjoosD/mSKJBbtInEB8cyOdx2HDtf8yERqCIkKw==","repository":{"url":"git+https://github.com/TonyRL/oxlint-json-to-sarif.git","type":"git"},"_npmVersion":"11.11.0","description":"Convert oxlint JSON output to SARIF","directories":{},"_nodeVersion":"24.14.1","dependencies":{"commander":"^14.0.3","node-sarif-builder":"^4.0.0"},"_hasShrinkwrap":false,"devDependencies":{"oxfmt":"^0.43.0","oxlint":"^1.58.0","tsdown":"^0.21.7","vitest":"^4.1.2","typescript":"^6.0.2","@types/node":"^25.5.0","@types/sarif":"^2.1.7","oxlint-tsgolint":"^0.19.0","@vitest/coverage-v8":"^4.1.2"},"_npmOperationalInternal":{"tmp":"tmp/oxlint-json-to-sarif_0.2.0_1775043646002_0.17819458091882212","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"_id":"oxlint-json-to-sarif@0.3.0","bin":{"oxlint-json-to-sarif":"dist/cli.js"},"bugs":{"url":"https://github.com/TonyRL/oxlint-json-to-sarif/issues"},"dist":{"shasum":"39069ad858b454cccc9eb05b59c422248fec8a01","tarball":"https://registry.npmjs.org/oxlint-json-to-sarif/-/oxlint-json-to-sarif-0.3.0.tgz","fileCount":6,"integrity":"sha512-zJEnfOcfvM8O5GMY3I4R0qOp5ZbnnniaX8ec85oGWfdSUr2/70MCymm+JgCiBXqJvUPsVt/V6nZ5kCjBD0KLIA==","signatures":[{"sig":"MEQCIBRKdmwosmlWeFEguotNG1IwyoJaziQ3s5+8fiyGi/U7AiAeRlntL+zqDF2J3NsBdTTWcAezN4Y8z2YRWHH5zmr9gA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFtnfDc0jWT5eeA0mfEHBQrq1VL5BkmuH3l5B47c9rrpAiB3aUblzWQjE6TMyKUgBzhB/FsOTwufHaSbf8eFmTjitg=="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/oxlint-json-to-sarif@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":93782},"main":"./dist/index.js","name":"oxlint-json-to-sarif","type":"module","_from":"file:oxlint-json-to-sarif-0.3.0.tgz","types":"./dist/index.d.ts","author":{"name":"TonyRL"},"module":"./dist/index.js","engines":{"node":">=22"},"exports":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"license":"MIT","scripts":{"dev":"tsdown --watch","fmt":"oxfmt","lint":"oxlint --type-aware","test":"vitest run","build":"tsdown","lint:fix":"oxlint --type-aware --fix","fmt:check":"oxfmt --check","test:watch":"vitest","test:coverage":"vitest run --coverage"},"version":"0.3.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:ab53034d-3ad7-4b74-8dea-aa6fd9e17fe7"}},"homepage":"https://github.com/TonyRL/oxlint-json-to-sarif#readme","keywords":["converter","lint","oxlint","oxc","sarif","static-analysis"],"_resolved":"/tmp/386897d66697d22b403ddc21467c23c6/oxlint-json-to-sarif-0.3.0.tgz","_integrity":"sha512-zJEnfOcfvM8O5GMY3I4R0qOp5ZbnnniaX8ec85oGWfdSUr2/70MCymm+JgCiBXqJvUPsVt/V6nZ5kCjBD0KLIA==","repository":{"url":"git+https://github.com/TonyRL/oxlint-json-to-sarif.git","type":"git"},"_npmVersion":"11.17.0","description":"Convert oxlint JSON output to SARIF","directories":{},"maintainers":[{"name":"tonyrl","email":"tony_lao+npmjs@outlook.com"}],"_nodeVersion":"24.19.0","dependencies":{"commander":"^15.0.0","node-sarif-builder":"^5.0.0"},"_hasShrinkwrap":false,"devDependencies":{"oxfmt":"^0.64.0","oxlint":"^1.58.0","tsdown":"^0.22.0","vitest":"^4.1.2","typescript":"^7.0.2","@types/node":"^26.0.0","@types/sarif":"^2.1.7","oxlint-tsgolint":"^7.0.2001","@vitest/coverage-v8":"^4.1.2"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/oxlint-json-to-sarif_0.3.0_1787411794702_0.05752165960455358"}}},"time":{"created":"2026-02-28T05:15:38.202Z","modified":"2026-08-22T15:16:35.234Z","0.1.0":"2026-02-28T05:15:38.358Z","0.2.0":"2026-04-01T11:40:46.148Z","0.3.0":"2026-08-22T15:16:34.865Z"},"bugs":{"url":"https://github.com/TonyRL/oxlint-json-to-sarif/issues"},"author":{"name":"TonyRL"},"license":"MIT","homepage":"https://github.com/TonyRL/oxlint-json-to-sarif#readme","keywords":["converter","lint","oxlint","oxc","sarif","static-analysis"],"repository":{"url":"git+https://github.com/TonyRL/oxlint-json-to-sarif.git","type":"git"},"description":"Convert oxlint JSON output to SARIF","maintainers":[{"name":"tonyrl","email":"tony_lao+npmjs@outlook.com"}],"readme":"# oxlint-json-to-sarif\n\n[![npm version](https://img.shields.io/npm/v/oxlint-json-to-sarif?style=flat-square)](https://www.npmjs.com/package/oxlint-json-to-sarif)\n[![npm downloads](https://img.shields.io/npm/dw/oxlint-json-to-sarif?style=flat-square)](https://www.npmjs.com/package/oxlint-json-to-sarif)\n[![CI](https://img.shields.io/github/actions/workflow/status/TonyRL/oxlint-json-to-sarif/ci.yml?style=flat-square)](https://github.com/TonyRL/oxlint-json-to-sarif/actions/workflows/ci.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)\n\nConvert oxlint JSON output to Static Analysis Results Interchange Format (SARIF) for [Github Code Scanning](https://docs.github.com/en/code-security/reference/code-scanning/sarif-files/sarif-support-for-code-scanning).\n\n## Usage\n\n### File Input\n\n```bash\nnpx oxlint-json-to-sarif --input oxlint-output.json --output results.sarif\n```\n\n### stdin\n\n```bash\noxlint --format json | npx oxlint-json-to-sarif --output results.sarif\n```\n\n### stdout\n\n```bash\nnpx oxlint-json-to-sarif --input oxlint-output.json > results.sarif\n```\n\n### Aliases\n\n```bash\nnpx oxlint-json-to-sarif -i oxlint-output.json -o results.sarif\n```\n\n## CLI Options\n\n- --input `<path>`, -i `<path>`: path to the oxlint JSON input file\n- --output `<path>`, -o `<path>`: path to write SARIF output (defaults to stdout)\n- --help: show help\n- --version: show version\n\n## GitHub Actions Usage\n\n```yaml\n# Similar to https://github.com/actions/starter-workflows/blame/main/code-scanning/eslint.yml\nname: Oxlint\n\non:\n  push:\n  pull_request:\n\njobs:\n  oxlint:\n    runs-on: ubuntu-latest\n    permissions:\n      contents: read\n      security-events: write\n    steps:\n      - uses: actions/checkout@v6\n      - uses: actions/setup-node@v6\n        with:\n          node-version: lts/*\n      - name: Run oxlint\n        run: |\n          npx oxlint --format json | npx oxlint-json-to-sarif --output results.sarif\n        continue-on-error: true\n      - uses: github/codeql-action/upload-sarif@v4\n        with:\n          sarif_file: results.sarif\n          wait-for-processing: true\n```\n\n## Node.js Usage\n\n```ts\nimport { convertOxlintToSarif } from 'oxlint-json-to-sarif';\nimport { readFile, writeFile } from 'node:fs/promises';\n\nconst json = await readFile('oxlint-output.json', 'utf-8');\nconst sarif = convertOxlintToSarif(json);\nawait writeFile('results.sarif', sarif, 'utf-8');\n```\n\n## Rationale\n\n<details>\n<summary>Click to expand</summary>\n\n### Problem\n\nWhile oxlint's [`github` output format](https://oxc.rs/docs/guide/usage/linter/output-formats.html#format-github) can surface lint results as annotations in the **Files changed** tab of a pull request:\n\n![Annotations in the Files changed tab](https://user-images.githubusercontent.com/3151613/135507581-3ae633bd-f761-40a6-9c22-bdd9e5c50736.png)\n\nThese annotations only appear in the **Files changed** tab. Contributors who are new to GitHub are often unfamiliar with this interface and may not notice the annotations until a project maintainer points them out, extending the review cycle of a pull request.\n\n### Solution\n\nSARIF scan results, on the other hand, are shown directly on the **Conversation** tab, which is the default view when opening a pull request. This means contributors can see lint results immediately and fix them right away, without needing a reminder from maintainers.\n\n<picture>\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\".github/image/scan-dark.webp\">\n  <source media=\"(prefers-color-scheme: light)\" srcset=\".github/image/scan.webp\">\n  <img alt=\"SARIF scan results on the Conversation tab\" src=\".github/image/scan.webp\">\n</picture>\n\nOnce the lint issues are fixed, the annotations are automatically collapsed:\n\n<picture>\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\".github/image/scan-fixed-dark.webp\">\n  <source media=\"(prefers-color-scheme: light)\" srcset=\".github/image/scan-fixed.webp\">\n  <img alt=\"Fixed lint issues with collapsed annotations\" src=\".github/image/scan-fixed.webp\">\n</picture>\n\n</details>\n\n## Development\n\n```bash\npnpm install\npnpm build\npnpm test\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}