From 601bc2b63ffe06c55f1bf18aea7152dd698efcf9 Mon Sep 17 00:00:00 2001 From: Lena Morita Date: Wed, 28 Aug 2024 01:10:45 +0900 Subject: [PATCH] SelectControl: Fix remaining 40px size violations (#64831) * Fix in Featured Image block * Fix in Legacy Widget block * Move lint rule Co-authored-by: mirka <0mirka00@git.wordpress.org> Co-authored-by: ciampo --- .eslintrc.js | 17 ++++++++--------- .../post-featured-image/dimension-controls.js | 3 +-- .../legacy-widget/edit/widget-type-selector.js | 3 +-- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 03c4fd7838527..55fa288b79b99 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -327,6 +327,7 @@ module.exports = { 'LineHeightControl', 'NumberControl', 'RangeControl', + 'SelectControl', 'TextControl', 'ToggleGroupControl', ].map( ( componentName ) => ( { @@ -344,15 +345,13 @@ module.exports = { 'FormFileUpload should have the `__next40pxDefaultSize` prop to opt-in to the new default size.', }, // Temporary rules until all existing components have the `__next40pxDefaultSize` prop. - ...[ 'SelectControl', 'UnitControl' ].map( - ( componentName ) => ( { - // Not strict. Allows pre-existing __next40pxDefaultSize={ false } usage until they are all manually updated. - selector: `JSXOpeningElement[name.name="${ componentName }"]:not(:has(JSXAttribute[name.name="__next40pxDefaultSize"])):not(:has(JSXAttribute[name.name="size"]))`, - message: - componentName + - ' should have the `__next40pxDefaultSize` prop to opt-in to the new default size.', - } ) - ), + ...[ 'UnitControl' ].map( ( componentName ) => ( { + // Not strict. Allows pre-existing __next40pxDefaultSize={ false } usage until they are all manually updated. + selector: `JSXOpeningElement[name.name="${ componentName }"]:not(:has(JSXAttribute[name.name="__next40pxDefaultSize"])):not(:has(JSXAttribute[name.name="size"]))`, + message: + componentName + + ' should have the `__next40pxDefaultSize` prop to opt-in to the new default size.', + } ) ), ], }, }, diff --git a/packages/block-library/src/post-featured-image/dimension-controls.js b/packages/block-library/src/post-featured-image/dimension-controls.js index b31b68b781197..5a3e40a126bf8 100644 --- a/packages/block-library/src/post-featured-image/dimension-controls.js +++ b/packages/block-library/src/post-featured-image/dimension-controls.js @@ -236,8 +236,7 @@ const DimensionControls = ( { panelId={ clientId } >