white-label
white-label copied to clipboard
why it is not strict ?
can someone please explain why is it not strict thanks
@paolog22 what do you mean by ''why is it not strict thanks"
are you talking about the TypeScript setting??
@Meskat yes. when i try making it strict it produces a lot of errors .. @chouglesaud
The strict flag enables a wide range of type checking behavior that results in stronger guarantees of program correctness.
https://www.typescriptlang.org/tsconfig#strict
@paolog22
@chouglesaud i know. but why the code is not ? sorry i am just trying to understand what is behind it .
but why the code is not
can you give an example so I can understand?
strict: true will enable all type checking rule like following
- strictNullChecks
- alwaysStrict
- ...
for example
if you set strictNullChecks to false typescript will just ignore the type checking for variable whether it is null or undefined. on the other hand, if you set to true then it will throw errors.
there is a simple example given in doc's checkout
sorry i am just trying to understand what is behind it
everybody here is to learn and understand. I am not professional I just knew a little bit and you @paolog22 help me revising the topic.
Hi there,
I had a typing problem on my project, here's and sample from the file AfterUserCreated :
DomainEvents.register(this.onUserCreatedEvent.bind(this), UserCreatedEvent.name);
}
Turn out that when enabling strict mode, the compiler complains with Property 'user' is missing in type 'IDomainEvent' but required in type 'UserCreatedEvent'.