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: update prettier and husky #635

Merged
merged 2 commits into from
Jun 22, 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
4 changes: 2 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"plugins": ["prettier"],
"extends": [
"eslint:recommended",
"plugin:node/recommended",
"plugin:n/recommended",
"plugin:prettier/recommended"
],
"env": {
Expand Down Expand Up @@ -78,7 +78,7 @@
"rules": {
"no-shadow": "off",
"@typescript-eslint/no-shadow": "warn",
"node/no-unsupported-features/es-syntax": "off"
"n/no-unsupported-features/es-syntax": "off"
}
},
{
Expand Down
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no-install lint-staged
2 changes: 1 addition & 1 deletion benchmarks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ benchmarks.suite('gauge', require('./gauge'));
benchmarks.suite('summary', require('./summary'));
benchmarks.run().catch(err => {
console.error(err.stack);
// eslint-disable-next-line no-process-exit
// eslint-disable-next-line n/no-process-exit
process.exit(1);
});
1 change: 0 additions & 1 deletion lib/metrics/eventLoopLag.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const Gauge = require('../gauge');
// Check if perf_hooks module is available
let perf_hooks;
try {
/* eslint-disable node/no-unsupported-features/node-builtins */
perf_hooks = require('perf_hooks');
} catch {
// node version is too old
Expand Down
6 changes: 3 additions & 3 deletions lib/pushgateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Pushgateway {
}
async function useGateway(method, job, groupings) {
// `URL` first added in v6.13.0
// eslint-disable-next-line node/no-deprecated-api
// eslint-disable-next-line n/no-deprecated-api
const gatewayUrlParsed = url.parse(this.gatewayUrl);
const gatewayUrlPath =
gatewayUrlParsed.pathname && gatewayUrlParsed.pathname !== '/'
Expand All @@ -58,9 +58,9 @@ async function useGateway(method, job, groupings) {
: '';
const path = `${gatewayUrlPath}/metrics${jobPath}`;

// eslint-disable-next-line node/no-deprecated-api
// eslint-disable-next-line n/no-deprecated-api
const target = url.resolve(this.gatewayUrl, path);
// eslint-disable-next-line node/no-deprecated-api
// eslint-disable-next-line n/no-deprecated-api
const requestParams = url.parse(target);
const httpModule = isHttps(requestParams.href) ? https : http;
const options = Object.assign(requestParams, this.requestOptions, {
Expand Down
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"test-unit": "jest",
"run-prettier": "prettier . .eslintrc",
"check-prettier": "npm run run-prettier -- --check",
"compile-typescript": "tsc --project ."
"compile-typescript": "tsc --project .",
"prepare": "husky"
},
"repository": {
"type": "git",
Expand All @@ -38,14 +39,14 @@
"@typescript-eslint/parser": "^6.21.0",
"eslint": "^8.32.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-n": "^16.0.0",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

17 is the latest, but that dropped support for Node 16

"eslint-plugin-prettier": "^5.0.1",
"express": "^4.13.3",
"husky": "^8.0.3",
"husky": "^9.0.0",
"jest": "^29.3.1",
"lint-staged": "^13.1.0",
"nock": "^13.0.5",
"prettier": "3.1.1",
"prettier": "3.3.2",
"typescript": "^5.0.4"
},
"dependencies": {
Expand All @@ -58,9 +59,9 @@
"testRegex": ".*Test\\.js$"
},
"lint-staged": {
"*.js": "eslint --fix",
"*.{ts,md,json,yml}": "prettier --write",
".{eslintrc,travis.yml}": "prettier --write"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, oops - I deleted the wrong entry 😅

"*.{js,ts}": "eslint --fix",
"*.{md,json,yml}": "prettier --write",
".travis.yml": "prettier --write"
},
"prettier": {
"singleQuote": true,
Expand Down
Loading