Hi i'm new to standard, and i love its simple and powerful.
But i have a question
i have write code like
const ms = new Date() - start
ctx.set('X-Response-Time', '${ms}ms')
but i got the warning on first line: " 'ms' is defined but never used at xx col xx ";
I wonder why this warning happen? i think it should be now take as a warning ( in Eslint it is not);
and it's there have a way to ignore this kind of warning?
Best wishes.
Your code will set the header to the string "${ms}ms", you need to use backticks (```) in order to use template strings.
e.g.
const ms = new Date() - start
ctx.set('X-Response-Time', `${ms}ms`)
ok锛宼hanks
Most helpful comment
Your code will set the header to the string "${ms}ms", you need to use backticks (```) in order to use template strings.
e.g.