fix: improve global/env translation and cleaning up of overrides#245
Merged
Sysix merged 17 commits intooxc-project:mainfrom Nov 23, 2025
Merged
fix: improve global/env translation and cleaning up of overrides#245Sysix merged 17 commits intooxc-project:mainfrom
Sysix merged 17 commits intooxc-project:mainfrom
Conversation
Sysix
reviewed
Nov 15, 2025
…lity on. And also improve the tests a bit.
This ensures that we aren't providing unnecessary extra values for the `env` key. I wrote a script to confirm these values were the ones that are supersets, but theoretically we could also just update this to use the `globals` package directly and determine supersets at runtime?
This is showing a current problem where multiple extends are not being merged properly, and so we end up with exact-duplicate overrides.
Saw this from the mastodon config file after trying to migrate it, so now it's fixed :)
Member
Author
|
@Sysix Alright, I fixed another bug and this is ready to go now :) I think the mastodon eslint config now ports over pretty cleanly. |
This was heavily helped by AI, but looking through the tests and running it on the snapshots, it looks like it works correctly for all the cases I can come up with.
…",` overrides being emitted (albeit with differing sets of files). Will fix this with the next commit.
If the only difference is the set of files, merge the override objects and combine the file lists.
Sysix
approved these changes
Nov 23, 2025
Member
Sysix
left a comment
There was a problem hiding this comment.
@connorshea added a commit to simplify some code. override.files is always an array, no need to check for it. :)
Member
Author
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Now we treat
workerandserviceworkeras special envs in the same way as we do withbrowserandnode.We also remove duplicative envs which are subsets of another enabled env. Right now the supersets are hardcoded, but we should maybe determine the supersets dynamically at runtime so
globalsupdates are accounted for automatically? That can be done as a separate PR, though.Also add astro, svelte, and vue to the globals list, as those were added to the rust crate.
And de-duplicate identical overrides when they come up and are right next to one another.
We also merge overrides if the only difference is the sets of files, by merging the override objects and combining the file lists.
Assisted by GitHub Copilot + Claude Sonnet 4.5 for parts, but tested with a few complex eslint configs and the existing snapshots and tests.