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
dot-notation doesn't work if backtick is used #9350
Comments
Hi @DimitarNestorov, thanks for the report. I can reproduce this issue. |
beginner here, does dot-notation.js need to test for TemplateLiteral on line 61?
|
Hi @Ben-Shirley, thanks for contributing. It looks like that would be a good start for fixing this issue, but I think there are a few cases that would also need to be handled:
If I'm reading the existing code correctly, I think modifying only line 61 would cause the rule to report an error in those two cases. It seems like there are a couple of other small checks that need to be added to make sure those cases are handled correctly. Let me know if I can clarify anything. |
…rtain situations (fixes eslint#9350)
I have a passing PR with a potential fix for this. Any feedback would be welcome |
Nice work @philquinn this was a great first experience of github for me. I have a couple of questions tho, what is node.property.quasis? My google foo is letting me down. Also what is MemberExpression, I tried looking for a reference but couldn't find one, is it a function created on the fly? |
@Ben-Shirley I'm sure someone else could probably expand on this as its mainly new to myself too.
For example Above is a https://astexplorer.net/#/gist/73a678101ff196b50b5e2ef7526ad00b/9f41b299ca1080eea3ce76a7c6741dbe8d8aeb1a is what is generated from the above example. Espree is based off esprima. These docs are kinda nice but a little light, but it shows all the different expressions. https://esprima.readthedocs.io/en/latest/syntax-tree-format.html#expressions-and-patterns https://astexplorer.net/ is a pretty good way of visualising the generated AST. I hope that was some help and not just a brain dump on my side. |
No that's great, thanks for those links it explained things. For the tests how did you know to use |
Yeah exactly. To get the template literals to work, it needs to be ES2015 at least. Yep other tests use the parserOptions in a similar way. |
Tell us about your environment
macOS 10.12.6, VS Code
What parser (default, Babel-ESLint, etc.) are you using?
Babel-ESLint
Please show your full configuration:
Configuration
What did you do? Please include the actual source code causing the issue.
What did you expect to happen?
dot-notation warning
What actually happened? Please include the actual, raw output from ESLint.
No warning
The text was updated successfully, but these errors were encountered: