Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
chore: enable strict type checking #80
chore: enable strict type checking #80
Changes from 7 commits
c1ecd45
f3621d6
ca64e6d
819d822
ec40349
a2f4e92
71b844a
6861130
3882f4b
194bdca
e1a7484
5e82c24
2072510
02c3e3c
9f0d665
8e1cb93
cddc0ca
7fab2e9
c8dc5f9
7463a11
43e1337
f73e3d8
d54f025
4cc2e50
eda4914
fddbd91
dffd3cd
5769366
977f83e
dd4a886
b78a422
5f61e22
d2e553c
3db1d21
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The deal is validated shortly after this call using typebox. This means that it is safe to use any type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bajtos what do you think about introducing a new type, called
ToBeParsed
or similar, which equalsany
? This way we don't have anyany
, and can forbid it, but at the same time, signal that this type needs to be parsed, and will be parsed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use
Record<string, unknown>
. I wish node-postgres was using that type forresult.rows
out of the box. (I'll handle this myself and push a new commit.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am introducing
UnknownRow
type that we can share. I am happy to discuss a better name for this type.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, you can do
pgPool.query<UnknownRow>(...)
in TypeScript, but that's unfortunately not possible with JSDoc-style typings :(There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This conversation is resolved as far as I am concerned. I propose to start a new thread if you disagree with some of the decisions I made in 7fab2e9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After merging with main, we now can use
SubmittableDeals
spark-deal-observer/backend/lib/spark-api-submit-deals.js
Line 154 in 3205201
unkown
types.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree it's a better alternative than
unknown
👍🏻There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bajtos can we disallow
any
in typescript settings?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not as far as I know.
There is a typescript-eslint rule no-explicit-any, but IIRC, typescript-eslint does not work with JSDoc-in-JS-files, plus we are using standard.js.
I am going to mention this topic here: