From a72a2c335809145498ae663f388f9b7cf7823cfa Mon Sep 17 00:00:00 2001 From: Alix von Schirp Date: Tue, 15 Apr 2025 11:15:41 +0200 Subject: [PATCH] ci(pre-commit): Pre-commit hook now should no longer block commits Added eslint-plugin-only-warn to suppress errors Signed-off-by: Alix von Schirp --- eslint.config.mjs | 6 ++++++ package.json | 3 ++- pnpm-lock.yaml | 9 +++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index af6150b..c99bc9f 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -2,6 +2,7 @@ import globals from "globals"; import pluginJs from "@eslint/js"; import tseslint from "typescript-eslint"; import eslintConfigPrettier from "eslint-config-prettier"; +import onlyWarn from "eslint-plugin-only-warn"; /** @type {import('eslint').Linter.Config[]} */ export default [ @@ -11,4 +12,9 @@ export default [ pluginJs.configs.recommended, ...tseslint.configs.recommended, eslintConfigPrettier, + { + plugins: { + onlyWarn, + }, + }, ]; diff --git a/package.json b/package.json index 5b72583..a5ff346 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "@types/node": "^22.13.10", "eslint": "^9.22.0", "eslint-config-prettier": "^10.1.1", + "eslint-plugin-only-warn": "^1.1.0", "finepack": "^2.12.7", "globals": "^16.0.0", "husky": "^9.1.7", @@ -65,7 +66,7 @@ }, "lint-staged": { "package.json": "finepack", - "*.{js,ts,jsx,tsx}": "cmd /c eslint --cache --fix . || exit 0", + "*.{js,ts,jsx,tsx}": "eslint --cache --fix .", "*.{js,ts,jsx,tsx,json,css,md}": "prettier --write" }, "type": "module" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c4dc941..3b4d3da 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -27,6 +27,9 @@ importers: eslint-config-prettier: specifier: ^10.1.1 version: 10.1.1(eslint@9.22.0) + eslint-plugin-only-warn: + specifier: ^1.1.0 + version: 1.1.0 finepack: specifier: ^2.12.7 version: 2.12.7 @@ -413,6 +416,10 @@ packages: peerDependencies: eslint: '>=7.0.0' + eslint-plugin-only-warn@1.1.0: + resolution: {integrity: sha512-2tktqUAT+Q3hCAU0iSf4xAN1k9zOpjK5WO8104mB0rT/dGhOa09582HN5HlbxNbPRZ0THV7nLGvzugcNOSjzfA==} + engines: {node: '>=6'} + eslint-scope@8.3.0: resolution: {integrity: sha512-pUNxi75F8MJ/GdeKtVLSbYg4ZI34J6C0C7sbL4YOp2exGwen7ZsuBqKzUhXd0qMQ362yET3z+uPwKeg/0C2XCQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -1532,6 +1539,8 @@ snapshots: dependencies: eslint: 9.22.0 + eslint-plugin-only-warn@1.1.0: {} + eslint-scope@8.3.0: dependencies: esrecurse: 4.3.0