diff --git a/apps/oxlint/src-js/plugins/context.ts b/apps/oxlint/src-js/plugins/context.ts index b7c0697fbcfac..0af19a9de024c 100644 --- a/apps/oxlint/src-js/plugins/context.ts +++ b/apps/oxlint/src-js/plugins/context.ts @@ -32,6 +32,7 @@ import { settings, initSettings } from "./settings.ts"; import visitorKeys from "../generated/keys.ts"; import { debugAssertIsNonNull } from "../utils/asserts.ts"; import { envs, globals, initGlobals } from "./globals.ts"; +import { version as packageVersion } from "../../package.json" with { type: "json" }; import type { Globals, Envs } from "./globals.ts"; import type { RuleDetails } from "./load.ts"; @@ -91,13 +92,12 @@ const PARSER = Object.freeze({ /** * Parser name. */ - name: "oxc", + name: "oxlint", /** * Parser version. */ - // TODO: This can be statically defined, but need it be to be updated when we make a new release. - version: "0.0.0", + version: packageVersion, /** * Parse code into an AST. diff --git a/apps/oxlint/test/fixtures/languageOptions/output.snap.md b/apps/oxlint/test/fixtures/languageOptions/output.snap.md index 20d07f563e941..9d6c79bfb11ad 100644 --- a/apps/oxlint/test/fixtures/languageOptions/output.snap.md +++ b/apps/oxlint/test/fixtures/languageOptions/output.snap.md @@ -16,7 +16,7 @@ x language-options-plugin(lang): parser: | object keys: name,version,parse,VisitorKeys,Syntax,latestEcmaVersion,supportedEcmaVersions - | name: oxc + | name: oxlint | typeof version: string | typeof parse: function | latestEcmaVersion: 17