Closed dcuenot closed 5 years ago
What does the error mean?
You can have a look to the definition here: https://www.npmjs.com/package/tslint-config-security#tsr-detect-unsafe-properties-access
I still don't understand. Is it your code above that is doing property access or something?
this block tokens['response-time'](req, res), 'ms'
is doing the property access
Ok. So it sounds like you just need to change that line to something else? I'm not sure if there is something this module can do to change that code.
If it helps, you can just use the format string option (https://github.com/expressjs/morgan#using-format-string-of-predefined-tokens), which will produce the exact same output as the code you pasted above.
Hello,
When I'm defining a custom formatter with this following code, it's working, however I have an issue regarding "tslint-config-security"
The error raised by tslint-config-security is this one:
ERROR: /backend/server/common/morganAuditLogger.ts:28:4 - Found unsafe properties access
How can I fix the issue?
Thanks for the feedback Damien