Skip to content

Conversation

@danilofuchs
Copy link

@danilofuchs danilofuchs commented Feb 5, 2021

Adds support for noUncheckedIndexedAccess flag, an even stricter flag.

https://devblogs.microsoft.com/typescript/announcing-typescript-4-1-beta/#no-unchecked-indexed-access

Update: On issue microsoft/TypeScript#42659 the TS team instructed me to use tsc --help --all flag, which solved the issue.


Old comment, preserved for posterity

This change does not actually work, as this flag appears to not work when running tsc, only with inside tsconfig.json.

I created an issue on Typescript: microsoft/TypeScript#42659

@danilofuchs danilofuchs mentioned this pull request Feb 5, 2021
@falkenhawk
Copy link

falkenhawk commented Oct 26, 2021

Thanks to --all flag added, this also fixes the issue with typescript 4.4+ where they hide many options from --help
and ts-strictify ends up calling tsc with only --noEmit flag and then incorrectly reports all files green.

Ref:

@falkenhawk
Copy link

It looks like this repo is not maintained anymore, sadly. @danilofuchs have you perhaps built and published a version of your fork?

@danilofuchs
Copy link
Author

It looks like this repo is not maintained anymore, sadly. @danilofuchs have you perhaps built and published a version of your fork?

Yes, I assume the repo owner migrated his project and stopped maintaining the tool.

I believe you can install using my fork ref directly, but I haven't tried it myself.

@falkenhawk
Copy link

falkenhawk commented Oct 26, 2021

Thanks to --all flag added, this also fixes the issue with typescript 4.4+

oh, actually ef702f3 is unfinished, --all should be still added at

const { all: helpOutput } = await execa('tsc', ['--help'], { all: true, preferLocal: true })

['--help', '--all']

@falkenhawk
Copy link

Thanks for quick answer @danilofuchs !

I believe you can install using my fork ref directly, but I haven't tried it myself.

I tried, using "ts-strictify": "danilofuchs/ts-strictify#ef702f35", in package.json, but that does not include dist folder so cli script defined in "bin": "./dist/cli.js", is not available compiled.
Yeah I can try calling the original with ts-node ./node_modules/ts-strictify/src/cli.ts but that's a bit backbreaking 😅

@danilofuchs
Copy link
Author

@falkenhawk I didn't even remember this, but I pushed a with-builds branch when testing this. Check if you can use it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants