Skip to content

Conversation

@willhack
Copy link
Contributor

@willhack willhack commented Mar 31, 2025

What it does

Does what it says on the tin!

...Slightly more detail

The Eslint v9 migration is fairly straightforward, albeit less bothersome now that plugin authors have had a change to catch up to the new flat config.

I tended to prefer the old files, they seemed a lot cleaner, but moving to the JS config allows for some nice LSP suggestion so it's about half and half.

NPM Script Changes

  • I've expanded linting to all non-generated js/ts(x?) files, and this is now sourced from the config file (score one for "locality of behavior"!)
  • report-unused-directives is now the default behavior so I've removed that as well
  • Unfortunately eslint won't move max-warnings to a config, so there's one CLI flag left, but otherwise I think this cleans it up nicely

What's with all the turned off rules??

So. This will be slightly divisive depending on which side of things you fall on: I've turned off all rules currently causing warnings and errors. The reasoning behind this is that from a zero warning/error you can add a linting check to the pipeline (just in any of your GH actions, or creating it's own). IMO with OSS, warnings and errors tanking pipelines can help keep code style dialed in.

I wasn't sure if there were reasons some of them hadn't been ignored before. For example I know coming from Rust using let just makes sense, but prefer-const wasn't turned off causing 84 errors across the codebase, all but 1 are auto-fixable though.

Some of these could also make for nice "first issues" for those looking to contribute but unsure how. Basically - find an ignored rule, turn it off, and see if you can fix all the issues, etc.

Others will need special attention: exhaustive deps in react-hooks is crucial for preventing bugs due to unexpected effects calls, but take much more effort to make sure nothing has been botched when updating them. (Suggested reading for whoever takes that on)


There are a few that I'll go ahead and update tomorrow since they're tiny or very clean. But I wanted to scope each to it's own commit, and I'll circle back on those and push them up tomorrow.

- upgrade eslint and all deps to latest
- move to new flat config
- get to zero warning/error linting runs
@netlify
Copy link

netlify bot commented Mar 31, 2025

Deploy Preview for zmk-studio ready!

Name Link
🔨 Latest commit fdba9e6
🔍 Latest deploy log https://app.netlify.com/sites/zmk-studio/deploys/67eaf706f2f58a000843c707
😎 Deploy Preview https://deploy-preview-134.preview.zmk.studio
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

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