Skip to content

Commit 9dec7bb

Browse files
authored
chore: update prettier and husky (#635)
1 parent 5a0c6d3 commit 9dec7bb

File tree

6 files changed

+14
-17
lines changed

6 files changed

+14
-17
lines changed

.eslintrc

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"plugins": ["prettier"],
33
"extends": [
44
"eslint:recommended",
5-
"plugin:node/recommended",
5+
"plugin:n/recommended",
66
"plugin:prettier/recommended"
77
],
88
"env": {
@@ -78,7 +78,7 @@
7878
"rules": {
7979
"no-shadow": "off",
8080
"@typescript-eslint/no-shadow": "warn",
81-
"node/no-unsupported-features/es-syntax": "off"
81+
"n/no-unsupported-features/es-syntax": "off"
8282
}
8383
},
8484
{

.husky/pre-commit

-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
3-
41
npx --no-install lint-staged

benchmarks/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ benchmarks.suite('gauge', require('./gauge'));
1414
benchmarks.suite('summary', require('./summary'));
1515
benchmarks.run().catch(err => {
1616
console.error(err.stack);
17-
// eslint-disable-next-line no-process-exit
17+
// eslint-disable-next-line n/no-process-exit
1818
process.exit(1);
1919
});

lib/metrics/eventLoopLag.js

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ const Gauge = require('../gauge');
55
// Check if perf_hooks module is available
66
let perf_hooks;
77
try {
8-
/* eslint-disable node/no-unsupported-features/node-builtins */
98
perf_hooks = require('perf_hooks');
109
} catch {
1110
// node version is too old

lib/pushgateway.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class Pushgateway {
4747
}
4848
async function useGateway(method, job, groupings) {
4949
// `URL` first added in v6.13.0
50-
// eslint-disable-next-line node/no-deprecated-api
50+
// eslint-disable-next-line n/no-deprecated-api
5151
const gatewayUrlParsed = url.parse(this.gatewayUrl);
5252
const gatewayUrlPath =
5353
gatewayUrlParsed.pathname && gatewayUrlParsed.pathname !== '/'
@@ -58,9 +58,9 @@ async function useGateway(method, job, groupings) {
5858
: '';
5959
const path = `${gatewayUrlPath}/metrics${jobPath}`;
6060

61-
// eslint-disable-next-line node/no-deprecated-api
61+
// eslint-disable-next-line n/no-deprecated-api
6262
const target = url.resolve(this.gatewayUrl, path);
63-
// eslint-disable-next-line node/no-deprecated-api
63+
// eslint-disable-next-line n/no-deprecated-api
6464
const requestParams = url.parse(target);
6565
const httpModule = isHttps(requestParams.href) ? https : http;
6666
const options = Object.assign(requestParams, this.requestOptions, {

package.json

+8-7
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"test-unit": "jest",
1919
"run-prettier": "prettier . .eslintrc",
2020
"check-prettier": "npm run run-prettier -- --check",
21-
"compile-typescript": "tsc --project ."
21+
"compile-typescript": "tsc --project .",
22+
"prepare": "husky"
2223
},
2324
"repository": {
2425
"type": "git",
@@ -38,14 +39,14 @@
3839
"@typescript-eslint/parser": "^6.21.0",
3940
"eslint": "^8.32.0",
4041
"eslint-config-prettier": "^9.1.0",
41-
"eslint-plugin-node": "^11.0.0",
42+
"eslint-plugin-n": "^16.0.0",
4243
"eslint-plugin-prettier": "^5.0.1",
4344
"express": "^4.13.3",
44-
"husky": "^8.0.3",
45+
"husky": "^9.0.0",
4546
"jest": "^29.3.1",
4647
"lint-staged": "^13.1.0",
4748
"nock": "^13.0.5",
48-
"prettier": "3.1.1",
49+
"prettier": "3.3.2",
4950
"typescript": "^5.0.4"
5051
},
5152
"dependencies": {
@@ -58,9 +59,9 @@
5859
"testRegex": ".*Test\\.js$"
5960
},
6061
"lint-staged": {
61-
"*.js": "eslint --fix",
62-
"*.{ts,md,json,yml}": "prettier --write",
63-
".{eslintrc,travis.yml}": "prettier --write"
62+
"*.{js,ts}": "eslint --fix",
63+
"*.{md,json,yml}": "prettier --write",
64+
".travis.yml": "prettier --write"
6465
},
6566
"prettier": {
6667
"singleQuote": true,

0 commit comments

Comments
 (0)