Skip to content

Commit 6b1efb3

Browse files
authored
chore: fix workflow os matrix (#96)
1 parent 63510c4 commit 6b1efb3

File tree

11 files changed

+97
-88
lines changed

11 files changed

+97
-88
lines changed

.eslintignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.eslintrc

Lines changed: 0 additions & 10 deletions
This file was deleted.

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/workflows/test.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ on:
66

77
jobs:
88
build:
9-
runs-on: ubuntu-latest
109
strategy:
1110
matrix:
1211
os: [ubuntu-latest, macOS-latest, windows-latest]
13-
node-version: [18.x, 20.x]
12+
node-version: [18, 20]
13+
runs-on: ${{ matrix.os }}
14+
1415
steps:
1516
- uses: actions/checkout@v4
1617

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
package-lock=false
2+
save-exact=true

.prettierrc

Lines changed: 0 additions & 15 deletions
This file was deleted.

.prettierrc.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"singleQuote": false,
3+
"trailingComma": "all",
4+
"useTabs": true,
5+
"printWidth": 120,
6+
"overrides": [
7+
{
8+
"files": ["*.yml", "*.json"],
9+
"options": {
10+
"tabWidth": 2,
11+
"useTabs": false
12+
}
13+
}
14+
]
15+
}

eslint.config.mjs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import prettierConfig from "eslint-config-prettier";
2+
import prettierPlugin from "eslint-plugin-prettier/recommended";
3+
import globals from "globals";
4+
import js from "@eslint/js";
5+
6+
export default [
7+
js.configs.recommended,
8+
prettierConfig,
9+
prettierPlugin,
10+
{
11+
languageOptions: {
12+
globals: {
13+
...globals.node,
14+
...globals.browser,
15+
global: true,
16+
},
17+
},
18+
},
19+
{
20+
ignores: ["coverage/*", "dist/*"],
21+
},
22+
];

lib/client.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"use strict";
22

3-
/* eslint-disable no-underscore-dangle */
43
/* eslint prefer-rest-params: "off" */
54

