Skip to content

Commit

Permalink
chore: add ts-eslint (#627)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB authored Apr 16, 2024
1 parent cdae42f commit 1c7a4c0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
16 changes: 16 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,22 @@
"rules": {
"no-console": "off"
}
},
{
"files": ["**/*.ts"],
"extends": ["plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"rules": {
"node/no-unsupported-features/es-syntax": "off"
}
},
{
"files": ["**/*.d.ts"],
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off"
}
}
]
}
6 changes: 3 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class Registry<RegistryContentType = PrometheusContentType> {
* @param labels of name/value pairs:
* { defaultLabel: "value", anotherLabel: "value 2" }
*/
setDefaultLabels(labels: Object): void;
setDefaultLabels(labels: object): void;

/**
* Get a string representation of a single metric by name
Expand Down Expand Up @@ -149,7 +149,7 @@ export class AggregatorRegistry<
* @return {Registry} aggregated registry.
*/
static aggregate<T extends RegistryContentType>(

Check warning on line 151 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v20.x and OS ubuntu-latest

'T' is already declared in the upper scope on line 133 column 2

Check warning on line 151 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v16.x and OS ubuntu-latest

'T' is already declared in the upper scope on line 133 column 2

Check warning on line 151 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v18.x and OS ubuntu-latest

'T' is already declared in the upper scope on line 133 column 2

Check warning on line 151 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v21.x and OS ubuntu-latest

'T' is already declared in the upper scope on line 133 column 2

Check warning on line 151 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v18.x and OS macOS-latest

'T' is already declared in the upper scope on line 133 column 2

Check warning on line 151 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v21.x and OS macOS-latest

'T' is already declared in the upper scope on line 133 column 2

Check warning on line 151 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v18.x and OS windows-latest

'T' is already declared in the upper scope on line 133 column 2

Check warning on line 151 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v16.x and OS windows-latest

'T' is already declared in the upper scope on line 133 column 2

Check warning on line 151 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v21.x and OS windows-latest

'T' is already declared in the upper scope on line 133 column 2

Check warning on line 151 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v20.x and OS windows-latest

'T' is already declared in the upper scope on line 133 column 2

Check warning on line 151 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v20.x and OS macOS-latest

'T' is already declared in the upper scope on line 133 column 2

Check warning on line 151 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v16.x and OS macOS-latest

'T' is already declared in the upper scope on line 133 column 2
metricsArr: Array<Object>,
metricsArr: Array<object>,
): Registry<T>; // TODO Promise?

/**
Expand Down Expand Up @@ -770,7 +770,7 @@ export interface DefaultMetricsCollectorConfiguration<
prefix?: string;
gcDurationBuckets?: number[];
eventLoopMonitoringPrecision?: number;
labels?: Object;
labels?: object;
}

export const collectDefaultMetrics: {
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
"homepage": "https://github.com/siimon/prom-client",
"devDependencies": {
"@clevernature/benchmark-regression": "^1.0.0",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"eslint": "^8.32.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-node": "^11.0.0",
Expand Down

0 comments on commit 1c7a4c0

Please sign in to comment.