Skip to content

Conversation

@tstirrat15
Copy link
Contributor

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.

@vercel
Copy link

vercel bot commented Oct 9, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
playground Ready Ready Preview Comment Dec 4, 2025 4:14pm

};

// 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.

Choose a reason for hiding this comment

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

Copy link
Contributor Author

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
alecmerdler previously approved these changes Oct 17, 2025
Copy link

@alecmerdler alecmerdler left a comment

Choose a reason for hiding this comment

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

awesome

Comment on lines +66 to +67
// 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.
Copy link
Contributor Author

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
Copy link
Contributor Author

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.

Comment on lines 2 to 3
type DataEditorProps,
type GridCell,
Copy link
Contributor Author

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 = {
Copy link
Contributor Author

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.

Comment on lines +13 to +14
// Bring in the CSS for glide-data-grid
import "@glideapps/glide-data-grid/dist/index.css";
Copy link
Contributor Author

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;
Copy link
Contributor Author

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

Comment on lines +1 to +3
[*.{ts,tsx}]
indent_style = space
indent_size = 2
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For my own sanity

Comment on lines -21 to -22
// TODO: get rid of this and fix the issues.
"noImplicitAny": false,
Copy link
Contributor Author

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(
Copy link
Contributor Author

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.
Copy link
Contributor Author

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.

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";
Copy link
Contributor Author

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.

@tstirrat15 tstirrat15 merged commit cf36e05 into main Dec 4, 2025
5 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Dec 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants