Skip to content

Commit

Permalink
feat(lint): upgrade eslint and rules
Browse files Browse the repository at this point in the history
  • Loading branch information
SkeLLLa committed Sep 20, 2024
1 parent d749d99 commit a840e5e
Show file tree
Hide file tree
Showing 65 changed files with 1,402 additions and 1,301 deletions.
11 changes: 0 additions & 11 deletions .eslintignore

This file was deleted.

49 changes: 0 additions & 49 deletions .eslintrc.js

This file was deleted.

28 changes: 28 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module.exports = {
$schema: 'http://json.schemastore.org/prettierrc',
trailingComma: 'all',
useTabs: false,
tabWidth: 2,
semi: true,
singleQuote: true,
quoteProps: 'consistent',
arrowParens: 'always',
bracketSpacing: true,
endOfLine: 'lf',
printWidth: 80,
plugins: [
require.resolve('prettier-plugin-packagejson'),
require.resolve('prettier-plugin-jsdoc'),
require.resolve('prettier-plugin-sort-json'),
require.resolve('@ianvs/prettier-plugin-sort-imports'),
require.resolve('prettier-plugin-sh'),
],
importOrder: [
'<BUILTIN_MODULES>', // Node.js built-in modules
'<THIRD_PARTY_MODULES>', // Imports not matched by other special words or groups.
'^[.]', // relative imports
],
importOrderParserPlugins: ['typescript', 'jsx', 'decorators-legacy'],
importOrderTypeScriptVersion: '5.6.2',
jsonRecursiveSort: true,
};
20 changes: 0 additions & 20 deletions .prettierrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion docs/api/fastify-metrics._default.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Metric plugin

<b>Signature:</b>
**Signature:**

```typescript
_default: import('fastify').FastifyPluginCallback<
Expand Down
2 changes: 1 addition & 1 deletion docs/api/fastify-metrics.idefaultmetricsconfig.enabled.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Enables collection of default prom-client metrics (e.g. node.js vitals like cpu, memory, etc.)

<b>Signature:</b>
**Signature:**

```typescript
enabled: boolean;
Expand Down
40 changes: 35 additions & 5 deletions docs/api/fastify-metrics.idefaultmetricsconfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,50 @@

Default prom-client metrics config

<b>Signature:</b>
**Signature:**

