Closed WiseBird closed 2 years ago
injectable-should-be-provided fails if a class has a not callable decorator:
injectable-should-be-provided
@boundClass @Injectable() export class AppService {
The error:
TypeError: Cannot read properties of undefined (reading 'name')
happens when we try to get the name of the decorator:
const decorators = n.decorators?.filter((d) => decoratorNames.includes( ( (d.expression as TSESTree.CallExpression) .callee as TSESTree.Identifier ).name <-- ) );
https://github.com/WiseBird/eslint-plugin-nestjs-issue-decorator (commit)
Hey thanks for reporting this. I fixed the rule so it won't crash for you now 👍
Description
injectable-should-be-provided
fails if a class has a not callable decorator:The error:
happens when we try to get the name of the decorator:
Reproduction
https://github.com/WiseBird/eslint-plugin-nestjs-issue-decorator (commit)