Skip to content
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

Remove unstable AST testing #10462

Merged
merged 4 commits into from Mar 5, 2021
Merged

Conversation

sosukesuzuki
Copy link
Member

@sosukesuzuki sosukesuzuki commented Mar 4, 2021

Description

babel/babel#12915 has been fixed so we can remove unstable AST testing.

Checklist

Try the playground for this PR

@sosukesuzuki
Copy link
Member Author

Tests are failing via babel/babel#12939 for json-stringify parser.

Comment on lines 53 to 61
"json/json/propertyKey.json",
(options) => options.parser === "json-stringify",
],
[
"flow/function-parentheses/test.js",
(options) => options.parser.startsWith("babel"),
"json/json/positive-number.json",
(options) => options.parser === "json-stringify",
],
["json/json/json5.json", (options) => options.parser === "json-stringify"],
["json/json/array.json", (options) => options.parser === "json-stringify"],
Copy link
Member Author

Choose a reason for hiding this comment

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

In now parserExpression returns AST includes tokens so may break AST idempotency for json-stringify parser.

Copy link
Member

Choose a reason for hiding this comment

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

I see tokens in ignoredProperties in clean.js. Why does that property still affect idempotence tests?

Copy link
Member Author

Choose a reason for hiding this comment

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

Probably ignoreProperties are ignored by messageAST, are not by idempotence tests.

https://github.com/prettier/prettier/blob/main/src/main/massage-ast.js#L13-L18

Copy link
Member

Choose a reason for hiding this comment

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

It should work, I'll take a look.

Copy link
Member

Choose a reason for hiding this comment

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

tokens was not ignored in estree-json printer.

yarn.lock Outdated
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.13.9.tgz#ca34cb95e1c2dd126863a84465ae8ef66114be99"
integrity sha512-nEUfRiARCcaVo3ny3ZQjURjHQZUo/JkEw7rLlSZy/psWGnvwXFtPcr6jb7Yb41DVW5LTe6KRq9LGleRNsg1Frw==

"@babel/parser@^7.1.0", "@babel/parser@^7.12.13", "@babel/parser@^7.13.0", "@babel/parser@^7.13.4":
version "7.13.4"
Copy link
Member

Choose a reason for hiding this comment

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

This needs deduplication.

@thorn0 thorn0 merged commit f1b5720 into prettier:main Mar 5, 2021
@sosukesuzuki sosukesuzuki deleted the bump-babel-parser branch March 5, 2021 15:38
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants