From 8556c07378445fe205725747a6fa0da68f85f5fb Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Mon, 11 Nov 2024 16:56:06 +0100 Subject: [PATCH] install lint no-catch-all rule --- .eslintrc.js | 4 ++-- package-lock.json | 11 +++++++++++ package.json | 1 + 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index ad8b6e75..3c1e763b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -25,7 +25,7 @@ module.exports = { 'import', // 'promise', // 'security', - // 'no-catch-all', + 'no-catch-all', 'react', 'react-hooks', ], @@ -44,7 +44,7 @@ module.exports = { 'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks 'react-hooks/exhaustive-deps': 'warn', // Checks effect dependencies 'react/react-in-jsx-scope': 'off', // Disable requirement for React import - // 'no-catch-all/no-catch-all': 'error', + 'no-catch-all/no-catch-all': 'error', 'no-console': 'error', 'no-debugger': 'error', camelcase: 'error', diff --git a/package-lock.json b/package-lock.json index 74187848..da7b17b0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,6 +45,7 @@ "eslint-import-resolver-typescript": "^3.6.3", "eslint-plugin-import": "^2.31.0", "eslint-plugin-json": "^3.1.0", + "eslint-plugin-no-catch-all": "^1.1.0", "eslint-plugin-prettier": "^5.2.1", "eslint-plugin-react": "^7.31.8", "eslint-plugin-react-hooks": "^4.6.0", @@ -2371,6 +2372,16 @@ "node": ">=10" } }, + "node_modules/eslint-plugin-no-catch-all": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-no-catch-all/-/eslint-plugin-no-catch-all-1.1.0.tgz", + "integrity": "sha512-VkP62jLTmccPrFGN/W6V7a3SEwdtTZm+Su2k4T3uyJirtkm0OMMm97h7qd8pRFAHus/jQg9FpUpLRc7sAylBEQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "eslint": ">=2.0.0" + } + }, "node_modules/eslint-plugin-prettier": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.1.tgz", diff --git a/package.json b/package.json index 825bc7b7..a7b498dd 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "eslint-import-resolver-typescript": "^3.6.3", "eslint-plugin-import": "^2.31.0", "eslint-plugin-json": "^3.1.0", + "eslint-plugin-no-catch-all": "^1.1.0", "eslint-plugin-prettier": "^5.2.1", "eslint-plugin-react": "^7.31.8", "eslint-plugin-react-hooks": "^4.6.0",