I have this piece of code:
sendMessage(message) {
let data = {
message
};
this.socket.send('message', data);
}
I'm using eslint and set the object-shorthand rule.
"object-shorthand": [
2,
"always"
],
And get this error:
---
message: 'Unexpected token }'
severity: error
data:
line: 39
column: 14
ruleId: ''
...
But why? Any other way to find what rule is being violated?
If I do this:
sendMessage(message) {
let data = {
message: message
};
this.socket.send('message', data);
}
I get this:
---
message: Expected property shorthand.
severity: error
data:
line: 38
column: 17
ruleId: object-shorthand
...
It's clear what's wrong. Great.
So, how can I find what's going on? eslint is asking for object shorthands (as I told it to) but it is not accepting them... For some other reason?
Having these errors showing up all the time is distracting.
Any help is highly appreciated.
(I'm using the latest gulp-eslint: 1.0.0)