Closed kevinkhill closed 2 years ago
[warn] packages/chevrotain/src/parse/parser/parser.ts
[warn] Code style issues found in the above file(s). Forgot to run Prettier?
So this seems like a trivial improvement but it is actually more complex than first seems.
To update the public APIs you would also need to update this file:
While this getter can be useful, I assume end users would also need to access the errors if there are any
so if they have to know the .errors
property anyhows, does it make sense to add another method to the API?
Someone using lodash may do _.isEmpty(this.errors)
and someone who likes OOP could add a method like yours o their parser class, this seems sufficient from my POV.
If this new hasErrors
method is an official public API, I would expect all the samples / docs to be updated as well, and that may not be worth the effort for such a small API upgrade.
All great points, thanks for the detailed answer. I think I thought I could sneak in a little thing not realizing it's tendrils.
All great points, thanks for the detailed answer. I think I thought I could sneak in a little thing not realizing it's tendrils.
😄
I'll close this PR for now. Feel free to re-open it if / when you want to go more in-depth into it.
Not exactly sure where to put this in your fancy mixin class.... but I seem to do this check a lot, so this could be a helpful little getter.