typescript-eslint/typescript-eslint#529
- Run
npm install
oryarn
- Run
npm run typecheck
oryarn typecheck
-> no errors - Run
npm run lint
oryarn lint
D:\Projects\typescript-eslint-no-unnecessary-type-assertion-undefined\index.ts
4:5 error This assertion is unnecessary since the receiver accepts the original type of the expression @typescript-eslint/no-unnecessary-type-assertion
✖ 1 problem (1 error, 0 warnings)
1 error and 0 warnings potentially fixable with the `--fix` option.
- Run
npm run fix
oryarn fix
- Run
npm run typecheck
oryarn typecheck
index.ts:4:5 - error TS2345: Argument of type 'string | null' is not assignable to parameter of type 'string | undefined'.
Type 'null' is not assignable to type 'string | undefined'.
4 foo(str);
~~~
Found 1 error.