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
Suggestion data #12606
Comments
This seems to have enough votes, but since it's a core enhancement I think it needs to be accepted by a TSC member? |
To me, this looks like a bug that our tester cannot test suggestions with |
Agree. I think it's just something that we missed in the original feature PR. Don't think it needs to go through TSC, also it's already up-voted by 3 members of TSC, so I think we should be good. |
I'm working on the rule tester now. Looks like this issue can be marked as accepted? There is one problem - the actual version allows This is different from the error tests validation (
On the other hand, The solution might be to keep the current behavior (allow |
…nt#12606) (eslint#12635) * Update: Allow testing Suggestions with data in RuleTester (fixes eslint#12606) * Add data to suggestionObjectParameters
The version of ESLint you are using.
6.7.1
The problem you want to solve.
A couple of things I noticed while working on #12591:
data
property for interpolation. This is probably intuitive for most people, but I was still initially expecting the basedata
object fromcontext.report({ data: {} })
to be used for all messages including suggestions, not just for the main error message.desc
(the final text) or justmessageId
, but notmessageId
+data
. If you passmessageId
anddata
, the tester will check justmessageId
and ignoredata
, which is different from how it works with error messages.Your take on the correct solution to problem.
data
inworking-with-rules.md
.data
provided in a test in the same way as it works with error'sdata
: interpolate and compare final messages.Are you willing to submit a pull request to implement this change?
Yes
The text was updated successfully, but these errors were encountered: