[x] Contains Only One Commit(git reset then git commit)
[x] Build Success(npm run build)
[ ] Lint Success(npm run lint to check, npm run fix to fix): there were lint failures but not related to my code
[x] File Integrity(git add -A or add rules at .gitignore file)
[ ] Add Test(if relevant, npm run test to check): I can't find any tests in this repo, please advise!
[ ] Add Demo(if relevant): I'd love to add one, please let me know how
Test/demo file:
$ cat test.ts
let val; // any
if (Math.random() < 0.5) {
val = /hello/; // any
val // RegExp
} else {
val = 12; // any
val // number
}
val // number | RegExp
Without the new flag: lines 1, 3 and 6 are flagged as anys
With the new flag: no errors are flagged
Anecdotally, here's the diff for my project:
54890 / 55533 98.84% Before
55110 / 55533 99.23% After
So this removed 220/643 of the issues flagged by type-coverage. I skimmed through many of these and they seemed fine.
This is a long-standing pattern that has been allowed in TS since version 2.1.
Fixes(if relevant): #28
Checks
git reset
thengit commit
)npm run build
)npm run lint
to check,npm run fix
to fix): there were lint failures but not related to my codegit add -A
or add rules at.gitignore
file)npm run test
to check): I can't find any tests in this repo, please advise!Test/demo file:
Without the new flag: lines 1, 3 and 6 are flagged as
any
s With the new flag: no errors are flaggedAnecdotally, here's the diff for my project:
So this removed 220/643 of the issues flagged by
type-coverage
. I skimmed through many of these and they seemed fine.This is a long-standing pattern that has been allowed in TS since version 2.1.