-
Notifications
You must be signed in to change notification settings - Fork 10
Undisable noImplicitAny
#84
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
43d0eb1 to
d141dea
Compare
d141dea to
fbff958
Compare
fbff958 to
17101f6
Compare
137c384 to
05ea0c2
Compare
05ea0c2 to
f075cf6
Compare
| }; | ||
|
|
||
| // TODO: this is creating a new `run` on every render. Refactor so that the reference is stable, | ||
| // or else use an off-the-shelf debounce. |
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.
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.
Yeah, gonna treat this as a follow-on.
alecmerdler
left a comment
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.
awesome
f075cf6 to
4d3ebdd
Compare
| // TODO: this is creating a new `run` on every render. Refactor so that the reference is stable, | ||
| // or else use an off-the-shelf debounce. |
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 is something that I noticed as I was reading through code; fixing it was more involved than I wanted to do in this PR.
| @@ -0,0 +1,6 @@ | |||
| declare module "visjs-network" { | |||
| // TODO: go reverse-engineer these 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.
Or else get rid of this feature. I've never been that stoked on it.
| type DataEditorProps, | ||
| type GridCell, |
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 don't know if there's a difference in behavior by typescript/the bundler when doing this, but it makes things more explicit for a reader.
| } | ||
|
|
||
| const CommentCellEditor = (props: { | ||
| type CommentCellEditorProps = { |
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.
There's several of this kind of change - making props into their own type, since the function is used as an arg to something else.
| // Bring in the CSS for glide-data-grid | ||
| import "@glideapps/glide-data-grid/dist/index.css"; |
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 was one of the changes with v6 of the lib.
| updatedRelationships: Relationship[] | undefined; | ||
| output: string | undefined; | ||
| error: string | undefined; | ||
| updatedSchema?: string; |
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.
?: is a terser way of expressing | undefined
| [*.{ts,tsx}] | ||
| indent_style = space | ||
| indent_size = 2 |
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.
For my own sanity
| // TODO: get rid of this and fix the issues. | ||
| "noImplicitAny": false, |
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 was the motivating change.
| }); | ||
| }; | ||
|
|
||
| const { drawCell, provideEditor } = useCustomCells( |
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 is one of the things that changed in v6 - you provide customRenderers directly instead of wrapping in drawCell and provideEditor.
| }; | ||
|
|
||
| // TODO: this is creating a new `run` on every render. Refactor so that the reference is stable, | ||
| // or else use an off-the-shelf debounce. |
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.
Yeah, gonna treat this as a follow-on.
4d3ebdd to
96277fb
Compare
96277fb to
f980c57
Compare
| import Button from "@material-ui/core/Button"; | ||
| import { Theme, createStyles, makeStyles } from "@material-ui/core/styles"; | ||
| import { fade } from "@material-ui/core/styles/colorManipulator"; | ||
| import { alpha } from "@material-ui/core/styles/colorManipulator"; |
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 was marking as deprecated; the names are aliases of each other.
Description
Part of getting this codebase closer to strictly following Typescript's recommendations, which provides better type-safety and ideally better behavior.
The idea behind this one is that if typescript can't infer the type of a function argument, especially in a callback function, it will type it as
any. This is the "implicit" any in the rule. This configuration change makes typescript yell at you about it.I don't think I uncovered any actual bugs here, but it means the guardrails should be better.
Changes
Will annotate.
Testing
Review. See that tests pass.