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

Code clean up - tsconfig.json #3

Open
jurisgpt opened this issue Dec 9, 2023 · 0 comments
Open

Code clean up - tsconfig.json #3

jurisgpt opened this issue Dec 9, 2023 · 0 comments
Assignees
Labels
Code cleanup Improve coding standards

Comments

@jurisgpt
Copy link
Owner

jurisgpt commented Dec 9, 2023

https://github.com/jurisgpt/twg-criminal-law/blob/main/tsconfig.json

Here are some ways this TypeScript config could be improved:
Specify stricter type checking
Set "strict": true, and "noImplicitReturns": true,
Enable strict null checking
Add "strictNullChecks": true, to catch more errors
Remove unneeded options:
Like "allowJs" and "noEmit" since this is a Next.js project.
Enable type checking for test files
Add to "include": ["test/**/*.ts"]
Use TS compilation incrementally
Set "incremental": true, for faster rebuilds
Add folder aliases:
"paths": { "@components/*": ["components/*"] }

Extend linting to TypeScript
Configure ESLint to run on .ts files
Specify a JS target
Like "target": "es2020",
Consider strict property initialization
"strictPropertyInitialization": false,
Scope libraries to usage
"lib": ["es2020", "dom"]

Some key principles to follow are strictness, reducing cruft, isolation, and leveraging types

@jurisgpt jurisgpt added the Code cleanup Improve coding standards label Dec 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code cleanup Improve coding standards
Projects
None yet
Development

No branches or pull requests

2 participants