Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Tooling updates to sofie-code-standard-preset #1359

Open
1 of 5 tasks
Julusian opened this issue Jan 14, 2025 · 0 comments
Open
1 of 5 tasks

RFC: Tooling updates to sofie-code-standard-preset #1359

Julusian opened this issue Jan 14, 2025 · 0 comments

Comments

@Julusian
Copy link
Member

About Me

This RFC is posted on behalf of the BBC.

Use Case

The https://github.com/nrkno/sofie-code-standard-preset can be updated to target node 20+ (or 22+) now that we have updated meteor.
There have been some DX quirks since we started using yarn4 a while back, so now seems like a good time to question that.

Some degree of changes is required to update typescript, the preset currently expects us to use 4.9 (from 2022) but it works without complaint with 5.1. 5.7 is the current version, so we are quite behind.
Some other tooling we frequently use (type-fest) requires versions newer than 4.9 now, so we will likely need to update this soon or be required to pin versions of other dependencies.

Proposal

I think it makes sense to support node 20, even though we will be using it exclusively with 22. Node 20 is still in support for over a year (and support may be desirable for users of some of the libraries such as atem-connection). Support for node 18 ends at the end of April, so I think it would be best to drop support now and save the effort of doing so later.

Eslint 9 completely reworks the config file, which works well for us. It avoids the old approach of finding plugins based on name, and requires them to be explicitly imported into the config. See https://github.com/bitfocus/companion-module-tools/blob/main/eslint/config.mjs and https://github.com/SuperFlyTV/SuperConductor/blob/feat/update-dependencies-and-tooling/eslint.config.mjs for examples of configs I have previously converted. (the superconductor one was based on this preset).
Nothing should be too hard/strange here. I would probably lean into it being a function that generates the config, so that we can if we need variances for libraries/projects later on we can add some options to the function.

The last and most questionable bit, is whether the preset should keep having the dependency on eslint, prettier, lint-staged and husky like it currently does. yarn4 does not make these available to invoke, doing so requires some workarounds in each project that uses the preset, such as this one: https://github.com/nrkno/sofie-atem-connection/blob/b0c706ffd289dc67eb09ed5ed8adf0989617c1a6/package.json#L49-L51
So I am of the opinion that we should stop including these tools, and instead have peerDependencies on them. This does mean that each consuming project will need to manage an appropriate version of these tools themselves, but this has fairly minimal effort.

Process

The Sofie Team will evaluate this RFC and open up a discussion about it, usually within a week.

  • RFC created
  • Sofie Team has evaluated the RFC
  • A workshop has been planned
  • RFC has been discussed in a workshop
  • A conclusion has been reached, see comments in thread
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant