You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an application that manipulate ASTs directly without a text source. The UI is controlled and you can't have syntax errors. Now I am researching linters (eslint, jshint..) to help my program find errors that are not related to syntax.
An obvious issue when you don't have a text source is that you don't have a SouceLocation. AFAICT this means I cannot use eslint? Or at least not in the usual way.. But I don't see any reason why we shouldn't be able to use eslint on an AST to directly. So I am starting this thread to discuss this particular his case..
How would you report location information when there is just a tree structure? If you have the current node and could probably easily look up the ancestors to find the path of the current node. Which is enough information for me to display an error message at the appropriate place..
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have an application that manipulate ASTs directly without a text source. The UI is controlled and you can't have syntax errors. Now I am researching linters (eslint, jshint..) to help my program find errors that are not related to syntax.
An obvious issue when you don't have a text source is that you don't have a
SouceLocation
. AFAICT this means I cannot use eslint? Or at least not in the usual way.. But I don't see any reason why we shouldn't be able to use eslint on an AST to directly. So I am starting this thread to discuss this particular his case..How would you report location information when there is just a tree structure? If you have the current node and could probably easily look up the ancestors to find the path of the current node. Which is enough information for me to display an error message at the appropriate place..
Any thoughts on how to deal with this issue?
Beta Was this translation helpful? Give feedback.
All reactions