Skip to content

Better Type Errors#607

Draft
leeyi45 wants to merge 268 commits intomasterfrom
better-type-guards
Draft

Better Type Errors#607
leeyi45 wants to merge 268 commits intomasterfrom
better-type-guards

Conversation

@leeyi45
Copy link
Copy Markdown
Contributor

@leeyi45 leeyi45 commented Mar 3, 2026

Better Type Errors

Some general fixes to things that got missed out in previous PRs. Also re-exports js-slang's rttc (runtime type checking) utilities and exposes them to modules

throw-runtime-error

Introduces a linting rule as well to highlight whenever an error being thrown doesn't inherit from the RuntimeSourceError type.

Devserver Changes

Since js-slang now allows us to customize what importers are being used, the devserver can now be used without the modules server.

copy_gc and mark_sweep refactor

I modernized those two modules to bring them up to date with module contexts and other design patterns. They are sorely lacking in documentation however, so I don't actually know if anything is broken.

noImplicitAny

noImplicitAny has been enabled for all bundles and tabs and only left disabled for modules (like unity_academy) that simply don't leave enough context clues or documentation for me to be able to create types for them. I've fixed type errors wherever I can, but a lot of bundles don't have tests so it's not always clear if any kind of functionality has been affected.

leeyi45 and others added 30 commits January 15, 2026 19:05
# Conflicts:
#	lib/buildtools/src/build/__tests__/all.test.ts
#	lib/lintplugin/package.json
#	lib/modules-lib/src/tabs/__tests__/useAnimation.test.ts
#	package.json
#	yarn.lock
@leeyi45
Copy link
Copy Markdown
Contributor Author

leeyi45 commented May 2, 2026

Something very weird is happening with this PR

Across the three different environments that I have access to (Windows, MacOS and the Github Actions) everything seems to be behaving inconsistently

  1. Tests that are succeeding on Windows are failing in MacOS and Github Actions but for different reasons
  2. The import/extensions error seems to only be reported in Github Actions
  3. A ton of the Typescript errors are just not being reported on Windows

This'll probably warrant more investigation on my end....

@leeyi45
Copy link
Copy Markdown
Contributor Author

leeyi45 commented May 2, 2026

I am still considering introducing the validator in this PR, but I think I will probably have to leave it for another PR. There's a bunch of design decisions for it that need to be made.

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.

2 participants