Parser fails on TemplateLiteral in object property in VExpressionContainer
levchak0910 opened this issue · 1 comments
levchak0910 commented
Before You File a Bug Report Please Confirm You Have Done The Following...
- I'm using eslint-plugin-vue.
- I'm sure the problem is a parser problem. (If you are not sure, search for the issue in eslint-plugin-vue repo and open the issue in eslint-plugin-vue repo if there is no solution.
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
What version of ESLint are you using?
8.15.0
What version of eslint-plugin-vue and vue-eslint-parser are you using?
- vue-eslint-parser@9.1.1
- eslint-plugin-vue@9.10.0
What did you do?
Configuration = fork of eslint-plugin-vue
Trying to get a correct parsed result
<template>
<div :class="{`some`: true}" /> <!-- backticks! -->
</template>What did you expect to happen?
I expect to see a child ObjectExpression with Property[name=some][type=TemplateLiteral] in VExpressionContainer
What actually happened?
I see null in an expression of VExpressionContainer
here is a screen of astexplorer
version of vue-eslint-parser is 7.6.0 there, but the parsing result is the same for 9.1.1

Link to Minimal Reproducible Example
module.exports = {
meta: {
type: 'problem',
fixable: null,
schema: [],
},
/** @param {RuleContext} context */
create(context) {
return utils.defineTemplateBodyVisitor(context, {
VAttribute(node) {
console.log(node.value.expression) // = null
},
})
},
}Additional comments
let me know if a reproducible repository is anyway needed
levchak0910 commented
Seems I am wrong
It is not possible to create object with keys as template literal
const b = {
`some`: true,
}> Uncaught SyntaxError: Unexpected template string