-
-
Notifications
You must be signed in to change notification settings - Fork 496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
estree: acorn and typescript eslint ast conformance suite #8630
Comments
Copying the referenced comment from #2854 for ease: To surface all the obscure differences between our JS-side AST and ESTree, I think we ideally need conformance tests. Initially we'll have tons of failures, but we can chip away at them until there are none. I suggest:
The Acorn AST JSON files will take time to compute and will be many many files. We could:
Then the conformance tests could be written purely in Rust, and we only need to run Acorn once, not every time conformance runs. That'll only cover us for JS syntax. I guess we could do similar for TS ASTs using fixtures from TypeScript repo and using typescript-eslint's parser to generate the JSON files. But personally I think we should concentrate on the JS AST first. Does that sound like a good idea? If so, does anyone have an interest in building the infrastructure? |
According to
https://www.npmjs.com/package/rollup import type * as estree from 'estree';
export type ParseAst = (
input: string,
options?: { allowReturnOutsideFunction?: boolean; jsx?: boolean }
) => ProgramNode;
type ProgramNode = RollupAstNode<estree.Program>; |
I revived https://github.com/oxc-project/acorn-test262 and wrote a quick runner in https://github.com/oxc-project/oxc/compare/estree, nothing matches right now due to ts syntaxes. "body": [
{
"declarations": [
{
+ "definite": false,
"end": 255,
"id": {
"end": 227,
"name": "result",
+ "optional": false,
"start": 221,
- "type": "Identifier"
+ "type": "Identifier",
+ "typeAnnotation": null
},
"init": {
"arguments": [
{
"end": 250,
+ "raw": "null", |
#2854 (comment)
The text was updated successfully, but these errors were encountered: