-
Notifications
You must be signed in to change notification settings - Fork 6
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
<@argument>
Parsing error: Cannot read properties of null (reading 'index')
#22
Conversation
limber:lint:js:fix: 0:0 error Parsing error: Cannot read properties of null (reading 'index')
Run & review this pull request in StackBlitz Codeflow. |
src/parser/transforms.js
Outdated
@@ -268,7 +268,7 @@ module.exports.preprocessGlimmerTemplates = function preprocessGlimmerTemplates( | |||
let codeSlice = code.slice(...n.range); | |||
for (const part of n.tag.split('.')) { | |||
let pattern = `\\b${part}\\b`; | |||
if (part.startsWith(':')) { | |||
if (part.startsWith(':') || part.startsWith('@')) { |
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 should probably extend this to any special character?
A tag could also be _Foo
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.
Or just use indexOf, that should work...
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.
Difference is _Foo could be defined locally
b405f57
to
e1314df
Compare
5c637bd
to
f45607b
Compare
let part = code.slice(...n.parent.range); | ||
let start = n.parent.range[0]; | ||
// for blocks {{x as |b|}} the block range does not contain the block params... | ||
// for element tag it does <x as b /> |
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.
// for element tag it does <x as b /> | |
// for element tag it does <x as |b|> |
No description provided.