mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
1.2 KiB
1.2 KiB
DSpace ESLint plugins > TypeScript rules > dspace-angular-ts/unique-decorators
Some decorators must be called with unique arguments (e.g. when they construct a mapping based on the argument values)
Options
decorators
The list of all the decorators for which you want to enforce this behavior.
Examples
Valid code
checked decorator, no repetitions
@listableObjectComponent(a)
export class A {
}
@listableObjectComponent(a, 'b')
export class B {
}
@listableObjectComponent(a, 'b', 3)
export class C {
}
@listableObjectComponent(a, 'b', 3, Enum.TEST1)
export class C {
}
@listableObjectComponent(a, 'b', 3, Enum.TEST2)
export class C {
}
unchecked decorator, some repetitions
@something(a)
export class A {
}
@something(a)
export class B {
}
Invalid code
checked decorator, some repetitions
@listableObjectComponent(a)
export class A {
}
@listableObjectComponent(a)
export class B {
}
Will produce the following error(s):
Duplicate decorator call