65
const timeSpan = require("time-span");
@@ -49,7 +48,7 @@ const MetricsClient = class MetricsClient extends stream.Transform {
4948
[push](metric) {
5049
const met = metric;
5150
met.source = this.id;
52-
// eslint-disable-next-line no-underscore-dangle
51+
5352
if (this._readableState.flowing) {
5453
this.push(met);
5554
return;

package.json

Lines changed: 51 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,53 @@
11
{
2-
"name": "@metrics/client",
3-
"version": "2.5.2",
4-
"description": "A streaming metric producer. Allows producing counters, gauges, histograms and summaries in a way that is independent of your metrics system.",
5-
"main": "lib/client.js",
6-
"types": "client.d.ts",
7-
"files": [
8-
"lib",
9-
"client.d.ts"
10-
],
11-
"scripts": {
12-
"bench": "node benchmark/benchmark.js",
13-
"test": "tap test/*.js --disable-coverage --allow-empty-coverage",
14-
"test:coverage": "tap test/*.js",
15-
"lint": "eslint .",
16-
"lint:fix": "eslint . --fix"
17-
},
18-
"author": "Richard Walker <[email protected]>",
19-
"license": "MIT",
20-
"keywords": [
21-
"server-statistics",
22-
"server-stats",
23-
"statistics",
24-
"metrics",
25-
"monitoring"
26-
],
27-
"dependencies": {
28-
"@metrics/metric": "^2.3.2",
29-
"readable-stream": "^3.4.0",
30-
"time-span": "^4.0.0"
31-
},
32-
"devDependencies": {
33-
"@semantic-release/changelog": "6.0.3",
34-
"@semantic-release/commit-analyzer": "11.1.0",
35-
"@semantic-release/git": "10.0.1",
36-
"@semantic-release/github": "9.2.6",
37-
"@semantic-release/npm": "11.0.3",
38-
"@semantic-release/release-notes-generator": "12.1.0",
39-
"@sinonjs/fake-timers": "11.2.2",
40-
"benchmark": "2.1.4",
41-
"eslint": "8.57.0",
42-
"eslint-config-prettier": "9.1.0",
43-
"eslint-plugin-prettier": "5.1.3",
44-
"prettier": "3.2.5",
45-
"semantic-release": "23.0.2",
46-
"tap": "18.7.1"
47-
},
48-
"repository": {
49-
"type": "git",
50-
"url": "https://github.com/metrics-js/client.git"
51-
}
2+
"name": "@metrics/client",
3+
"version": "2.5.2",
4+
"description": "A streaming metric producer. Allows producing counters, gauges, histograms and summaries in a way that is independent of your metrics system.",
5+
"main": "lib/client.js",
6+
"types": "client.d.ts",
7+
"files": [
8+
"lib",
9+
"client.d.ts"
10+
],
11+
"scripts": {
12+
"bench": "node benchmark/benchmark.js",
13+
"test": "tap test/*.js --disable-coverage --allow-empty-coverage",
14+
"test:coverage": "tap test/*.js",
15+
"lint": "eslint .",
16+
"lint:fix": "eslint . --fix"
17+
},
18+
"author": "Richard Walker <[email protected]>",
19+
"license": "MIT",
20+
"keywords": [
21+
"server-statistics",
22+
"server-stats",
23+
"statistics",
24+
"metrics",
25+
"monitoring"
26+
],
27+
"dependencies": {
28+
"@metrics/metric": "^2.3.2",
29+
"readable-stream": "^3.4.0",
30+
"time-span": "^4.0.0"
31+
},
32+
"devDependencies": {
33+
"@semantic-release/changelog": "6.0.3",
34+
"@semantic-release/commit-analyzer": "11.1.0",
35+
"@semantic-release/git": "10.0.1",
36+
"@semantic-release/github": "9.2.6",
37+
"@semantic-release/npm": "11.0.3",
38+
"@semantic-release/release-notes-generator": "12.1.0",
39+
"@sinonjs/fake-timers": "11.2.2",
40+
"benchmark": "2.1.4",
41+
"eslint": "9.6.0",
42+
"eslint-config-prettier": "9.1.0",
43+
"eslint-plugin-prettier": "5.1.3",
44+
"globals": "15.8.0",
45+
"prettier": "3.2.5",
46+
"semantic-release": "23.0.2",
47+
"tap": "18.7.1"
48+
},
49+
"repository": {
50+
"type": "git",
51+
"url": "https://github.com/metrics-js/client.git"
52+
}
5253
}

test/client.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
"use strict";
22

3-
/* eslint-disable no-console */
4-
53
const stream = require("readable-stream");
64
const fakeTimers = require("@sinonjs/fake-timers");
75
const tap = require("tap");
@@ -170,7 +168,6 @@ tap.test("client.metric() - metrics is not piped anywhere - should not fill stre
170168
});
171169
}
172170

173-
// eslint-disable-next-line no-underscore-dangle
174171
t.equal(client._readableState.buffer.length, 0);
175172
t.end();
176173
});
@@ -185,7 +182,7 @@ tap.test("client.metric() - destination is buffering - should emit drop events",
185182
const dest = destObjectStream((result) => {
186183
t.equal(result.length, 16);
187184
t.equal(dropped.length, 4);
188-
// eslint-disable-next-line no-underscore-dangle
185+
189186
t.equal(client._readableState.buffer.length, 0);
190187
t.end();
191188
});
@@ -203,7 +200,6 @@ tap.test("client.metric() - destination is buffering - should emit drop events",
203200
});
204201
}
205202

206-
// eslint-disable-next-line no-underscore-dangle
207203
t.equal(client._readableState.buffer.length, 0);
208204

209205
setImmediate(() => {
@@ -219,9 +215,9 @@ tap.test("client.pipe() - pipe streams into each other - should pipe metrics thr
219215
t.equal(result.length, 3);
220216
t.equal(result[0].name, "first");
221217
t.equal(result[2].name, "third");
222-
// eslint-disable-next-line no-underscore-dangle
218+
223219
t.equal(clientA._readableState.buffer.length, 0);
224-
// eslint-disable-next-line no-underscore-dangle
220+
225221
t.equal(clientB._readableState.buffer.length, 0);
226222
t.end();
227223
});

0 commit comments

Comments
 (0)