From df1eb5e65f0260fb4f8940471baaf6209f3375e4 Mon Sep 17 00:00:00 2001 From: Sachin Kumar Date: Sun, 28 Jul 2024 20:17:10 +0530 Subject: [PATCH] chore: update husky hooks --- .husky/commit-msg | 1 + .husky/pre-commit | 1 + package-lock.json | 14 +++++++++----- package.json | 4 ++-- types/linter.d.ts | 8 ++++---- 5 files changed, 17 insertions(+), 11 deletions(-) create mode 100644 .husky/commit-msg create mode 100644 .husky/pre-commit diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100644 index 0000000..7069882 --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1 @@ +commitlint --edit $1 \ No newline at end of file diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..af5adff --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +lint-staged \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index aa0adaf..c3b1ceb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,7 +38,7 @@ "eslint-config-prettier": "^9.1.0", "eslint-plugin-import": "^2.29.1", "fs-extra": "^11.2.0", - "husky": "^8.0.3", + "husky": "^9.1.3", "jest": "^29.7.0", "lint-staged": "^15.2.7", "npm-run-all": "^4.1.5", @@ -9223,14 +9223,16 @@ } }, "node_modules/husky": { - "version": "8.0.3", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.3.tgz", + "integrity": "sha512-ET3TQmQgdIu0pt+jKkpo5oGyg/4MQZpG6xcam5J5JyNJV+CBT23OBpCF15bKHKycRyMH9k6ONy8g2HdGIsSkMQ==", "dev": true, "license": "MIT", "bin": { - "husky": "lib/bin.js" + "husky": "bin.js" }, "engines": { - "node": ">=14" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/typicode" @@ -20603,7 +20605,9 @@ "dev": true }, "husky": { - "version": "8.0.3", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.3.tgz", + "integrity": "sha512-ET3TQmQgdIu0pt+jKkpo5oGyg/4MQZpG6xcam5J5JyNJV+CBT23OBpCF15bKHKycRyMH9k6ONy8g2HdGIsSkMQ==", "dev": true }, "ignore": { diff --git a/package.json b/package.json index fdbe3f7..3343c20 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "test:coverage": "npm run test:only -- --collectCoverageFrom=\"src/**/*.js\" --coverage", "pretest": "npm run lint", "test": "npm run test:coverage", - "prepare": "npm run build", + "prepare": "husky && npm run build", "release": "standard-version" }, "files": [ @@ -79,7 +79,7 @@ "eslint-config-prettier": "^9.1.0", "eslint-plugin-import": "^2.29.1", "fs-extra": "^11.2.0", - "husky": "^8.0.3", + "husky": "^9.1.3", "jest": "^29.7.0", "lint-staged": "^15.2.7", "npm-run-all": "^4.1.5", diff --git a/types/linter.d.ts b/types/linter.d.ts index af07836..977999a 100644 --- a/types/linter.d.ts +++ b/types/linter.d.ts @@ -30,14 +30,12 @@ declare namespace linter { LintResultMap, }; } -type Options = import('./options').Options; -type Compilation = import('webpack').Compilation; -type Linter = (files: string | string[]) => void; -type Reporter = () => Promise; type ESLint = import('eslint').ESLint; type Formatter = import('eslint').ESLint.Formatter; type LintResult = import('eslint').ESLint.LintResult; type Compiler = import('webpack').Compiler; +type Compilation = import('webpack').Compilation; +type Options = import('./options').Options; type FormatterFunction = import('./options').FormatterFunction; type GenerateReport = (compilation: Compilation) => Promise; type Report = { @@ -45,6 +43,8 @@ type Report = { warnings?: ESLintError; generateReportAsset?: GenerateReport; }; +type Reporter = () => Promise; +type Linter = (files: string | string[]) => void; type LintResultMap = { [files: string]: LintResult; };