Conversation
Closes jscs-devgh-1201 Closes jscs-devgh-1202 Closes jscs-devgh-1265
'Unable to add an error, `column` should be a positive number but ' + column + ' given'); | ||
|
||
this._addError({ | ||
var errorInfo = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think better to make a custom object instead of generic one with concrete order of fields. Hidden classes, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps you mean errorInfo
argument of the cast
method? Specifically additional
property?
In such case, yes, that would be preferable, but it has to be polymorphic since we don't know in what way rule would want apply the fix :-(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this place is not the best to talk about hidden classes and performance. errors.cast
can do the job.
Personally I'm trying to keep it in mind. Ok, nvm!
Looks good at all ;-) |
I believe we should not introduce second way of fixing. And allowing to modify AST directly is too dangerous for the compatibility. |
See the
That will happen, one way or another, we has examples of it in our repo and there is tons of modules already doing that, if we don't provide the way ppl will use other means. As of use of token-assert module, i believe we already had discussion about that - #1265 (comment). So without going in circles, we have two options, either "fix" function or doing the autofixing in |
Thank you for your explanation. I will try to explain the main problem I see with this approach: Right now almost all the fixes are made in assertion module. And those fixes are hidden, they are just part of assertion module implementation. Today we are operating on I would suggest:
Thank you. /cc @mikesherov |
Right now this looks as speculation, need proof of concept. As of tree modification we can provide means for that. If you have specific rule fix method which would lay in the Basically, this is why i insist on trying it out, to see how will people will work with it.
I thought we already past that, we had a discussion about that, and decide not to do that, see link above, we going in circles, which is not a good thing.
Otherwise i don't see any difference with those approaches. I suggest going through the route that already works, if there would be something better, we would do it. Now, i think, we just holding up the progress with such discussions that become resurrected for some reason. @mrjoelkemp @zxqfox @mikesherov @hzoo thoughts? |
Okay, so after long discussion, we came to the compromise, we wouldn't introduce the "fix" field, but a private "fix" field, all support and possible relocation of its logic to the |
|
This is 2.0? Thought this was in a good place to land and include in a new release. Feel free to update the milestone. |
Do you want to release 1.14? There is only couple things to do for 2.0, i think i could deal with most of them during this week and release on the next one. |
We have plenty to fill a 1.14 release; it's been over a month. To be clear, this particular PR will go into the 2.0 milestone, correct? Feel free to tag any other issues/PRs that should be 2.0 so that I hold off on merging them. |
This PR seems to be the last one holding up the 1.14 milestone. Are we still aiming to get this in? |
This was merged in 2.0, removed the |
Addresses #1201 #1202 #1265, but most importantly #1113.
Example with
validateQuoteMarks
is just that, example.This pull represents two different ideas for autofix infrastructure - "fix" field and assertion interface.
Which is bad, we need to make them complimentary to each other or unite approaches, but we need to keep ball rolling need to release 2.0 soon, we can improve/refactor later.