-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add an API for parse metadata so that content-tag can be used with eslint, prettier, and glint #19
Comments
What would also be needed is this: This is so that offsets do not change anywhere |
This is required to unblock Glint: typed-ember/glint#615 turns out half the tooling out there needs line/col information. |
I would add that: it would be fine to do an exact port of the existing parse API that just emits location information. But I'm pretty sure every place that uses that API also immediately follows up by slicing and dicing the source to replace the content tags. So it would be even better to
This would eliminate the need for other systems like glint or the eslint plugin to do their own source mangling after calling content-tag. |
I think ember template lint uses only location info. |
No, ember-template-lint does exactly the kind of slicing I'm talking about in _applyFixes.
But this is the whole point of why we made content-tag. It already knows that difference! The proper place to detect that difference is in the parser. A lot of the way the existing system worked is hacks to get around the fact that the previous parser can't tell the difference, and we can get rid of those hacks now. |
Oh, i understand it wrong then. What do you mean by the replacement callback then? Maybe can you give an example, then i might understand it better. |
Look at this file and port over the tests.
ember-template-tag
(a js implementation)parseTemplates
parseTemplates
does not exist incontent-tag
todaycontent-tag
content-tag
that makes the above implemented tests passThe text was updated successfully, but these errors were encountered: