Skip to content

Commit d844205

Browse files
committed
fix: replace JSX.Element with Element in JSDoc return types
The `@wordpress/eslint-plugin` 24.2.0 bump made `jsdoc/no-undefined-types` stricter, causing lint failures for `{JSX.Element}` return annotations. This aligns with how Gutenberg handles it — `Element` is included in the plugin's `definedTypes` via `temporaryWordPressInternalTypes`, while bare `JSX` is not a recognized type.
1 parent 8fd2e48 commit d844205

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

src/components/default-block-appender/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import './style.scss';
1515
* Renders a hidden button that, when clicked, inserts a new paragraph block
1616
* at the end of the block editor.
1717
*
18-
* @return {JSX.Element} The rendered button element.
18+
* @return {Element} The rendered button element.
1919
*/
2020
export default function DefaultBlockAppender() {
2121
const { insertBlock } = useDispatch( blockEditorStore );

src/components/editor-load-error/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import './style.scss';
1717
* @param {Object} props Component props
1818
* @param {string} props.error Error message displayed in the notice
1919
*
20-
* @return {JSX.Element} Editor load error component
20+
* @return {Element} Editor load error component
2121
*/
2222
const EditorLoadError = ( { error } ) => {
2323
const errorMessage = error.message || error;

src/components/editor-load-notice/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const pluginLoadFailedNotice = __(
1717
* @param {string} props.className Additional class names to apply.
1818
* @param {boolean} props.pluginLoadFailed Whether plugin loading failed.
1919
*
20-
* @return {?JSX.Element} The rendered component or null if no notice is present.
20+
* @return {?Element} The rendered component or null if no notice is present.
2121
*/
2222
export default function EditorLoadNotice( { className, pluginLoadFailed } ) {
2323
const { notice, clearNotice } = useEditorLoadNotice(

src/components/editor-toolbar/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import { useScrollIndicators } from './use-scroll-indicators';
3636
*
3737
* @param {Object} props Component props.
3838
* @param {string} props.className Component classes.
39-
* @return {JSX.Element} The rendered editor toolbar component.
39+
* @return {Element} The rendered editor toolbar component.
4040
*/
4141
const EditorToolbar = ( { className } ) => {
4242
const { enableNativeBlockInserter } = getGBKit();

src/components/editor/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import { usePlusAutocompleter } from './use-plus-autocompleter';
3434
* @param {boolean} props.hideTitle Whether to hide the title input.
3535
* @param {import('@wordpress/element').Element} props.children The children to render in the editor.
3636
*
37-
* @return {JSX.Element} The rendered App component.
37+
* @return {Element} The rendered App component.
3838
*/
3939
export default function Editor( { post, children, hideTitle } ) {
4040
const editorRef = useRef( null );

src/components/layout/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import './style.scss';
2121
* @param {Object} props The settings passed along to the Editor component.
2222
* @param {boolean} props.pluginLoadFailed Whether plugin loading failed.
2323
*
24-
* @return {JSX.Element} The rendered Layout component.
24+
* @return {Element} The rendered Layout component.
2525
*/
2626
export default function Layout( props ) {
2727
const { pluginLoadFailed, ...editorProps } = props;

src/components/text-editor/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import './style.scss';
1414
* @param {Object} props Component props.
1515
* @param {boolean} props.hideTitle Whether to hide the title input.
1616
*
17-
* @return {JSX.Element} The rendered text editor component.
17+
* @return {Element} The rendered text editor component.
1818
*/
1919
export default function TextEditor( { hideTitle } ) {
2020
return (

src/components/visual-editor/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const alignCSS = `.is-root-container.alignwide { max-width: var(--wp--style--glo
5252
* @param {Object} props Component props.
5353
* @param {boolean} props.hideTitle Whether to hide the title input.
5454
*
55-
* @return {JSX.Element} The rendered Editor component.
55+
* @return {Element} The rendered Editor component.
5656
*/
5757
function VisualEditor( { hideTitle } ) {
5858
const editorPostTitleRef = useRef();

0 commit comments

Comments
 (0)