Skip to content

Better Type Errors#607

Open
leeyi45 wants to merge 300 commits into
masterfrom
better-type-guards
Open

Better Type Errors#607
leeyi45 wants to merge 300 commits into
masterfrom
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.

RichDom2185 and others added 21 commits February 15, 2026 00:44
# Conflicts:
#	docs/src/modules/2-bundle/4-conventions/4-types.md
#	lib/modules-lib/src/utilities.ts
#	src/bundles/curve/src/__tests__/curve.test.ts
#	src/bundles/curve/src/drawers.ts
#	src/bundles/sound/package.json
Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) from 5.3.6 to 5.4.1.
- [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases)
- [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md)
- [Commits](NaturalIntelligence/fast-xml-parser@v5.3.6...v5.4.1)

---
updated-dependencies:
- dependency-name: fast-xml-parser
  dependency-version: 5.4.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
@leeyi45 leeyi45 marked this pull request as draft March 3, 2026 15:32
@leeyi45
Copy link
Copy Markdown
Contributor Author

leeyi45 commented Mar 3, 2026

I just noticed that without updating js-slang, the deployment of modules is going to fail. So until that's done this needs to be held off

@leeyi45
Copy link
Copy Markdown
Contributor Author

leeyi45 commented May 7, 2026

Certain ESLint rules that rely on Typescript linting also don't work on the CI but work locally. There's some weird shennenigans going on with the Typescript present in the CI environment and the in the local environment.

@leeyi45 leeyi45 marked this pull request as ready for review May 8, 2026 12:52
@leeyi45
Copy link
Copy Markdown
Contributor Author

leeyi45 commented May 8, 2026

I am confident that there's some weird discrepancy with the way Typescript is working on local machines and Github Actions, but I honestly can't tell what's wrong.

But I've put in workarounds in the meantime

@RichDom2185
Copy link
Copy Markdown
Member

I am confident that there's some weird discrepancy with the way Typescript is working on local machines and Github Actions, but I honestly can't tell what's wrong.

But I've put in workarounds in the meantime

I would not be surprised; the frontend has a discrepancy between TS diagnostics in IDE vs when running tsc – I had to use @ts-ignore instead of @ts-expect-error as a result

@RichDom2185 RichDom2185 self-requested a review May 19, 2026 02:50
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