-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: Support custom toml
file path
#19
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
export class VersionInfo { | ||
constructor( | ||
public major: number, | ||
public minor: number, | ||
public patch: number | ||
) {} | ||
|
||
toString(): string { | ||
return `${this.major}.${this.minor}.${this.patch}`; | ||
} | ||
} | ||
|
||
function versionGte(a: VersionInfo, b: VersionInfo): boolean { | ||
if (a.major !== b.major) { | ||
return a.major > b.major; | ||
} | ||
if (a.minor !== b.minor) { | ||
return a.minor > b.minor; | ||
} | ||
return a.patch >= b.patch; | ||
} | ||
|
||
const MIN_VERSION_WITH_CONFIG = { | ||
major: 0, | ||
minor: 24, | ||
patch: 0, | ||
}; | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn't seem we enforce any type of formatting? Mind if I do a quick follow-up adding Biome? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah that works for me 👍 I've typically used prettier but Biome looks good. |
||
|
||
export function supportsCustomConfig(version: VersionInfo): boolean { | ||
return versionGte(version, MIN_VERSION_WITH_CONFIG); | ||
} |
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.
We'll tweak this before merging.