{"_id":"@crescware/dependency-aware-oxlint","_rev":"2-3aaa4b4a454810c9cc3b50dab2028f17","name":"@crescware/dependency-aware-oxlint","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@crescware/dependency-aware-oxlint","version":"0.0.1","license":"MIT","_id":"@crescware/dependency-aware-oxlint@0.0.1","maintainers":[{"name":"crescware","email":"okunokentaro+npm@crescware.com"}],"bin":{"dependency-aware-oxlint":"dist/cli.js"},"dist":{"shasum":"f12eebf979c9c939d2fcc72f38e1828c48aa063b","tarball":"https://registry.npmjs.org/@crescware/dependency-aware-oxlint/-/dependency-aware-oxlint-0.0.1.tgz","fileCount":39,"integrity":"sha512-1oYB+N2+ceF0YQbVhiO+hncgCQ9O+TGePsZlJsdJnYz4X9mHO2TxKasH49Dgh4asRnf1BvK3WLl3zhFDNNvPPw==","signatures":[{"sig":"MEQCIG9igNNEvrltbIoQym2+l6zH6d+JJsowOutdtE8uKe++AiBynFwr4ueIciFDARsvMdRYoPMbpeFC+Eq3q6Rt5BghmA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":58881},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"96263452dd44be619f0c07a88ef79a021c804012","scripts":{"dev":"tsgo -p tsconfig.json --watch","exec":"node dist/cli.js","test":"pnpm build && vitest run","build":"tsgo -p tsconfig.json","check":"pnpm run check:types && pnpm run check:lint","format":"oxlint --fix && oxfmt","check:lint":"oxlint && oxfmt --check","check:types":"tsgo -p tsconfig.json --noEmit","prepublishOnly":"pnpm build"},"_npmUser":{"name":"crescware","email":"okunokentaro+npm@crescware.com"},"_npmVersion":"11.11.0","description":"A scope-aware runner for oxlint that applies lint rules based on the import dependency graph.","directories":{},"_nodeVersion":"24.14.1","dependencies":{"jiti":"^2.6.1","ignore":"^7.0.5","commander":"^12.0.0","oxc-parser":"^0.127.0","oxc-resolver":"^11.19.1"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.33.1+sha512.05ba3c1d5d1c18f68df06470d74055e62d41fc110a0c660db1b2dfb2785327f04cf0f68345d4609bc52089e7fa0343c31593b2f9594e2c5d5da426230acc9820","devDependencies":{"oxfmt":"^0.46.0","oxlint":"^1.61.0","vitest":"^2.1.0","@types/node":"^24.12.2","@typescript/native-preview":"7.0.0-dev.20260421.2"},"peerDependencies":{"oxlint":">=1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/dependency-aware-oxlint_0.0.1_1776988253574_0.6326045288704145","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@crescware/dependency-aware-oxlint","version":"0.0.2","description":"A scope-aware runner for oxlint that applies lint rules based on the import dependency graph.","license":"MIT","bin":{"dependency-aware-oxlint":"dist/cli.js"},"type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"publishConfig":{"access":"public"},"scripts":{"build":"tsgo -p tsconfig.json","check":"pnpm run check:types && pnpm run check:lint","check:lint":"oxlint && oxfmt --check","check:types":"tsgo -p tsconfig.json --noEmit","dev":"tsgo -p tsconfig.json --watch","exec":"node dist/cli.js","format":"oxlint --fix && oxfmt","prepublishOnly":"pnpm build","test":"pnpm build && vitest run"},"dependencies":{"commander":"^12.0.0","ignore":"^7.0.5","jiti":"^2.6.1","oxc-parser":"^0.127.0","oxc-resolver":"^11.19.1"},"devDependencies":{"@types/node":"^24.12.2","@typescript/native-preview":"7.0.0-dev.20260421.2","oxfmt":"^0.46.0","oxlint":"^1.61.0","vitest":"^2.1.0"},"peerDependencies":{"oxlint":">=1.0.0"},"engines":{"node":">=24"},"packageManager":"pnpm@10.33.1+sha512.05ba3c1d5d1c18f68df06470d74055e62d41fc110a0c660db1b2dfb2785327f04cf0f68345d4609bc52089e7fa0343c31593b2f9594e2c5d5da426230acc9820","gitHead":"5219c917ca68a3c812f9f26d9ff345325f029715","_id":"@crescware/dependency-aware-oxlint@0.0.2","_nodeVersion":"24.14.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-5p3/qZHAEZXh/O1IbaDUKzayKYi1FVNFOu4OnboiJ9Oh9OT+tR9sf54lPPQrdXi/l+LMmxEBB9sfTTxZkPNj2Q==","shasum":"fde81e3846167a1343c2e06aa4cb73292c739530","tarball":"https://registry.npmjs.org/@crescware/dependency-aware-oxlint/-/dependency-aware-oxlint-0.0.2.tgz","fileCount":35,"unpackedSize":51912,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFB9tXLymC4CNw0TxpuC8KIEjMVZVShuUwmLldTz/NldAiAR8Mstfd6yyq60sYkm/aYRV49PNH58tfviCDqA3igD1g=="}]},"_npmUser":{"name":"crescware","email":"okunokentaro+npm@crescware.com"},"directories":{},"maintainers":[{"name":"crescware","email":"okunokentaro+npm@crescware.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dependency-aware-oxlint_0.0.2_1776989567837_0.4345138485910087"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-23T23:50:53.460Z","modified":"2026-04-24T00:12:48.097Z","0.0.1":"2026-04-23T23:50:53.736Z","0.0.2":"2026-04-24T00:12:47.988Z"},"license":"MIT","description":"A scope-aware runner for oxlint that applies lint rules based on the import dependency graph.","maintainers":[{"name":"crescware","email":"okunokentaro+npm@crescware.com"}],"readme":"# @crescware/dependency-aware-oxlint\n\nA scope-aware runner for oxlint that applies lint rules based on the import dependency graph.\n\n## Features\n\n- Runs `oxlint` once per **scope** defined in a config file, then aggregates the results into a single report.\n- Two ways to attach an oxlint config to a scope: inline (`oxlintConfig`) or by path (`oxlintrcPath`).\n- `include` / `exclude` use gitignore-style patterns (via [`ignore`](https://www.npmjs.com/package/ignore)).\n- Exclude is **dependency-aware**: a file matched by `exclude` is still linted if it has any ancestor (an importer, transitively) that is not excluded.\n- Import graph is built from static imports, re-exports, and string-literal dynamic imports, resolved with [`oxc-resolver`](https://www.npmjs.com/package/oxc-resolver) (optionally using your `tsconfig.json`).\n\n## Installation\n\nRequires Node 24.x. `oxlint` is a peer dependency — install both:\n\n```sh\npnpm add -D @crescware/dependency-aware-oxlint oxlint\n```\n\n## Getting started\n\n### 1. Create `dependency-aware-oxlint.config.ts`\n\n```ts\nimport type { DependencyAwareOxlintConfig } from \"@crescware/dependency-aware-oxlint\";\n\nexport default {\n  rootDir: \"src\",\n  tsconfig: \"tsconfig.json\",\n  scopes: [\n    {\n      name: \"strict\",\n      oxlintConfig: {\n        plugins: [],\n        rules: {\n          \"no-console\": \"error\",\n        },\n      },\n      include: [\"**/*.ts\"],\n      exclude: [\"**/form-schema.*\"],\n    },\n  ],\n} satisfies DependencyAwareOxlintConfig;\n```\n\nAlternatively, point at an existing `.oxlintrc.*` file instead of defining rules inline:\n\n```ts\n{\n  name: \"strict\",\n  oxlintrcPath: \".oxlintrc.strict.json\",\n  include: [\"**/*.ts\"],\n  exclude: [\"**/form-schema.*\"],\n}\n```\n\n### 2. Run the CLI\n\n```sh\npnpm dependency-aware-oxlint\n```\n\nSample output (from running the CLI against `integration-tests/fixtures/inline-config/`):\n\n```\n[strict] src/item.ts:1:1\n  error: Unexpected console statement.\n  rule: eslint(no-console)\n  help: Delete this console statement.\n\n[strict] src/api-schema.ts:3:1\n  error: Unexpected console statement.\n  rule: eslint(no-console)\n  help: Delete this console statement.\n\nSummary: 2 errors, 0 warnings across 1 scope\n```\n\nProcess exit code is `1` if any diagnostic has `severity: \"error\"`, otherwise `0`.\n\n## Configuration reference\n\nThe config file is resolved, in order, as one of:\n\n- `dependency-aware-oxlint.config.ts`\n- `dependency-aware-oxlint.config.mts`\n- `dependency-aware-oxlint.config.js`\n- `dependency-aware-oxlint.config.mjs`\n\nConfig files are loaded via [`jiti`](https://www.npmjs.com/package/jiti), so TypeScript sources work without a pre-build step.\n\n### Types\n\n```ts\ntype DependencyAwareOxlintConfig = {\n  rootDir: string;\n  tsconfig?: string;\n  scopes: ScopeDefinition[];\n};\n\ntype ScopeDefinition =\n  | {\n      name: string;\n      include: string[];\n      exclude?: string[];\n      oxlintConfig: OxlintConfig; // from \"oxlint\"\n    }\n  | {\n      name: string;\n      include: string[];\n      exclude?: string[];\n      oxlintrcPath: string;\n    };\n```\n\n- `rootDir` — directory that is walked to collect source files and to which `include` / `exclude` patterns are relative. Relative paths are resolved from the config file's directory.\n- `tsconfig` — optional path to a `tsconfig.json`, passed to `oxc-resolver` (with `references: \"auto\"`). If omitted, `tsconfig.json` next to the config file is used when present.\n- `scopes[].name` — used as a label in the report and to select via `--scope`.\n- `scopes[].include` / `scopes[].exclude` — gitignore-style patterns matched against the file path relative to `rootDir` (normalized to forward slashes).\n- Exactly one of `oxlintConfig` (inline object) or `oxlintrcPath` (path to a `.oxlintrc.*` file) must be set per scope. Inline configs are written to a temporary file and cleaned up after the run.\n\nSource files are discovered by walking `rootDir`, skipping dotfiles and the directories: `node_modules`, `.git`, `dist`, `build`, `coverage`, `.next`, `.turbo`. Files with these extensions are picked up: `.ts`, `.tsx`, `.js`, `.jsx`, `.mts`, `.cts`, `.mjs`, `.cjs`.\n\n## CLI reference\n\n```\ndependency-aware-oxlint [files...]\n\nOptions:\n  -c, --config <path>   Path to dependency-aware-oxlint.config.ts\n  -s, --scope <name>    Only run the given scope (can be passed multiple times)\n      --cwd <path>      Working directory (defaults to process.cwd)\n```\n\n- `--config` — if omitted, the config file is searched in `--cwd` (or `process.cwd()`).\n- `--scope` — can be repeated to select multiple scopes. When omitted, every scope in the config is run.\n\n## Scope resolution\n\nFor each scope, the set of files to lint is computed against the whole dependency graph rooted at `rootDir`:\n\n1. Start with every file that matches `include`.\n2. If the file matches `exclude`, keep it only when **at least one ancestor** (a file that transitively imports it) is _not_ excluded. Files with no ancestors are dropped when they match `exclude`.\n\nExample (see `integration-tests/fixtures/inline-config/`):\n\n- `include: [\"**/*.ts\"]`, `exclude: [\"**/form-schema.*\"]`\n- `form-schema.ts` imports `item.ts` and `user.ts`.\n- `api-schema.ts` also imports `item.ts`.\n- Result: `form-schema.ts` is dropped (matches `exclude`, no importer). `user.ts` is dropped (only ancestor is the excluded `form-schema.ts`). `item.ts` is kept (one ancestor, `api-schema.ts`, is not excluded). `api-schema.ts` is kept.\n\n## Output & exit code\n\nReport lines are emitted in scope order. Each diagnostic renders as:\n\n```\n[<scope>] <relativePath>[:<line>:<column>]\n  <error|warning>: <message>\n  rule: <code>\n  help: <help>          # when provided\n```\n\nA trailing summary line reports totals:\n\n```\nSummary: <n> errors, <m> warnings across <k> scopes\n```\n\nExit code is `1` when `errorCount > 0`, else `0`.\n\n## Development\n\nThis repository uses `pnpm` (pinned via `packageManager`) and the Node version declared in `mise.toml`.\n\nScripts (`package.json`):\n\n| Script        | Command                               |\n| ------------- | ------------------------------------- |\n| `build`       | `tsgo -p tsconfig.json`               |\n| `dev`         | `tsgo -p tsconfig.json --watch`       |\n| `check`       | `pnpm check:types && pnpm check:lint` |\n| `check:types` | `tsgo -p tsconfig.json --noEmit`      |\n| `check:lint`  | `oxlint && oxfmt --check`             |\n| `format`      | `oxlint --fix && oxfmt`               |\n| `test`        | `pnpm build && vitest run`            |\n| `exec`        | `node dist/cli.js`                    |\n\n## License\n\nMIT © Crescware Inc.\n","readmeFilename":"README.md"}