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

chore: fix lint errors in TS file #630

Merged
merged 2 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"rules": {
"no-shadow": "off",
"@typescript-eslint/no-shadow": "warn",
"node/no-unsupported-features/es-syntax": "off"
}
},
Expand Down
8 changes: 5 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ export type RegistryContentType =
/**
* Container for all registered metrics
*/
export class Registry<RegistryContentType = PrometheusContentType> {
export class Registry<
BoundRegistryContentType extends RegistryContentType = PrometheusContentType,
> {
/**
* Get string representation for all metrics
*/
Expand Down Expand Up @@ -81,14 +83,14 @@ export class Registry<RegistryContentType = PrometheusContentType> {
/**
* Gets the Content-Type of the metrics for use in the response headers.
*/
readonly contentType: RegistryContentType;
readonly contentType: BoundRegistryContentType;

/**
* Set the content type of a registry. Used to change between Prometheus and
* OpenMetrics versions.
* @param contentType The type of the registry
*/
setContentType(contentType: RegistryContentType): void;
setContentType(contentType: BoundRegistryContentType): void;

/**
* Merge registers
Expand Down
Loading