From 720df196a0b6f1e0c480f95b7e6c6fa47e82bac0 Mon Sep 17 00:00:00 2001 From: Simon Golms Date: Wed, 15 Jan 2025 15:33:33 +0100 Subject: [PATCH] fix(react): [sort-jsx-props] use regex pattern for custom groups - with eslint-plugin-perfectionist@4 the support of glob pattern was removed in favor of regex which leads to unintended sorting of the props, see: https://github.com/azat-io/eslint-plugin-perfectionist/releases/tag/v4.0.0 --- configs/react.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configs/react.js b/configs/react.js index 69bd81f..f0d16ba 100644 --- a/configs/react.js +++ b/configs/react.js @@ -78,8 +78,8 @@ module.exports = tseslint.config( 'error', { customGroups: { - callback: 'on*', - reservedProps: ['children', 'dangerouslySetInnerHTML', 'key', 'ref'], // Reserved props from: https://github.com/jsx-eslint/eslint-plugin-react/blob/master/lib/rules/jsx-sort-props.js#L40C12-L40C12 + callback: '^on.+', + reservedProps: ['children', 'dangerouslySetInnerHTML', 'key', 'ref'], // Reserved props from: https://github.com/jsx-eslint/eslint-plugin-react/blob/master/lib/rules/jsx-sort-props.js#L41-L46 }, groups: ['reservedProps', 'unknown', 'callback'], ignoreCase: true,