```typescript
export interface IDefaultMetricsConfig extends DefaultMetricsCollectorConfiguration<'text/plain; version=0.0.4; charset=utf-8'>
```
<b>Extends:</b> DefaultMetricsCollectorConfiguration&lt;'text/plain; version=0.0.4; charset=utf-8'&gt;
**Extends:** DefaultMetricsCollectorConfiguration&lt;'text/plain; version=0.0.4; charset=utf-8'&gt;
## Remarks
Extends the [prom-client](https://github.com/siimon/prom-client#default-metrics) interface. So it accepts all options from it and pass to default metrics.
## Properties
| Property | Modifiers | Type | Description |
| ------------------------------------------------------------- | --------- | ------- | ---------------------------------------------------------------------------------------------- |
| [enabled](./fastify-metrics.idefaultmetricsconfig.enabled.md) | | boolean | Enables collection of default prom-client metrics (e.g. node.js vitals like cpu, memory, etc.) |
<table><thead><tr><th>
Property
</th><th>
Modifiers
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
[enabled](./fastify-metrics.idefaultmetricsconfig.enabled.md)
</td><td>
</td><td>
boolean
</td><td>
Enables collection of default prom-client metrics (e.g. node.js vitals like cpu, memory, etc.)
</td></tr>
</tbody></table>
2 changes: 1 addition & 1 deletion docs/api/fastify-metrics.ifastifymetrics.client.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Prom-client instance

<b>Signature:</b>
**Signature:**

```typescript
client: typeof client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

Initialize metrics in registries. Useful if you call `registry.clear()` to register metrics in regisitries once again

<b>Signature:</b>
**Signature:**

```typescript
initMetricsInRegistry(): void;
```

<b>Returns:</b>
**Returns:**

void
60 changes: 53 additions & 7 deletions docs/api/fastify-metrics.ifastifymetrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,66 @@

Plugin decorator

<b>Signature:</b>
**Signature:**

```typescript
export interface IFastifyMetrics
```

## Properties

| Property | Modifiers | Type | Description |
| ----------------------------------------------------- | --------- | ------------- | -------------------- |
| [client](./fastify-metrics.ifastifymetrics.client.md) | | typeof client | Prom-client instance |
<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

[client](./fastify-metrics.ifastifymetrics.client.md)

</td><td>

</td><td>

typeof client

</td><td>

Prom-client instance

</td></tr>
</tbody></table>

## Methods

| Method | Description |
| ------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| [initMetricsInRegistry()](./fastify-metrics.ifastifymetrics.initmetricsinregistry.md) | Initialize metrics in registries. Useful if you call <code>registry.clear()</code> to register metrics in regisitries once again |
<table><thead><tr><th>

Method

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

[initMetricsInRegistry()](./fastify-metrics.ifastifymetrics.initmetricsinregistry.md)

</td><td>

Initialize metrics in registries. Useful if you call `registry.clear()` to register metrics in regisitries once again

</td></tr>
</tbody></table>
2 changes: 1 addition & 1 deletion docs/api/fastify-metrics.ihistogramoverrides.buckets.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Request duration buckets override

<b>Signature:</b>
**Signature:**

```typescript
buckets?: number[];
Expand Down
2 changes: 1 addition & 1 deletion docs/api/fastify-metrics.ihistogramoverrides.help.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Request duration histogram help override

<b>Signature:</b>
**Signature:**

```typescript
help?: string;
Expand Down
72 changes: 65 additions & 7 deletions docs/api/fastify-metrics.ihistogramoverrides.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,76 @@

Request time histofram config overrides

<b>Signature:</b>
**Signature:**

```typescript
export interface IHistogramOverrides extends Partial<HistogramConfiguration<string>>
```
<b>Extends:</b> Partial&lt;HistogramConfiguration&lt;string&gt;&gt;
**Extends:** Partial&lt;HistogramConfiguration&lt;string&gt;&gt;
## Properties
| Property | Modifiers | Type | Description |
| ------------------------------------------------------------ | --------- | ---------- | ---------------------------------------------------------- |
| [buckets?](./fastify-metrics.ihistogramoverrides.buckets.md) | | number\[\] | <i>(Optional)</i> Request duration buckets override |
| [help?](./fastify-metrics.ihistogramoverrides.help.md) | | string | <i>(Optional)</i> Request duration histogram help override |
| [name?](./fastify-metrics.ihistogramoverrides.name.md) | | string | <i>(Optional)</i> Request duration histogram name override |
<table><thead><tr><th>
Property
</th><th>
Modifiers
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
[buckets?](./fastify-metrics.ihistogramoverrides.buckets.md)
</td><td>
</td><td>
number\[\]
</td><td>
_(Optional)_ Request duration buckets override
</td></tr>
<tr><td>
[help?](./fastify-metrics.ihistogramoverrides.help.md)
</td><td>
</td><td>
string
</td><td>
_(Optional)_ Request duration histogram help override
</td></tr>
<tr><td>
[name?](./fastify-metrics.ihistogramoverrides.name.md)
</td><td>
</td><td>
string
</td><td>
_(Optional)_ Request duration histogram name override
</td></tr>
</tbody></table>
2 changes: 1 addition & 1 deletion docs/api/fastify-metrics.ihistogramoverrides.name.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Request duration histogram name override

<b>Signature:</b>
**Signature:**

```typescript
name?: string;
Expand Down
Loading

0 comments on commit a840e5e

Please sign in to comment.