Skip to content

Commit

Permalink
Improve TS built-in types (#24)
Browse files Browse the repository at this point in the history
# Make TS stricter

## ♻️ Current situation & Problem
TypeScript types for standard lib have couple decisions that could be
better. One of them is `any` return type from `JSON.parse` and
`res.json()`.


## ⚙️ Release Notes 
* Improve TS built-in types


## 📚 Documentation
`reset.d.ts` fixes them all making TS code more safe and more pleasant
to work with. See [rules](https://www.totaltypescript.com/ts-reset) for
all the changes.

### Code of Conduct & Contributing Guidelines 

By submitting creating this pull request, you agree to follow our [Code
of
Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md):
- [x] I agree to follow the [Code of
Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md).
  • Loading branch information
arkadiuszbachorski authored Jun 4, 2024
1 parent c2bb4e7 commit 3110680
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"devDependencies": {
"@testing-library/jest-dom": "^6",
"@testing-library/react": "^15",
"@total-typescript/ts-reset": "^0.5.1",
"@types/jest": "^29",
"@types/node": "^20",
"@types/react": "^18",
Expand Down
10 changes: 10 additions & 0 deletions reset.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//
// This source file is part of the Stanford Biodesign Digital Health Next.js Template open-source project
//
// SPDX-FileCopyrightText: 2023 Stanford University and the project authors (see CONTRIBUTORS.md)
//
// SPDX-License-Identifier: MIT
//

// Do not add any other lines of code to this file!
import '@total-typescript/ts-reset'

0 comments on commit 3110680

Please sign in to comment.