{"_id":"jsonnet-eslint-parser","_rev":"4-9bee00cbf85c67f6fd7fee8a321d4fde","name":"jsonnet-eslint-parser","dist-tags":{"latest":"0.2.2"},"versions":{"0.1.0":{"name":"jsonnet-eslint-parser","version":"0.1.0","keywords":["jsonnet","eslint","parser","ast","wasm"],"author":{"name":"baseballyama"},"license":"MIT","_id":"jsonnet-eslint-parser@0.1.0","maintainers":[{"name":"baseballyama","email":"xydybaseball@gmail.com"}],"homepage":"https://github.com/baseballyama/jsonnet-eslint-parser","bugs":{"url":"https://github.com/baseballyama/jsonnet-eslint-parser/issues"},"dist":{"shasum":"ea90b0eabab1df97355721c613dec46f5f1c3a64","tarball":"https://registry.npmjs.org/jsonnet-eslint-parser/-/jsonnet-eslint-parser-0.1.0.tgz","fileCount":21,"integrity":"sha512-gy/IG96/+3jdl3HumyX9UmrfDbzVkK5s/plEIYQ0SlhMq9hwUHm1psLkF1wP/zET35XikWNx7BNf6EiCkfFMyw==","signatures":[{"sig":"MEUCIQDQMpY83+RC/OLaqU0mQKZDGZkLnj7vERJw4z4dlydLzwIgJ4I2IFlI4aKHSPEc6HRYaDb8z8J28gqnNcpHF6ORvE4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3312353},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=22.0.0","pnpm":">=10.14.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"1010c026c51dee90e435c6a90cebe3885af9f1ff","scripts":{"knip":"knip","test":"vitest run --silent=false","build":"pnpm clean && pnpm build:js && pnpm build:types && pnpm copy:wasm","clean":"rm -rf dist","publint":"publint","release":"changeset publish","build:js":"rolldown --config rolldown.config.js","lint:fix":"oxlint --fix -c=.oxlintrc.json","test:all":"pnpm format:check && pnpm type:check && pnpm lint:check && pnpm test && pnpm build && pnpm publint && pnpm knip","check:all":"pnpm format:check && pnpm type:check && pnpm lint:check && pnpm build && pnpm publint && pnpm knip","copy:wasm":"node -e \"import('node:fs').then(fs=>{fs.mkdirSync('dist/wasm',{recursive:true});['jsonnet.wasm','wasm_exec.js'].forEach(f=>fs.copyFileSync('src/wasm/'+f,'dist/wasm/'+f));})\"","reinstall":"rm -rf node_modules && rm -f pnpm-lock.yaml && pnpm install && pnpm dedupe","build:wasm":"bash wasm/build.sh","format:fix":"prettier --write .","lint:check":"oxlint -c=.oxlintrc.json","test:watch":"vitest --silent=false","type:check":"tsc --noEmit","build:types":"tsc --project tsconfig.build.json --emitDeclarationOnly","format:check":"prettier --check .","prepublishOnly":"pnpm clean && pnpm build","update:version":"changeset version","update-fixtures":"UPDATE_FIXTURES=true vitest run tests/fixtures.test.ts && pnpm format:fix"},"_npmUser":{"name":"baseballyama","email":"xydybaseball@gmail.com"},"repository":{"url":"git+https://github.com/baseballyama/jsonnet-eslint-parser.git","type":"git"},"_npmVersion":"11.6.2","description":"ESLint parser for Jsonnet, powered by go-jsonnet compiled to WebAssembly.","directories":{},"sideEffects":false,"_nodeVersion":"24.13.0","publishConfig":{"provenance":true},"_hasShrinkwrap":false,"packageManager":"pnpm@11.8.0","devDependencies":{"knip":"^6.0.0","oxlint":"^1.49.0","vitest":"^4.0.18","publint":"^0.3.17","prettier":"^3.8.1","rolldown":"1.1.2","typescript":"^6.0.0","@types/node":"^25.3.0","@changesets/cli":"^2.29.8","@vitest/coverage-v8":"^4.0.18","@changesets/changelog-github":"^0.7.0"},"_npmOperationalInternal":{"tmp":"tmp/jsonnet-eslint-parser_0.1.0_1782115939944_0.9384236533262014","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"jsonnet-eslint-parser","version":"0.2.0","keywords":["jsonnet","eslint","parser","ast","wasm"],"author":"baseballyama","license":"MIT","_id":"jsonnet-eslint-parser@0.2.0","maintainers":[{"name":"baseballyama","email":"xydybaseball@gmail.com"}],"homepage":"https://github.com/baseballyama/jsonnet-eslint-parser","bugs":"https://github.com/baseballyama/jsonnet-eslint-parser/issues","dist":{"shasum":"a8054d86b7a6896c230742eb0a11904a574f7ac5","tarball":"https://registry.npmjs.org/jsonnet-eslint-parser/-/jsonnet-eslint-parser-0.2.0.tgz","fileCount":21,"integrity":"sha512-eARbT+feztibt/Ih4Gb3F8QZfW6c5n76MhPYMNkNsXrkIfAbE5tul1Pf739g7ev2fEEQVM41ny/MdGAzhlmp2Q==","signatures":[{"sig":"MEUCIQDLSncYGbYC+qKkKGffsHtchSR9TeDvDhYEULEb9mra4AIgRgOhjymxf6eBXLYDZFqUbhInb1kgAbvPfD56kfeE5bY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3326831},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=22.0.0","pnpm":">=10.14.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"knip":"knip","test":"vitest run --silent=false","build":"pnpm clean && pnpm build:js && pnpm build:types && pnpm copy:wasm","clean":"rm -rf dist","publint":"publint","release":"changeset publish","build:js":"rolldown --config rolldown.config.js","lint:fix":"oxlint --fix -c=.oxlintrc.json","test:all":"pnpm format:check && pnpm type:check && pnpm lint:check && pnpm test && pnpm build && pnpm publint && pnpm knip","check:all":"pnpm format:check && pnpm type:check && pnpm lint:check && pnpm build && pnpm publint && pnpm knip","copy:wasm":"node -e \"import('node:fs').then(fs=>{fs.mkdirSync('dist/wasm',{recursive:true});['jsonnet.wasm','wasm_exec.js'].forEach(f=>fs.copyFileSync('src/wasm/'+f,'dist/wasm/'+f));})\"","reinstall":"rm -rf node_modules && rm -f pnpm-lock.yaml && pnpm install && pnpm dedupe","build:wasm":"bash wasm/build.sh","format:fix":"prettier --write .","lint:check":"oxlint -c=.oxlintrc.json","test:watch":"vitest --silent=false","type:check":"tsc --noEmit","build:types":"tsc --project tsconfig.build.json --emitDeclarationOnly","format:check":"prettier --check .","update:version":"changeset version","update-fixtures":"UPDATE_FIXTURES=true vitest run tests/fixtures.test.ts && pnpm format:fix"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8ae7b104-93bd-4a19-8012-2a86b8eb948a"}},"repository":{"url":"git+https://github.com/baseballyama/jsonnet-eslint-parser.git","type":"git"},"description":"ESLint parser for Jsonnet, powered by go-jsonnet compiled to WebAssembly.","directories":{},"sideEffects":false,"_nodeVersion":"24.17.0","publishConfig":{"provenance":true},"_hasShrinkwrap":false,"devDependencies":{"knip":"^6.0.0","oxlint":"^1.49.0","vitest":"^4.0.18","publint":"^0.3.17","prettier":"^3.8.1","rolldown":"1.1.2","typescript":"^6.0.0","@types/node":"^25.3.0","@changesets/cli":"^2.29.8","@vitest/coverage-v8":"^4.0.18","@changesets/changelog-github":"^0.7.0"},"_npmOperationalInternal":{"tmp":"tmp/jsonnet-eslint-parser_0.2.0_1782382530875_0.9419687481945123","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"jsonnet-eslint-parser","version":"0.2.1","keywords":["jsonnet","eslint","parser","ast","wasm"],"author":"baseballyama","license":"MIT","_id":"jsonnet-eslint-parser@0.2.1","maintainers":[{"name":"baseballyama","email":"xydybaseball@gmail.com"}],"homepage":"https://github.com/baseballyama/jsonnet-eslint-parser","bugs":"https://github.com/baseballyama/jsonnet-eslint-parser/issues","dist":{"shasum":"99a6dedd03745963d87a59e01e8c6a82f05beac8","tarball":"https://registry.npmjs.org/jsonnet-eslint-parser/-/jsonnet-eslint-parser-0.2.1.tgz","fileCount":21,"integrity":"sha512-n5l+A4EVIx4H6sp4XGtCWqt2LmvzTYAzJ0AJb0Q36LBBodmkZyJw90/9FSr+KMy3yqQfACmeGi2fF3YrqgM1BA==","signatures":[{"sig":"MEYCIQCyUNkpZZuMshDX21L/OOMvJwok5J86jeHUHQTGgjzsrQIhAIbg3jn8ZQcQcs/1ACL+bJO39zlT2YwCG2iToFsieeYi","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIBwA9hswNgbrOYytwPbwNREoO8GcGn7VFyEbzXzMKqYMAiEArVYAXTSfHTUj1aivyygJgI3h4CzdZ367vuBrAZ0k60c=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/jsonnet-eslint-parser@0.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":3326929},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=22.0.0","pnpm":">=10.14.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"knip":"knip","test":"vitest run --silent=false","build":"pnpm clean && pnpm build:js && pnpm build:types && pnpm copy:wasm","clean":"rm -rf dist","publint":"publint","release":"changeset publish","build:js":"rolldown --config rolldown.config.js","lint:fix":"oxlint --fix -c=.oxlintrc.json","test:all":"pnpm format:check && pnpm type:check && pnpm lint:check && pnpm test && pnpm build && pnpm publint && pnpm knip","check:all":"pnpm format:check && pnpm type:check && pnpm lint:check && pnpm build && pnpm publint && pnpm knip","copy:wasm":"node -e \"import('node:fs').then(fs=>{fs.mkdirSync('dist/wasm',{recursive:true});['jsonnet.wasm','wasm_exec.js'].forEach(f=>fs.copyFileSync('src/wasm/'+f,'dist/wasm/'+f));})\"","reinstall":"rm -rf node_modules && rm -f pnpm-lock.yaml && pnpm install && pnpm dedupe","build:wasm":"bash wasm/build.sh","format:fix":"prettier --write .","lint:check":"oxlint -c=.oxlintrc.json","test:watch":"vitest --silent=false","type:check":"tsc --noEmit","build:types":"tsc --project tsconfig.build.json --emitDeclarationOnly","format:check":"prettier --check .","update:version":"changeset version","update-fixtures":"UPDATE_FIXTURES=true vitest run tests/fixtures.test.ts && pnpm format:fix"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"8ae7b104-93bd-4a19-8012-2a86b8eb948a"}},"repository":{"url":"git+https://github.com/baseballyama/jsonnet-eslint-parser.git","type":"git"},"description":"ESLint parser for Jsonnet, powered by go-jsonnet compiled to WebAssembly.","directories":{},"sideEffects":false,"publishConfig":{"provenance":true},"_hasShrinkwrap":false,"devDependencies":{"knip":"^6.41.0","oxlint":"^1.87.0","vitest":"^5.0.3","publint":"^0.3.25","prettier":"^3.9.10","rolldown":"1.2.13","typescript":"^7.0.2","@types/node":"^26.6.5","@changesets/cli":"^3.0.3","@vitest/coverage-v8":"^5.0.3","@changesets/changelog-github":"^1.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jsonnet-eslint-parser_0.2.1_1791719647002_0.9511038076758231","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"_id":"jsonnet-eslint-parser@0.2.2","bugs":"https://github.com/baseballyama/jsonnet-eslint-parser/issues","dist":{"shasum":"15708cafeeef398babd38e72645a688cddfeae86","tarball":"https://registry.npmjs.org/jsonnet-eslint-parser/-/jsonnet-eslint-parser-0.2.2.tgz","fileCount":21,"integrity":"sha512-GFiWbS6NH3xbOETxkNnsRGwUUVnuWSQwD87qRrWtyO2SvsiZu4jO+KxpoHcaaT25tOvyP7a/84FiBuGDJWzRmg==","signatures":[{"sig":"MEUCIC+M10j1P/f+cYXDFPFMx1y5YFGwf0LV7yocSygEhoC+AiEArrBRP/0frwJYRvHp+K7zvdhxDSPwCy5C//nxsZqSzz0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGZAksQBn+ZGGu100lzDmeAs0x/eoEEOYezbtGOzx2KJAiEArTLsM2O8P8MGVGtA5e6UNydbrnJee9FXAmUe2fTByB4="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/jsonnet-eslint-parser@0.2.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":3326762},"main":"./dist/index.js","name":"jsonnet-eslint-parser","type":"module","types":"./dist/index.d.ts","author":"baseballyama","engines":{"node":">=22.0.0","pnpm":">=10.14.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"license":"MIT","scripts":{"knip":"knip","test":"vitest run --silent=false","build":"pnpm clean && pnpm build:js && pnpm build:types && pnpm copy:wasm","clean":"rm -rf dist","publint":"publint","release":"changeset publish","build:js":"rolldown --config rolldown.config.js","lint:fix":"oxlint --fix -c=.oxlintrc.json","test:all":"pnpm format:check && pnpm type:check && pnpm lint:check && pnpm test && pnpm build && pnpm publint && pnpm knip","check:all":"pnpm format:check && pnpm type:check && pnpm lint:check && pnpm build && pnpm publint && pnpm knip","copy:wasm":"node -e \"import('node:fs').then(fs=>{fs.mkdirSync('dist/wasm',{recursive:true});['jsonnet.wasm','wasm_exec.js'].forEach(f=>fs.copyFileSync('src/wasm/'+f,'dist/wasm/'+f));})\"","reinstall":"rm -rf node_modules && rm -f pnpm-lock.yaml && pnpm install && pnpm dedupe","build:wasm":"bash wasm/build.sh","format:fix":"prettier --write .","lint:check":"oxlint -c=.oxlintrc.json","test:watch":"vitest --silent=false","type:check":"tsc --noEmit","build:types":"tsc --project tsconfig.build.json --emitDeclarationOnly","format:check":"prettier --check .","update:version":"changeset version","update-fixtures":"UPDATE_FIXTURES=true vitest run tests/fixtures.test.ts && pnpm format:fix"},"version":"0.2.2","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"8ae7b104-93bd-4a19-8012-2a86b8eb948a"}},"homepage":"https://github.com/baseballyama/jsonnet-eslint-parser","keywords":["jsonnet","eslint","parser","ast","wasm"],"repository":{"url":"git+https://github.com/baseballyama/jsonnet-eslint-parser.git","type":"git"},"description":"ESLint parser for Jsonnet, powered by go-jsonnet compiled to WebAssembly.","directories":{},"maintainers":[{"name":"baseballyama","email":"xydybaseball@gmail.com"}],"sideEffects":false,"publishConfig":{"provenance":true},"_hasShrinkwrap":false,"devDependencies":{"knip":"^6.42.1","oxlint":"^1.89.0","vitest":"^5.0.5","publint":"^0.3.25","prettier":"^3.9.10","rolldown":"1.2.15","typescript":"^7.0.2","@types/node":"^26.6.5","@changesets/cli":"^3.0.3","@vitest/coverage-v8":"^5.0.5","@changesets/changelog-github":"^1.0.1"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/jsonnet-eslint-parser_0.2.2_1792915727897_0.9097074863343226"}}},"time":{"created":"2026-06-22T08:12:19.743Z","modified":"2026-10-25T08:08:48.359Z","0.1.0":"2026-06-22T08:12:20.156Z","0.2.0":"2026-06-25T10:15:31.203Z","0.2.1":"2026-10-11T11:54:07.102Z","0.2.2":"2026-10-25T08:08:47.988Z"},"bugs":"https://github.com/baseballyama/jsonnet-eslint-parser/issues","author":"baseballyama","license":"MIT","homepage":"https://github.com/baseballyama/jsonnet-eslint-parser","keywords":["jsonnet","eslint","parser","ast","wasm"],"repository":{"url":"git+https://github.com/baseballyama/jsonnet-eslint-parser.git","type":"git"},"description":"ESLint parser for Jsonnet, powered by go-jsonnet compiled to WebAssembly.","maintainers":[{"name":"baseballyama","email":"xydybaseball@gmail.com"}],"readme":"# jsonnet-eslint-parser\n\nA Jsonnet parser for ESLint, powered by [`google/go-jsonnet`](https://github.com/google/go-jsonnet) compiled to WebAssembly.\n\nIt exposes an ESTree-style AST so that ESLint can lint `.jsonnet` and `.libsonnet` files, including `eslint-disable` directives written as Jsonnet comments. The Go side does the heavy lifting (parsing, tokenisation, UTF-16 column conversion) so the JS surface is a thin synchronous adapter that ESLint can load via `languageOptions.parser`.\n\n## Requirements\n\n- Node.js `>= 22`\n- ESM-only package (`\"type\": \"module\"`)\n\n## Installation\n\n```bash\nnpm install jsonnet-eslint-parser\n# or\npnpm add jsonnet-eslint-parser\n# or\nyarn add jsonnet-eslint-parser\n```\n\nThe package ships the prebuilt `jsonnet.wasm` binary and Go's runtime loader, so there is **no Go toolchain dependency at install or run time**.\n\n## Usage\n\n```javascript\nimport parser from \"jsonnet-eslint-parser\";\n\n// Parse Jsonnet source\nconst program = parser.parse(\"{ a: 1 }\");\n\n// Parse for ESLint (includes visitor keys)\nconst { ast, visitorKeys, scopeManager } = parser.parseForESLint(\n  \"local x = 1; { value: x }\",\n);\n```\n\nNamed exports are also available:\n\n```javascript\nimport { parse, parseForESLint, Ast, warmup } from \"jsonnet-eslint-parser\";\n\nconst program = parse(\"{ a: 1 }\");\n// `Ast` is a namespace re-export of every AST type definition (useful\n// when writing custom ESLint rules in TypeScript).\n// `warmup()` synchronously initialises the wasm module — call it once\n// during linter start-up to avoid paying the cold-start cost on the\n// first file.\n```\n\n## ESLint integration\n\n### Flat config (`eslint.config.js`)\n\n```javascript\nimport jsonnetParser from \"jsonnet-eslint-parser\";\n\nexport default [\n  {\n    files: [\"**/*.jsonnet\", \"**/*.libsonnet\"],\n    languageOptions: {\n      parser: jsonnetParser,\n    },\n    rules: {\n      // Jsonnet-specific rules here.\n    },\n  },\n];\n```\n\n### ESLint directives in Jsonnet comments\n\n`eslint-disable` style directives written as Jsonnet comments are honoured. The parser populates the AST `comments` array from every Jsonnet comment form:\n\n```jsonnet\n// eslint-disable-next-line no-magic-numbers\nlocal answer = 42;\n\n/* eslint-disable some-rule */\nlocal x = 1;\n/* eslint-enable some-rule */\n\n# eslint-disable-next-line some-rule\nlocal y = 2;\n```\n\n| Jsonnet comment | ESLint comment node                                          |\n| --------------- | ------------------------------------------------------------ |\n| `// ...`        | `{ type: \"Line\",  value: \"...\" }` (without the leading `//`) |\n| `# ...`         | `{ type: \"Hash\",  value: \"...\" }` (without the leading `#`)  |\n| `/* ... */`     | `{ type: \"Block\", value: \"...\" }` (without the `/*` / `*/`)  |\n\nNote that the `Hash` comment type is parser-specific because Jsonnet supports `#` comments natively. Rules that walk `comments` should treat it equivalently to `Line`.\n\n## Token classification\n\nThe parser emits ESLint-shaped tokens with these `type` values:\n\n| `type`       | Examples                                                  |\n| ------------ | --------------------------------------------------------- |\n| `Keyword`    | `local`, `if`, `then`, `else`, `import`                   |\n| `Identifier` | `foo`, `_bar`, `x1`                                       |\n| `Numeric`    | `1`, `3.14`, `1e3`                                        |\n| `String`     | `\"abc\"`, `'abc'`, `\\|\\|\\|...\\|\\|\\|`                       |\n| `Punctuator` | `{`, `}`, `[`, `]`, `(`, `)`, `,`, `;`, `.`               |\n| `Operator`   | `+`, `-`, `*`, `/`, `==`, `!=`, `&&`, `\\|\\|`, `::`, `:::` |\n\nEach token carries a UTF-16 `range` and an ESLint-style `loc` (`{line, column}` with 1-indexed lines and 0-indexed columns).\n\n## AST\n\nThe AST mirrors `google/go-jsonnet`'s `ast` package. Each node has:\n\n- `type` — the Go type name (`Object`, `Local`, `Conditional`, …).\n- `range: [number, number]` — UTF-16 character offsets.\n- `loc: { start, end }` — `{line, column}` with 1-indexed lines and 0-indexed UTF-16 columns.\n- `parent` — back-reference to the enclosing node, attached by the parser.\n\nThe full type catalogue lives in [`src/ast.ts`](./src/ast.ts) and is re-exported as the `Ast` namespace from the entry point.\n\n### Raw vs desugared\n\nThe parser surfaces the **raw** AST, not the post-desugar form. That means object literals stay as `Object` (not `DesugaredObject`), `local` bindings stay as `Local` + `LocalBind`, and so on. Source-faithful linting is the design goal — rule authors should see what the user wrote.\n\n### Wrapper nodes\n\ngo-jsonnet models several child-bearing structures as plain records rather than nodes. To keep the tree fully traversable by ESLint (whose traverser stops at any value without a string `type`), the parser promotes each of them to a real node with a `type`, a `range`/`loc` spanning its children, and an entry in `visitorKeys`:\n\n| Wrapper node         | Sits under                                             | Carries                                         |\n| -------------------- | ------------------------------------------------------ | ----------------------------------------------- |\n| `ObjectField`        | `Object.fields` / `ObjectComp.fields`                  | `kind`, `hide`, `id`, `expr1`–`expr3`, `method` |\n| `LocalBind`          | `Local.binds`                                          | `variable`, `body`, `fun`                       |\n| `ArrayElement`       | `Array.elements`                                       | `expr`                                          |\n| `Parameter`          | `Function.parameters`                                  | `name`, `defaultArg`                            |\n| `ApplyArguments`     | `Apply.arguments`                                      | `positional`, `named`                           |\n| `PositionalArgument` | `ApplyArguments.positional`                            | `expr`                                          |\n| `NamedArgument`      | `ApplyArguments.named`                                 | `name`, `arg`                                   |\n| `ForSpec`            | `ArrayComp.spec` / `ObjectComp.spec` / `ForSpec.outer` | `varName`, `expr`, `conditions`, `outer`        |\n| `IfSpec`             | `ForSpec.conditions`                                   | `expr`                                          |\n\nThe original metadata is preserved untouched — promotion only adds `type`/`range`/`loc`. A `Parameter` without a default argument and an `ApplyArguments` with no arguments span no child node, so their `range`/`loc` are absent.\n\n### Parse errors\n\nWhen go-jsonnet refuses the source, the parser still returns a `Program` with a single `JsonnetParseError` node in `body`. Tokens and comments scanned before the failure are preserved, so ESLint rules that work off the token stream still run on broken files. The `error` field carries the diagnostic.\n\n## How it works\n\nThe package wraps [`google/go-jsonnet`](https://github.com/google/go-jsonnet) at version v0.22.0. The build script (`wasm/build.sh`) clones go-jsonnet, drops a bridge `main.go` into the upstream module so it can reach the `internal/parser` package, and compiles the result to `js/wasm`. The compiled binary plus Go's `wasm_exec.js` ship in the published package.\n\nAt parse time the JS side reads the wasm binary, instantiates it synchronously, and calls a single registered function:\n\n```\njsonnet_parse(filename: string, code: string) -> string  // JSON\n```\n\nThe Go side handles parsing, tokenisation, comment extraction, UTF-8/UTF-16 byte-to-character conversion, and ESLint-style location resolution. The JS side normalises the JSON tree (renames `nodeType` to `type`, stitches `parent` links, computes visitor keys) and returns the result.\n\n## Building from source\n\nIf you want to rebuild the wasm binary yourself, you need Go (1.24+).\n\n```bash\npnpm build:wasm   # clones go-jsonnet, builds wasm/jsonnet.wasm\npnpm build        # JS + TS declarations + copy wasm into dist/\n```\n\n`pnpm test` does **not** rebuild the wasm — it uses whatever is checked in under `src/wasm/`.\n\n## License\n\n[MIT](./LICENSE)\n","readmeFilename":""}