Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The project doesn't compile if noFallthroughCasesInSwitch flag is set #26

Closed
ZixZux opened this issue Apr 5, 2023 · 4 comments
Closed

Comments

@ZixZux
Copy link

ZixZux commented Apr 5, 2023

The project with this package included doesn't compile if 'noFallthroughCasesInSwitch' flag is set to 'true' in tsconfig.json.

@juanjoDiaz
Copy link
Owner

Hi @ZixZux ,

Typescript recommends using skipLibCheck to avoid this kind of issue.

I will fix it in the next release in any case.

@ZixZux
Copy link
Author

ZixZux commented Apr 17, 2023

Hi,

The flag skipLibCheck doesn't help in this case, because it only seems to work only for d.ts files: "Skip type checking of declaration files. [...] Rather than doing a full check of all d.ts files, TypeScript will type check the code you specifically refer to in your app’s source code."

But the errors are in your source typescript-files.

In common, source typescript-files shouldn't being included in the distributed package.

@RobRendell
Copy link

RobRendell commented May 16, 2023

I have the same issue, failing to build because of my more strict compilerOptions - noFallthroughCasesInSwitch and noUncheckedIndexedAccess in my case.

The suggested solution is that "the package owner [should] release JavaScript and declaration files, not TypeScript files." What's interesting is that you do release JS and .d.ts files, and as far as I can see, correctly reference them in your package.json - you just also happen to bundle the src folder as well. So I don't know why Typescript is even inspecting your package's source when it should just be using the type declaration files. I added a comment to the issue I linked to, pointing out this apparent inconsistency.

Anyway, if you're going to omit the typescript files in the next release, that would prevent this particular issue. Looking forward to it!

@juanjoDiaz
Copy link
Owner

This took long enough...

Fixed in v0.0.14

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

No branches or pull requests

3 participants