Skip to content

Commit 186416a

Browse files
committed
Change Disabled decorator to accept args directly to ignore instead of currying.
TS 5.5 requires this former decorator usage to be wrapped in parentheses. This isn't ideal so adjusting the signature.
1 parent 0667205 commit 186416a

File tree

2 files changed

+8
-18
lines changed

2 files changed

+8
-18
lines changed

src/common/disabled.decorator.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,12 @@
11
/* eslint-disable @seedcompany/no-unused-vars */
22

3-
import { FnLike } from '@seedcompany/common';
4-
5-
type Decorator =
6-
| ClassDecorator
7-
| PropertyDecorator
8-
| MethodDecorator
9-
| ParameterDecorator
10-
| FnLike;
11-
123
/**
134
* Mark the decorator is disabled and give a reason why.
145
* Allows to keep code versioned without being enabled
156
* without all wall of commented out text that can get outdated.
167
*/
178
export const Disabled =
18-
(why?: string) =>
19-
<T extends Decorator>(decorator: T): T =>
20-
// @ts-expect-error yeah all decorators can return void
21-
() => {
9+
(why: string, ...anything: unknown[]) =>
10+
(...decoratorArgs: unknown[]) => {
2211
// noop
2312
};

src/components/project/dto/project.dto.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,12 @@ class Project extends Interfaces {
197197
* Optimization for {@link ProjectResolver.engagements}.
198198
* This doesn't account for changesets or item filters.
199199
*/
200-
@Disabled(`
201-
I'm not convinced this wont have unintended consequences.
202-
it is still handled with the workflow condition currently and deletes are
203-
restricted, so this is a super edge case effectively.
204-
`)(
200+
@Disabled(
201+
`
202+
I'm not convinced this wont have unintended consequences.
203+
it is still handled with the workflow condition currently and deletes are
204+
restricted, so this is a super edge case effectively.
205+
`,
205206
RequiredWhenNotInDev({
206207
field: 'engagements',
207208
isMissing: (project) => project.engagementTotal === 0,

0 commit comments

Comments
 (0)