Skip to content

Conversation

@Buckwich
Copy link
Member

@Buckwich Buckwich commented Jul 30, 2025

Proposed Changes

Discussion basis for HOC

In 5bd8d9e a tsconfig was added with invalid keys, this PR fixes that but I want to make the team aware of the implications.
To remove some errors i also added jsx parsing and other configurations to make tsc behave as much as our js codebase as possible. (its still not perfect)

With https://www.typescriptlang.org/tsconfig/#checkJs a lot of ts error will be shown in vscode, due to the strict config also a lot of complaints of implicit any
image

Until we have improved our type safety I would suggest to be not as strict. Disabling the following strict checks:

"noImplicitAny": false,
"useUnknownInCatchVariables": false,
"strictNullChecks": false,

As discussed in HOC we don't want to force a wave of errors to our developers and make it an opt-in option. With this PR we don't ship with a default tsconfig (same behavior as previous / before 5bd8d9e). but have a simple way to enable it for those who like it: Copy tsconfig.enable.json to tsconfig.json (which is now gitignored)

Try out

Copy tsconfig.enable.json to tsconfig.json

Open a file in an IDE with TS support. To get a full list of errors just run tsc, its configured to not emit:

npx tsc

Checklist

To ensure you provided everything we need to look at your PR:

  • Brief textual description of the changes present
  • Visual demo attached
  • Steps to try out present, i.e. using the @bpmn-io/sr tool
  • Related issue linked via Closes {LINK_TO_ISSUE} or Related to {LINK_TO_ISSUE}

@bpmn-io-tasks bpmn-io-tasks bot added the in progress Currently worked on label Jul 30, 2025
@github-actions
Copy link

This Pull Request targets develop branch, but contains fix commits.

Consider targeting main instead.

@Buckwich Buckwich requested review from a team, barmac and nikku and removed request for a team July 30, 2025 09:58
@Buckwich
Copy link
Member Author

Discussed in HOC: We don't want to overwhelm our devs yet with all the errors that would be thrown. I'll try to come up with a minimal starting tsconfig which should solve most of our type errors but not be as strict as this one

@nikku
Copy link
Member

nikku commented Jul 30, 2025

@Buckwich If you need help, please reach out. And thanks for fixing the config 🙂. Apparently it works in my editor, independent of the checkJs casing.

@Buckwich Buckwich changed the title fix: correct tsconfig Adjust tsconfig to be more performant and reduce common errors by configuration Aug 12, 2025
@Buckwich
Copy link
Member Author

I tried to reduce the error count as much as possible but its still 1326 errors in 227 files. At least i can run tsc now without running out of memory.

Based on our discussion in HOC I would suggest that those that don't want to get all those errors in their IDE, overwrite the tsconfig and add it to their global git ignore (alternative would be to do it the other way around)

@Buckwich Buckwich marked this pull request as ready for review August 12, 2025 10:15
@bpmn-io-tasks bpmn-io-tasks bot added needs review Review pending and removed in progress Currently worked on labels Aug 12, 2025
"src/app/*": [ "./client/src/app/*" ],
"test/*": [ "./client/test/*" ]
},
"types": [
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need this in addition to adding the @types/* dependency?

Copy link
Member Author

@Buckwich Buckwich Aug 13, 2025

Choose a reason for hiding this comment

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

type acquisition does not work for types specified in the tsconfig itself. As we dont import describe/it/expect this tells which types to use for them, basicly all umdglobal imports.

Alternative would be to always import describe/it/expect in all test files.

"noEmit": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowUmdGlobalAccess": true,
Copy link
Member

Choose a reason for hiding this comment

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

What do we need this for?

Copy link
Member Author

Choose a reason for hiding this comment

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

for these kind of error:

image

alternative would be to always import. But i would do that migration per rule in separate PRs (eg one to import sinon everywhere, one to import describe / expect everywhere)

"strictNullChecks": false,

},
"typeAcquisition": {
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need this?

Copy link
Member Author

Choose a reason for hiding this comment

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

without it we would need to add a lot more @types packages, at the moment i only have added the test types as they can't be auto acquired. This is also an IDE setting so we could remove it from the default config

"app",
"globals.d.ts"
],
"exclude": [
Copy link
Member

Choose a reason for hiding this comment

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

This is a performance enhancement, to prevent out of memory?

Copy link
Member Author

@Buckwich Buckwich Aug 13, 2025

Choose a reason for hiding this comment

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

yes, i had issues running npx tsc without it, also vscode complains about too many files to check without it. Because we have nested node_modules/build the default configs don't work

@jarekdanielak
Copy link
Contributor

@Buckwich do we actually want to merge it soon or does it require more discussion?

@Buckwich Buckwich force-pushed the fix-tsconfig branch 2 times, most recently from f1ffdb2 to 6d832c1 Compare August 29, 2025 09:41
@Buckwich
Copy link
Member Author

It can be merged if it is approved and accepted by the team that we will get more errors in the code. I'm already using it, its helpful but the errors can be distracting. And we have to accept that we can't fix all errors if we are in a js project

@Buckwich Buckwich requested review from a team and abdul99ahad and removed request for a team August 29, 2025 09:43
@jarekdanielak
Copy link
Contributor

And we have to accept that we can't fix all errors if we are in a js project

I kinda don't like that and would prefer to work in a setup where each error is meaningful. 🙁

@Buckwich
Copy link
Member Author

Buckwich commented Sep 3, 2025

would prefer to work in a setup where each error is meaningful.

the errors are still meaningful, its just a lot of work to fix them as it would require a fully typed source. This is the most common error which could be fixed by adding proper interfaces:
image

@Buckwich
Copy link
Member Author

Buckwich commented Sep 3, 2025

I've split the PR, this one contains only the tsconfig adjustments, type fixes are in #5251. Now we don't ship with a default tsconfig (same behavior as previous / before 5bd8d9e). but have a simple way to enable it for those who like it: Copy tsconfig.enable.json to tsconfig.json (which is now gitignored)

@Buckwich Buckwich requested review from jarekdanielak and removed request for abdul99ahad September 3, 2025 10:11
@Buckwich Buckwich changed the title Adjust tsconfig to be more performant and reduce common errors by configuration Disable js typechecking by default and adjust tsconfig to be more performant and reduce common errors by configuration less strict Sep 3, 2025
@jarekdanielak
Copy link
Contributor

From today's Hour of Code:

Consider having one tsconfig.json file with all the proper settings and incrementally adding more files/folders to with include.

@Buckwich Buckwich added the in progress Currently worked on label Nov 13, 2025 — with bpmn-io-tasks
@Buckwich Buckwich removed the needs review Review pending label Nov 13, 2025
@Buckwich Buckwich marked this pull request as draft November 17, 2025 10:23
@Buckwich Buckwich added the ready Ready to be worked on label Dec 5, 2025 — with bpmn-io-tasks
@Buckwich Buckwich removed the in progress Currently worked on label Dec 5, 2025
@Buckwich Buckwich added the backlog Queued in backlog label Dec 9, 2025 — with bpmn-io-tasks
@Buckwich Buckwich removed the ready Ready to be worked on label Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backlog Queued in backlog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants