From 5dfa10d83735f7abbda2605768940d82a38566d0 Mon Sep 17 00:00:00 2001 From: syunta Date: Mon, 5 Aug 2024 15:51:27 +0900 Subject: [PATCH 1/4] react/prop-types off --- rules/react.js | 1 + 1 file changed, 1 insertion(+) diff --git a/rules/react.js b/rules/react.js index c0b024e..8effc84 100644 --- a/rules/react.js +++ b/rules/react.js @@ -58,6 +58,7 @@ module.exports = [ 'react/jsx-no-useless-fragment': ['error', { allowExpressions: true }], 'react/jsx-pascal-case': 'error', 'react/self-closing-comp': 'error', + 'react/prop-types': 'off', }, }, ]; From 8b312c4fe2e850cb3d1b6f151fea5c8b8e23b63e Mon Sep 17 00:00:00 2001 From: syunta Date: Mon, 5 Aug 2024 16:43:48 +0900 Subject: [PATCH 2/4] Add caughtErrors rule --- rules/base.js | 5 ++++- tests/rules/javascript/sample.js | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/rules/base.js b/rules/base.js index f138dbe..69dd250 100644 --- a/rules/base.js +++ b/rules/base.js @@ -14,7 +14,10 @@ module.exports = [ }, rules: { ...jsLint.configs.recommended.rules, - 'no-unused-vars': ['error', { argsIgnorePattern: '^_+$' }], + 'no-unused-vars': [ + 'error', + { argsIgnorePattern: '^_+$', caughtErrors: 'all', caughtErrorsIgnorePattern: '^_+$' }, + ], 'no-param-reassign': 'error', 'arrow-body-style': 'error', 'constructor-super': 'error', diff --git a/tests/rules/javascript/sample.js b/tests/rules/javascript/sample.js index 4f05526..0447670 100644 --- a/tests/rules/javascript/sample.js +++ b/tests/rules/javascript/sample.js @@ -17,6 +17,13 @@ while (false) { const f = (x, _) => x; f(1, 2); +// for 'no-unused-vars': ['error', { caughtErrors: 'all', caughtErrorsIgnorePattern: '^_+$' }], +try { + f(2, 3); +} catch(_) { + doSomething(10); +} + // for 'arrow-body-style': 'error', const g = () => { return 10; From 92be7db7f9711c2ffda663642a0a520dec442a12 Mon Sep 17 00:00:00 2001 From: syunta Date: Mon, 5 Aug 2024 16:51:54 +0900 Subject: [PATCH 3/4] chore(release): 2.1.1 --- CHANGELOG.md | 2 ++ package.json | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2b0877..31102be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [2.1.1](https://github.com/toyokumo/eslint-config/compare/v2.1.0...v2.1.1) (2024-08-05) + ## [2.1.0](https://github.com/toyokumo/eslint-config/compare/v2.0.14...v2.1.0) (2024-08-05) ### [2.0.14](https://github.com/toyokumo/eslint-config/compare/v2.0.13...v2.0.14) (2024-08-02) diff --git a/package.json b/package.json index f71a57e..d885032 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@toyokumo/eslint-config", - "version": "2.1.0", + "version": "2.1.1", "engines": { "node": ">=18" }, @@ -9,7 +9,7 @@ "scripts": { "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js", "lint": "eslint --max-warnings=0 \"**/*.{js,ts,tsx}\"", - "release": "standard-version --release-as minor", + "release": "standard-version", "format": "run-s \"format:eslint -- {1}\" \"format:prettier -- {1}\" --", "format:eslint": "eslint --fix", "format:prettier": "prettier --write", From 455f636e8a3b5e3777119f60090210b08b4cdc2f Mon Sep 17 00:00:00 2001 From: syunta Date: Mon, 5 Aug 2024 16:53:22 +0900 Subject: [PATCH 4/4] Format --- tests/rules/javascript/sample.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/rules/javascript/sample.js b/tests/rules/javascript/sample.js index 0447670..76c69c4 100644 --- a/tests/rules/javascript/sample.js +++ b/tests/rules/javascript/sample.js @@ -20,7 +20,7 @@ f(1, 2); // for 'no-unused-vars': ['error', { caughtErrors: 'all', caughtErrorsIgnorePattern: '^_+$' }], try { f(2, 3); -} catch(_) { +} catch (_) { doSomething(10); }