diff --git a/lefthook.yml b/lefthook.yml new file mode 100644 index 0000000000..f3f0ec93fa --- /dev/null +++ b/lefthook.yml @@ -0,0 +1,42 @@ +pre-push: + parallel: false + piped: false + follow: false + commands: + lint: + run: pnpm lint-staged +# EXAMPLE USAGE: +# +# Refer for explanation to following link: +# https://github.com/evilmartians/lefthook/blob/master/docs/configuration.md +# +# pre-push: +# commands: +# packages-audit: +# tags: frontend security +# run: yarn audit +# gems-audit: +# tags: backend security +# run: bundle audit +# +# pre-commit: +# parallel: true +# commands: +# eslint: +# glob: "*.{js,ts,jsx,tsx}" +# run: yarn eslint {staged_files} +# rubocop: +# tags: backend style +# glob: "*.rb" +# exclude: '(^|/)(application|routes)\.rb$' +# run: bundle exec rubocop --force-exclusion {all_files} +# govet: +# tags: backend style +# files: git ls-files -m +# glob: "*.go" +# run: go vet {files} +# scripts: +# "hello.js": +# runner: node +# "any.go": +# runner: go run diff --git a/package.json b/package.json index 815e8c7d60..cb00f42fab 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@nivalis/eslint-config", "type": "module", "version": "3.5.0", - "packageManager": "pnpm@9.8.0+sha256.56a9e76b51796ca7f73b85e44cf83712862091f4d498c0ce4d5b7ecdc6ba18f7", + "packageManager": "pnpm@9.9.0+sha512.60c18acd138bff695d339be6ad13f7e936eea6745660d4cc4a776d5247c540d0edee1a563695c183a66eb917ef88f2b4feb1fc25f32a7adcadc7aaf3438e99c1", "description": "ESLint shareable flat config used at Nivalis Studio", "license": "MIT", "homepage": "https://github.com/nivalis-studio/eslint-config#readme", @@ -41,7 +41,6 @@ "prepublishOnly": "pnpm run build", "typegen": "pnpm dlx tsx@latest ./scripts/typegen.ts", "prepack": "pnpm run build", - "prepare": "simple-git-hooks", "ts": "tsc --noEmit" }, "peerDependencies": { @@ -79,15 +78,12 @@ "eslint": "9.9.1", "eslint-flat-config-utils": "^0.3.1", "eslint-typegen": "^0.3.1", + "lefthook": "1.7.14", "lint-staged": "^15.2.9", "prettier": "^3.3.3", - "simple-git-hooks": "^2.11.1", "tsup": "^8.2.4", "typescript": "^5.5.4" }, - "simple-git-hooks": { - "pre-commit": "pnpm lint-staged" - }, "lint-staged": { "*": "eslint --fix --no-warn-ignored --flag unstable_ts_config" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index abd3ce5fc8..bc46267701 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -90,15 +90,15 @@ importers: eslint-typegen: specifier: ^0.3.1 version: 0.3.1(eslint@9.9.1(jiti@1.21.6)) + lefthook: + specifier: 1.7.14 + version: 1.7.14 lint-staged: specifier: ^15.2.9 version: 15.2.9 prettier: specifier: ^3.3.3 version: 3.3.3 - simple-git-hooks: - specifier: ^2.11.1 - version: 2.11.1 tsup: specifier: ^8.2.4 version: 8.2.4(@swc/core@1.7.18)(jiti@1.21.6)(postcss@8.4.39)(tsx@4.16.2)(typescript@5.5.4)(yaml@2.5.0) @@ -1861,6 +1861,60 @@ packages: keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} + lefthook-darwin-arm64@1.7.14: + resolution: {integrity: sha512-3hNr04A8DSYZk0RBTdu8D/kkE3FHiNnexAEvuFOqLuf3EQhrrX1wxclGO0+tIk3s7nyh+iqpV69Xd+cb4Fnvpw==} + cpu: [arm64] + os: [darwin] + + lefthook-darwin-x64@1.7.14: + resolution: {integrity: sha512-cXVsxTS2IRKKRyYFEMjAxf0a/31M1PkiNAjlJPXQPoAxxC1rbsvkxWL8vXhH4P0AL18zSYVBf9aTktYArgQGuA==} + cpu: [x64] + os: [darwin] + + lefthook-freebsd-arm64@1.7.14: + resolution: {integrity: sha512-rhx2ZkbWD6SkOXLc5/xyN1fu0uL9MLYBYKKg5T0rLRVwqqr9aYKZ+1Rru/5oL8utH1qkQyiwQkcjnKkyHwSjPg==} + cpu: [arm64] + os: [freebsd] + + lefthook-freebsd-x64@1.7.14: + resolution: {integrity: sha512-WeVPDm7JB1Crchc7OQ3uLiRfLlhwwX3N2662DPguMresps2r79dUO97LhHMzd+l1RKIqZIgnU+j5fKFI+cmw4w==} + cpu: [x64] + os: [freebsd] + + lefthook-linux-arm64@1.7.14: + resolution: {integrity: sha512-IUvxJBfLDVComNc1Djk4VYUJsSAtdwfTvwpNxfaG2qb31VNvF6PPdp43bgpgqzV8O0KDCMm/sn0hlZ00GTuy2A==} + cpu: [arm64] + os: [linux] + + lefthook-linux-x64@1.7.14: + resolution: {integrity: sha512-jCNjVk+9iaFSwlFH4RM7SI05tpdty0vPzSTsABXUQwdmKdt1hPWhnUsEhCU03ik33UmpfmXUK9pLFgStT7W5rw==} + cpu: [x64] + os: [linux] + + lefthook-openbsd-arm64@1.7.14: + resolution: {integrity: sha512-Mq5GgjzDMiFin+Ucm52nizvvDQM1o+MnL/P+FDbBq253BIJGDJK+qEuQBgEQndE9bUyAP4qiHb+R6jz5fbpAlA==} + cpu: [arm64] + os: [openbsd] + + lefthook-openbsd-x64@1.7.14: + resolution: {integrity: sha512-enbPte9MAYU2JHkcvUBRJrXI6JMVcQqJHN+F8yKOJLFBnthoR0ZUuSTzqAMOivj/wgncHkYPqOWIo1UfB+HpGw==} + cpu: [x64] + os: [openbsd] + + lefthook-windows-arm64@1.7.14: + resolution: {integrity: sha512-M9QbTs+Je0SRKC2c/0X8OQsme6glFrKxQoxWMFCN02S6nNLiHqP4vsHphJFU+wnAwv4KE8I1YKT5iMxde0Ejlg==} + cpu: [arm64] + os: [win32] + + lefthook-windows-x64@1.7.14: + resolution: {integrity: sha512-40Mx+a44kPZUF/AXV45EIgw03FANTXMFDBR1Ib8qYbSaf1cWqJtfeQs9R5Ea0EdqxXkGprzwZ+yUFFjjfOFIoQ==} + cpu: [x64] + os: [win32] + + lefthook@1.7.14: + resolution: {integrity: sha512-GIMJm3HPksrHyXgu9OYX3r9QKM10hxoeiI45+7KhJKvAWChDtGqMZ5EPQuTMVsXu5IwggQL9QJLhDfk54WOXEw==} + hasBin: true + levn@0.4.1: resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} engines: {node: '>= 0.8.0'} @@ -2358,10 +2412,6 @@ packages: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} engines: {node: '>=14'} - simple-git-hooks@2.11.1: - resolution: {integrity: sha512-tgqwPUMDcNDhuf1Xf6KTUsyeqGdgKMhzaH4PAZZuzguOgTl5uuyeYe/8mWgAr6IBxB5V06uqEf6Dy37gIWDtDg==} - hasBin: true - slash@3.0.0: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} @@ -4550,6 +4600,49 @@ snapshots: dependencies: json-buffer: 3.0.1 + lefthook-darwin-arm64@1.7.14: + optional: true + + lefthook-darwin-x64@1.7.14: + optional: true + + lefthook-freebsd-arm64@1.7.14: + optional: true + + lefthook-freebsd-x64@1.7.14: + optional: true + + lefthook-linux-arm64@1.7.14: + optional: true + + lefthook-linux-x64@1.7.14: + optional: true + + lefthook-openbsd-arm64@1.7.14: + optional: true + + lefthook-openbsd-x64@1.7.14: + optional: true + + lefthook-windows-arm64@1.7.14: + optional: true + + lefthook-windows-x64@1.7.14: + optional: true + + lefthook@1.7.14: + optionalDependencies: + lefthook-darwin-arm64: 1.7.14 + lefthook-darwin-x64: 1.7.14 + lefthook-freebsd-arm64: 1.7.14 + lefthook-freebsd-x64: 1.7.14 + lefthook-linux-arm64: 1.7.14 + lefthook-linux-x64: 1.7.14 + lefthook-openbsd-arm64: 1.7.14 + lefthook-openbsd-x64: 1.7.14 + lefthook-windows-arm64: 1.7.14 + lefthook-windows-x64: 1.7.14 + levn@0.4.1: dependencies: prelude-ls: 1.2.1 @@ -5051,8 +5144,6 @@ snapshots: signal-exit@4.1.0: {} - simple-git-hooks@2.11.1: {} - slash@3.0.0: {} slashes@3.0.12: {}