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

Feature request - Support libraries #113

Open
roninjin10 opened this issue Mar 15, 2023 · 2 comments
Open

Feature request - Support libraries #113

roninjin10 opened this issue Mar 15, 2023 · 2 comments

Comments

@roninjin10
Copy link

Instead of not supporting libraries we can find a clever way to only conditionally apply ts-reset. Then libraries can explicitly enable and typecheck but otherwise it's disabled by default

@NoelDeMartin
Copy link

For anyone who ends up here, I managed to use it in my libraries creating a ts-reset.d.ts file with the following contents:

/// <reference types="@total-typescript/ts-reset" />

I guess it will depend on your bundling configuration, but in mine it works properly and it doesn't include any reference to ts-reset in the distribution assets.

What do you think @mattpocock? Is it a good idea? If you don't see anything wrong with it I can open a PR to add this on the README. And to be honest, if it works maybe it's even better to just do this all the time, that way you don't have to give different instructions whether you're working on a library or an app :).

@Samuel-Therrien-Beslogic
Copy link

Samuel-Therrien-Beslogic commented Oct 25, 2023

I have a slightly different use case I'm wondering if it's possible to be supported or if we could get some pointers on:
We have a company-wide eslint plugin/config lib to help enforce our standards and get the most out of typescript. It also already patches some libs like NX's eslint generation and Angular Material's unsafe dialogs. We also have a shared base tsconfig file.
I'm wondering if it's possible for for TS Reset to be loaded with the rules we want just by installing our standards library. Or at least enforce that it's activated through some sort of linting rules.

I thought about using compilerOptions.types in the base tsconfig. But that option is too easily overridable, removing extended setting.

Note that I wouldn't do that in a runtime library. This is solely to help coworkers use TS Reset without having to forget to configure it properly. Or that it even exists.

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