From 50e40f82d6e0d7e2db145905dffff5d5146112c5 Mon Sep 17 00:00:00 2001 From: Minggang Wang Date: Tue, 10 Dec 2024 12:52:48 +0800 Subject: [PATCH] Re-enable husky Fix: #1008 --- .husky/pre-commit | 1 + .npmignore | 1 + package.json | 29 ++++++++++++++++------------- 3 files changed, 18 insertions(+), 13 deletions(-) create mode 100644 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 00000000..c27d8893 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +lint-staged diff --git a/.npmignore b/.npmignore index 8e318c99..0643e8c2 100644 --- a/.npmignore +++ b/.npmignore @@ -23,3 +23,4 @@ tutorials/ .vscode/ .gitignore .prettierrc.yml +.husky/ diff --git a/package.json b/package.json index 3e628fd2..011e3a29 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,8 @@ "test": "node --expose-gc ./scripts/run_test.js && npm run dtslint", "dtslint": "node scripts/generate_tsd.js", "lint": "eslint --max-warnings=0 --ext js,ts index.js types scripts lib example rosidl_gen rosidl_parser test benchmark/rclnodejs && node ./scripts/cpplint.js", - "format": "clang-format -i -style=file ./src/*.cpp ./src/*.hpp && prettier --write \"{lib,rosidl_gen,rostsd_gen,rosidl_parser,types,example,test,scripts,benchmark}/**/*.{js,md,ts}\" ./*.{js,md,ts}" + "format": "clang-format -i -style=file ./src/*.cpp ./src/*.hpp && prettier --write \"{lib,rosidl_gen,rostsd_gen,rosidl_parser,types,example,test,scripts,benchmark}/**/*.{js,md,ts}\" ./*.{js,md,ts}", + "prepare": "husky" }, "bin": { "generate-ros-messages": "./scripts/generate_messages.js" @@ -41,26 +42,28 @@ "type": "git", "url": "git+https://github.com/RobotWebTools/rclnodejs.git" }, + "//": "Pin deep-equal to ^1.1.1", "devDependencies": { "@babel/eslint-parser": "^7.25.9", - "@typescript-eslint/eslint-plugin": "^6.21.0", - "@typescript-eslint/parser": "^6.21.0", + "@typescript-eslint/eslint-plugin": "^8.18.0", + "@typescript-eslint/parser": "^8.18.0", "babel-eslint": "^10.1.0", "clang-format": "^1.8.0", - "commander": "^11.1.0", + "commander": "^12.1.0", "deep-equal": "^1.1.1", - "eslint": "^8.57.1", + "eslint": "^9.16.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.2.1", - "husky": "^8.0.3", + "husky": "^9.1.7", "jsdoc": "^4.0.4", - "lint-staged": "^14.0.1", - "mocha": "^10.8.2", + "lint-staged": "^15.2.10", + "mocha": "^11.0.2", "prettier": "^3.4.2", - "sinon": "^15.2.0", + "sinon": "^19.0.2", "tree-kill": "^1.2.2", - "typescript": "^4.9.5" + "typescript": "^5.7.2" }, + "//": "Pin int64-napi to ^1.0.2", "dependencies": { "@rclnodejs/ref-array-di": "^1.2.2", "@rclnodejs/ref-napi": "^4.0.0", @@ -77,8 +80,8 @@ "mkdirp": "^3.0.1", "mz": "^2.7.0", "nan": "^2.22.0", - "rimraf": "^5.0.10", - "uuid": "^9.0.1", + "rimraf": "^6.0.1", + "uuid": "^11.0.3", "walk": "^2.3.15" }, "husky": { @@ -97,4 +100,4 @@ "engines": { "node": ">= 16.13.0" } -} \ No newline at end of file +}