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

Redundant compiler options in template tsconfigs #619

Closed
slikts opened this issue Mar 17, 2020 · 2 comments · Fixed by #673 or #864
Closed

Redundant compiler options in template tsconfigs #619

slikts opened this issue Mar 17, 2020 · 2 comments · Fixed by #673 or #864
Labels
PR welcome scope: templates Related to an init template, not necessarily to core (but could influence core)

Comments

@slikts
Copy link

slikts commented Mar 17, 2020

There are a number of redundant compiler options in the current tsconfig.json, and it could be cleaned up or simplified by removing them.

strict already enables noImplicitAny, noImplicitThis, alwaysStrict, strictNullChecks, strictFunctionTypes and strictPropertyInitialization.

noUnusedLocals and noUnusedParameters overlap with the @typescript-eslint/no-unused-vars ESLint rule, which results in duplicate errors in the editor (after the user fixes this notable issue):

image

This means, for example, that using the Go to Next Problem or Go to Previous Problem in the editor require being used twice to move past the same error.

@agilgur5
Copy link
Collaborator

agilgur5 commented Mar 17, 2020

strict already enables noImplicitAny, noImplicitThis, alwaysStrict, strictNullChecks, strictFunctionTypes and strictPropertyInitialization.

Yea I removed the strict redundancy in TSDX's own tsconfig in #475 , but not in the templates. I think because I assumed there was some reason for that? Idr, but I agree there shouldn't be redundant configs.

PR welcome to remove those.

noUnusedLocals and noUnusedParameters overlap with the @typescript-eslint/no-unused-vars ESLint rule, which results in duplicate errors in the editor

Yea I see this myself but don't particularly find it that annoying.
I'm not sure that these should necessarily be removed by default though, particularly as not everyone uses tsdx lint or has the same rules. I'd rather that be opt-out from one side (TS) or the other (ESLint) based on user preferences to avoid the case where it may not be there at all.

@agilgur5 agilgur5 added kind: discussion Discussion on changes to make PR welcome labels Mar 17, 2020
@agilgur5
Copy link
Collaborator

agilgur5 commented Mar 17, 2020

I think we could add a comment above the noUnused checks saying, for instance:

// if using ESLint, these two checks may be redundant with the @typescript-eslint/no-unused-vars rule, can disable in that case

or something

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR welcome scope: templates Related to an init template, not necessarily to core (but could influence core)
Projects
None yet
2 participants