Skip to content

Conversation

@duncanbeevers
Copy link
Contributor

@duncanbeevers duncanbeevers commented Dec 11, 2021

In order to generate suggestions for #2921 I need support for augmenting suggestions in the parsers.all work, to ensure my spec examples get decorated with the extraComment.

🗣 Discussion

parsers.all generates an extraComment which is appended to test case examples and their expected output.
Eslint's suggestions API also allows recommended code changes, and RuleTester compares expected changes against generated changes. However, parsers.all didn't augment these expected outputs with the extraComment.

2021-12-10 at 8 28 PM

📋 Next steps

I intend to include these changes with the hook-use-state PR where the utility will be more obvious, but I wanted to open discussion here in case my approach needs to be refined, and to keep the already long-running hook-use-state PR focused.

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

Seems good (i retitled the PR, because [New] is for semver-minor things in the real code, not test things)

@ljharb ljharb changed the title [New] parsers.all augments suggestion code output [Test] parsers.all augments suggestion code output Dec 11, 2021
@duncanbeevers
Copy link
Contributor Author

i retitled the PR, because [New] is for semver-minor things

👍 I'll update the commit message when I squash this.

parsers.all generates an extraComment which is appended to test case examples and their expected output.
Eslint's suggestions API also allows recommended code changes, and RuleTester compares expected changes against generated changes. However, parsers.all didn't augment these expected outputs with the extraComment.
@duncanbeevers duncanbeevers force-pushed the parsers-all-suggestions-extra-comment branch from d159eea to f7943d5 Compare December 11, 2021 07:05
@duncanbeevers duncanbeevers requested a review from ljharb December 11, 2021 10:34
@ljharb ljharb merged commit f7943d5 into jsx-eslint:master Dec 11, 2021
@duncanbeevers duncanbeevers deleted the parsers-all-suggestions-extra-comment branch December 11, 2021 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants