Rubymine syntax highlighting in js.erb files with ES6
已回答
I think there is a bug when parsing .js.erb files when we want ES6 format.
We want to reference a class library in a gem so we are using .erb so we can do
import "<%= MyHelper.helperfunction('path/to/Feature.js') %>";
So, if our code snippet looks like this (example.js.erb) it reports an error where `data=> {` is :
import "<%= MyHelper.helperfunction('path/to/Feature.js') %>";
export default class MyClass extends Feature {
static get defaultConfig() {
return {
features: {
eventTooltip: {
template: data => {
const sd = DateHelper.format(data.eventRecord.startDate, 'LL');
const ed = DateHelper.format(data.eventRecord.endDate, 'LL');
}
}
}
}
}
}
When we have it (as example.js) we don't get any error:
import Feature from 'Feature';
export default class MyClass extends Feature {
static get defaultConfig() {
return {
features: {
eventTooltip: {
template: data => {
const sd = DateHelper.format(data.eventRecord.startDate, 'LL');
const ed = DateHelper.format(data.eventRecord.endDate, 'LL');
}
}
}
}
}
}
请先登录再写评论。
Hello,
it seems to be a known problem, please add your vote and follow https://youtrack.jetbrains.com/issue/RUBY-24197
Thanks Olga, I've added a comment there.