@@ -58,14 +58,14 @@ function isPromise (node) {
58
58
function create ( context ) {
59
59
const forbiddenNodes = [ ]
60
60
61
- const messages = {
62
- promise : 'Unexpected asynchronous action in "{{name}}" computed property. ' ,
63
- await : 'Unexpected await operator in "{{name}}" computed property. ' ,
64
- yield : 'Unexpected yield keyword in "{{name}}" computed property. ' ,
65
- generator : 'Unexpected generator function expression in "{{name}}" computed property. ' ,
66
- async : 'Unexpected async function declaration in "{{name}}" computed property. ' ,
67
- new : 'Unexpected Promise object in "{{name}}" computed property. ' ,
68
- timed : 'Unexpected timed function in "{{name}}" computed property. '
61
+ const expressionTypes = {
62
+ promise : 'asynchronous action' ,
63
+ await : 'await operator' ,
64
+ yield : 'yield keyword' ,
65
+ generator : 'generator function expression' ,
66
+ async : 'async function declaration' ,
67
+ new : 'Promise object' ,
68
+ timed : 'timed function'
69
69
}
70
70
71
71
function onFunctionEnter ( node ) {
@@ -142,9 +142,10 @@ function create (context) {
142
142
) {
143
143
context . report ( {
144
144
node : el . node ,
145
- message : messages [ el . type ] ,
145
+ message : 'Unexpected {{expressionName}} in "{{propertyName}}" computed property.' ,
146
146
data : {
147
- name : cp . key
147
+ expressionName : expressionTypes [ el . type ] ,
148
+ propertyName : cp . key
148
149
}
149
150
} )
150
151
}
0 commit comments