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

🚧 Convert to Typescript #120

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft

🚧 Convert to Typescript #120

wants to merge 10 commits into from

Conversation

mattbrictson
Copy link
Contributor

WIP

"lint": "npm-run-all -c lint:*",
"lint:eslint": "eslint 'app/**/*.{js,ts}'",
"lint:tsc": "tsc --noEmit",
"server": "ts-node --transpile-only app/server.ts",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider an explicit build step instead of using ts-node in production.

"start": "nodemon --watch . --watch .env.development --watch .env.development.local app/server.js",
"lint": "eslint 'app/**/*.js'",
"server": "node app/server.js",
"start": "ts-node-dev --transpile-only --watch .,.env.development,.env.development.local app/server.ts",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nodemon is a popular option.. is ts-node-dev well supported?

"dotenv": "^10.0.0",
"@types/express": "^4.17.12",
"@types/jest": "^26.0.23",
"@types/lodash": "^4.14.170",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really still need lodash? Especially since this project is now Node 16+ and typescript.

"skipLibCheck": true,
"strict": true,
"target": "es2020"
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explicitly list excludes here (node_modules by default).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explicit includes as well.

@@ -0,0 +1,13 @@
{
"compilerOptions": {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure node and jest are included in types.

"prettier": "^2.2.1",
"shelljs": "^0.8.2",
"supertest": "^6.1.3"
"supertest": "^6.1.3",
"ts-jest": "^27.0.3",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great to have an example in the project of mocking a module in jest, and using the ts-jest utils.

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

Successfully merging this pull request may close these issues.

1 participant