- Notifications
You must be signed in to change notification settings - Fork71
chore: migrate linting from eslint to biome 2.3.8#790
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| privateasynchandleErrorEvent(error:unknown):Promise<void>{ | ||
| constnow=newDate(); | ||
| conststatusCode= | ||
| typeoferror==='object'&& | ||
| error!==null&& | ||
| typeof(erroras{status?:unknown}).status==='number' | ||
| ?(erroras{status:number}).status | ||
| :undefined; | ||
| constmessage= | ||
| typeoferror==='string' | ||
| ?error | ||
| :typeoferror==='object'&& | ||
| error!==null&& | ||
| typeof(erroras{message?:unknown}).message==='string' | ||
| ?(erroras{message:string}).message | ||
| :undefined; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Biome complains about any as a parameter, we can decide to add a biome ignore for this line as the extra complexity to get a valid type out of an unknown type is a bit too much. But on the other hand, this is the proper way of doing it...
coveralls commentedNov 27, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Pull Request Test Coverage Report forBuild 19742438061Details
💛 -Coveralls |
| letcounter=this.counters.get(key); | ||
| if(!counter){ | ||
| counter=newCounterImpl(opts); | ||
| this.counters.set(key,counter); | ||
| } | ||
| returnthis.counters.get(key)!; | ||
| returncounter; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This refactor removes 1 extra access to counters
| privateconvertToMap(features:FeatureInterface[]):FeatureToggleData{ | ||
| constobj=features.reduce( | ||
| (o:{[s:string]:FeatureInterface},feature:FeatureInterface)=>{ | ||
| consta={ ...o}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Not sure why we were doing this...
| returneventSourceasunknownasEventSource&{ | ||
| closed:boolean; | ||
| emit:(eventName:string,data:unknown)=>void; | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Defining a proper type to keep biome happy
| * flagNames:'foo' | 'bar'; | ||
| * } | ||
| * } | ||
| */ | ||
| exportinterfaceUnleashTypes{} | ||
| exportinterfaceUnleashTypes{ | ||
| flagNames:string; | ||
| } | ||
| typeGetCustom<KextendsPropertyKey,Fallback>=KextendskeyofUnleashTypes | ||
| ?UnleashTypes[K] | ||
| :Fallback; | ||
| exporttypeName=GetCustom<'flagNames',string>; | ||
| exporttypeName=UnleashTypes['flagNames']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I had to fix this, asName was resolving to unknown type
| constres=awaitpost({ | ||
| url, | ||
| json:payload, | ||
| json:payloadasunknownasRecord<string,unknown>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
json is type Data (map of string to anything), while payload is restricted, so we can't send a type that restricts Data type
| }); | ||
| if(!res.ok){ | ||
| if(res.status===403||res.status==401){ | ||
| if(res.status===403||res.status===401){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Nice one, spotted by biome
chriswk left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thanks for taking the trouble to do this.
3342678 intomainUh oh!
There was an error while loading.Please reload this page.
About the changes