Skip to content

Commit bbf753e

Browse files
set typescript to strict
set typescript to strict
2 parents 4589742 + ebf10fb commit bbf753e

32 files changed

Lines changed: 368 additions & 67 deletions

src/lib/decorators/description.decorator.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe('Description', () => {
88
it('should decorate a class', () => {
99
@Description('This is a class')
1010
class Foo {
11-
foo: string;
11+
foo!: string;
1212
}
1313

1414
const d = MetadataDescriptor.for(Foo)
@@ -19,7 +19,7 @@ describe('Description', () => {
1919

2020
class Foo {
2121
@Description('This is a property')
22-
foo: string;
22+
foo!: string;
2323
}
2424

2525
const d = MetadataDescriptor.for(Foo, 'foo')

src/lib/decorators/description.decorator.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-explicit-any */
12
import { Class } from '@agape/types';
23
import { MetadataDescriptor } from '../descriptors/metadata.descriptor';
34

@@ -57,7 +58,7 @@ import { MetadataDescriptor } from '../descriptors/metadata.descriptor';
5758
*/
5859
export function Description(description: string) {
5960

60-
function Description(target: object | Class, name?: string, index?: TypedPropertyDescriptor<unknown> | number) {
61+
function Description(target: object | Class, name?: string, index?: TypedPropertyDescriptor<any> | number) {
6162

6263
const descriptor = index !== undefined && typeof index === "number"
6364
? MetadataDescriptor.for(target, name, index)

src/lib/decorators/example.decorator.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe('Example', () => {
88
it('should decorate a class', () => {
99
@Example({ foo: 'fooooo!!!'})
1010
class Foo {
11-
foo: string;
11+
foo!: string;
1212
}
1313

1414
const d = MetadataDescriptor.for(Foo)
@@ -19,7 +19,7 @@ describe('Example', () => {
1919

2020
class Foo {
2121
@Example('fooooo!!!')
22-
foo: string;
22+
foo!: string;
2323
}
2424

2525
const d = MetadataDescriptor.for(Foo, 'foo')

src/lib/decorators/example.decorator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
1+
/* eslint-disable @typescript-eslint/no-explicit-any */
22
import { Class } from '@agape/types';
33
import { MetadataDescriptor } from '../descriptors/metadata.descriptor';
44

@@ -61,7 +61,7 @@ import { MetadataDescriptor } from '../descriptors/metadata.descriptor';
6161
*/
6262
export function Example(value: any): (target: object, name?: string, propertyDescriptor?: TypedPropertyDescriptor<any> | number) => void {
6363

64-
function Example(target: object | Class, name?: string, index?: TypedPropertyDescriptor<unknown> | number) {
64+
function Example(target: object | Class, name?: string, index?: TypedPropertyDescriptor<any> | number) {
6565
const descriptor = index !== undefined && typeof index === "number"
6666
? MetadataDescriptor.for(target, name, index)
6767
: MetadataDescriptor.for(target, name);

src/lib/decorators/label.decorator.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe('Label', () => {
88
it('should decorate a class', () => {
99
@Label('Foo')
1010
class Foo {
11-
foo: string;
11+
foo!: string;
1212
}
1313

1414
const d = MetadataDescriptor.for(Foo)
@@ -19,7 +19,7 @@ describe('Label', () => {
1919

2020
class Foo {
2121
@Label('Foo')
22-
foo: string;
22+
foo!: string;
2323
}
2424

2525
const d = MetadataDescriptor.for(Foo, 'foo')
@@ -55,7 +55,7 @@ describe('Label', () => {
5555
it('should set the plural', () => {
5656
@Label('Foo', 'Foos')
5757
class Foo {
58-
foo: string;
58+
foo!: string;
5959
}
6060

6161
const d = MetadataDescriptor.for(Foo)

src/lib/decorators/label.decorator.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-explicit-any */
12
import { Class } from '@agape/types';
23
import { MetadataDescriptor } from '../descriptors/metadata.descriptor';
34

@@ -55,10 +56,10 @@ import { MetadataDescriptor } from '../descriptors/metadata.descriptor';
5556
* @decoratorKind Metadata
5657
* @decoratorPropertyType any
5758
*/
58-
export function Label(label: string | undefined, plural?: string): (target: object | Class, name?: string, index?: TypedPropertyDescriptor<unknown> | number) => void
59-
export function Label(...args: string[]) {
59+
export function Label(label: string | undefined, plural?: string): (target: object | Class, name?: string, index?: TypedPropertyDescriptor<any> | number) => void
60+
export function Label(...args: any[]) {
6061

61-
function Label(target: object | Class, name?: string, index?: TypedPropertyDescriptor<unknown> | number) {
62+
function Label(target: object | Class, name?: string, index?: TypedPropertyDescriptor<any> | number) {
6263

6364
const descriptor = index !== undefined && typeof index === "number"
6465
? MetadataDescriptor.for(target, name, index)

src/lib/decorators/noun.decorator.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe('Noun', () => {
88
it('should decorate a class', () => {
99
@Noun('foo')
1010
class Foo {
11-
foo: string;
11+
foo!: string;
1212
}
1313

1414
const d = MetadataDescriptor.for(Foo)
@@ -19,7 +19,7 @@ describe('Noun', () => {
1919

2020
class Foo {
2121
@Noun('foo')
22-
foo: string;
22+
foo!: string;
2323
}
2424

2525
const d = MetadataDescriptor.for(Foo, 'foo')
@@ -55,7 +55,7 @@ describe('Noun', () => {
5555
it('should set the plural', () => {
5656
@Noun('foo', 'foos')
5757
class Foo {
58-
foo: string;
58+
foo!: string;
5959
}
6060

6161
const d = MetadataDescriptor.for(Foo)

src/lib/decorators/noun.decorator.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-explicit-any */
12
import { Class } from '@agape/types';
23
import { MetadataDescriptor } from '../descriptors/metadata.descriptor';
34

@@ -54,10 +55,10 @@ import { MetadataDescriptor } from '../descriptors/metadata.descriptor';
5455
* @decoratorKind Metadata
5556
* @decoratorPropertyType any
5657
*/
57-
export function Noun(noun: string | undefined, plural?: string): (target: object | Class, name?: string, index?: TypedPropertyDescriptor<unknown> | number) => void
58-
export function Noun(...args: string[]) {
58+
export function Noun(noun: string | undefined, plural?: string): (target: object | Class, name?: string, index?: TypedPropertyDescriptor<any> | number) => void
59+
export function Noun(...args: any[]) {
5960

60-
function Noun(target: object | Class, name?: string, index?: TypedPropertyDescriptor<unknown> | number) {
61+
function Noun(target: object | Class, name?: string, index?: TypedPropertyDescriptor<any> | number) {
6162

6263
const descriptor = index !== undefined && typeof index === "number"
6364
? MetadataDescriptor.for(target, name, index)

src/lib/decorators/sensitive.decorator.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe('Label', () => {
88
it('should decorate a class', () => {
99
@Sensitive
1010
class Foo {
11-
foo: string;
11+
foo!: string;
1212
}
1313

1414
const d = MetadataDescriptor.for(Foo)
@@ -17,7 +17,7 @@ describe('Label', () => {
1717
it('should set sensitive to false', () => {
1818
@Sensitive(false)
1919
class Foo {
20-
foo: string;
20+
foo!: string;
2121
}
2222

2323
const d = MetadataDescriptor.for(Foo)
@@ -28,7 +28,7 @@ describe('Label', () => {
2828

2929
class Foo {
3030
@Sensitive
31-
foo: string;
31+
foo!: string;
3232
}
3333

3434
const d = MetadataDescriptor.for(Foo, 'foo')

src/lib/decorators/sensitive.decorator.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-explicit-any */
12
import { Class } from '@agape/types';
23
import { MetadataDescriptor } from '../descriptors/metadata.descriptor';
34

@@ -65,21 +66,21 @@ import { MetadataDescriptor } from '../descriptors/metadata.descriptor';
6566
* @decoratorKind Metadata
6667
* @decoratorPropertyType any
6768
*/
68-
export function Sensitive(sensitive?: boolean): (target: object | Class, name?: string, index?: TypedPropertyDescriptor<unknown> | number) => void
69-
export function Sensitive(target: object | Class, name?: string, index?: TypedPropertyDescriptor<unknown> | number): void
70-
export function Sensitive(...args: never[] ): ((target: object | Class, name?: string, index?: TypedPropertyDescriptor<unknown> | number) => void) | void {
69+
export function Sensitive(sensitive?: boolean): (target: object | Class, name?: string, index?: TypedPropertyDescriptor<any> | number) => void
70+
export function Sensitive(target: object | Class, name?: string, index?: TypedPropertyDescriptor<any> | number): void
71+
export function Sensitive(...args: any[]): ((target: object | Class, name?: string, index?: TypedPropertyDescriptor<any> | number) => void) | void {
7172

7273
let sensitive = true;
7374

74-
let target: object;
75-
let name: string;
76-
let indexOrPropertyDescriptor: TypedPropertyDescriptor<unknown> | number;
75+
let target: object | Class | undefined;
76+
let name: string | undefined;
77+
let indexOrPropertyDescriptor: TypedPropertyDescriptor<any> | number | undefined;
7778

7879
if (args.length === 0) sensitive = true;
7980
else if (args.length === 1 && typeof args[0] === 'boolean') sensitive = args[0];
8081
else [target, name, indexOrPropertyDescriptor] = args, sensitive = true;
8182

82-
function Sensitive(target: object | Class, name?: string, index?: TypedPropertyDescriptor<unknown> | number) {
83+
function Sensitive(target: object | Class, name?: string, index?: TypedPropertyDescriptor<any> | number) {
8384

8485
const descriptor = index !== undefined && typeof index === "number"
8586
? MetadataDescriptor.for(target, name, index)

0 commit comments

Comments
 (0)