Skip to content

Fix “noImplicitAny” errors in “x-element.js”.#361

Open
theengineear wants to merge 1 commit intomainfrom
fix-no-implicit-any-in-element
Open

Fix “noImplicitAny” errors in “x-element.js”.#361
theengineear wants to merge 1 commit intomainfrom
fix-no-implicit-any-in-element

Conversation

@theengineear
Copy link
Copy Markdown
Collaborator

With the change from TypeScript “5.x” to “6.x”, the “strict” config setting now defaults to “true”. We are simply working through the files one-by-one to be able to accept that new default change. It’s ultimately what we want, anyhow.

Note, this also removes the “noImplicitAny” entirely from our “tsconfig” file.

With the change from TypeScript “5.x” to “6.x”, the “strict” config
setting now defaults to “true”. We are simply working through the files
one-by-one to be able to accept that new default change. It’s ultimately
what we want, anyhow.

Note, this also removes the “noImplicitAny” entirely from our “tsconfig”
file.
"noEmitOnError": true,
"module": "NodeNext", // Approximates browser target.
// TODO: #357: Fix implicit any types.
"noImplicitAny": false
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This was the main goal. I want to take on the TS defaults. We now explicitly call things any — which I think is a lesser evil and something we can decide to fix in the future (or not).

* Called during host initialization.
* @param {any} host
* @param {any} property
* @param {any} hostInfo
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

^^ I plan to circle back to this in future PRs. It would be a mess to try and fix these any types here. I suspect that we will always have a few any types in this file — i.e., being totally dogmatic about this probably doesn’t serve us. That said, I genuinely find it useful to type out some of the internals, mostly because it improves agentic understanding of this stuff.

anyways… “yes”, I understand that some of these annotations look a bit silly in the interim.

@theengineear
Copy link
Copy Markdown
Collaborator Author

Alright @klebba — last one in this set. I think the main downside of these changes is bloat. We are certainly adding a bunch of commentary / annotation lines. I am down to talk pros / cons there in a post-review setting. I am going to get this merged (but will not yet publish). Maybe we can catch up at some point.

The main upside (the one I see at least) is improved guardrails for agentic flows. I find that by taking the type to annotate the shapes of things, I get better results, even if this stuff is all in the internal / private interfaces.

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