Skip to content

Conversation

3cp
Copy link
Member

@3cp 3cp commented Apr 3, 2025

closes #376

@3cp 3cp requested a review from fisker April 3, 2025 21:02
import { version as pkgVersion } from '../package.json';

// This bypass troublesome package.json in generated d.ts file.
const version: string = pkgVersion;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this is a fix for #375? Curious why -- the error I got from TypeScript was a failure to resolve the ../package.json import, which will still happen here. Looks like my report wasn't specific enough.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This lets typescript to skip reference of package.json in generated d.ts file.

import { Options } from './parser';
import * as ESTree from './estree';
declare const version: string;
export declare function parseScript(source: string, options?: Options): ESTree.Program;
export declare function parseModule(source: string, options?: Options): ESTree.Program;
export declare function parse(source: string, options?: Options): ESTree.Program;
export { Options, ESTree, version };

@3cp 3cp merged commit 3ef007f into main Apr 4, 2025
1 check passed
@3cp 3cp deleted the fix-set branch April 4, 2025 04:56
@3cp
Copy link
Member Author

3cp commented Apr 4, 2025

v6.0.6 is released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parse failure for await set() - cannot use "await" as identifier inside an async function
3 participants