Skip to content

Commit 1bc625b

Browse files
authored
chore(lint - import/order): treat ui5wcr imports as internal (#8167)
Before, wcr imports where treated differently if `dist` folders were present or not.
1 parent e6151fb commit 1bc625b

25 files changed

Lines changed: 33 additions & 27 deletions

File tree

.storybook/components/ProjectTemplate.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
Text,
1313
ThemeProvider,
1414
} from '@ui5/webcomponents-react';
15-
// eslint-disable-next-line import/order
1615
import { addCustomCSSWithScoping } from '@ui5/webcomponents-react-base/internal/utils';
1716
import { clsx } from 'clsx';
1817
import type { ReactNode } from 'react';

cypress/support/commands.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { ThemeProviderPropTypes } from '@ui5/webcomponents-react';
21
import { ThemeProvider } from '@ui5/webcomponents-react';
2+
import type { ThemeProviderPropTypes } from '@ui5/webcomponents-react';
33
import type { MountOptions, MountReturn } from 'cypress/react';
44
import { mount } from 'cypress/react';
55
import type { ReactNode } from 'react';

eslint.config.mjs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,15 @@ const config = tseslint.config(
9696
'import/order': [
9797
'error',
9898
{
99+
// Ensure wcr packages are always resolved as 'external' no matter if local dist folders exist (without defined pathGroups they would resolve as 'internal' with `dist`)
100+
pathGroups: [
101+
{ pattern: '@ui5/webcomponents-react*', group: 'external' },
102+
{ pattern: '@ui5/webcomponents-react*/**', group: 'external' },
103+
{ pattern: '@ui5/webcomponents-cypress-commands', group: 'external' },
104+
{ pattern: '@ui5/webcomponents-cypress-commands/**', group: 'external' },
105+
],
106+
pathGroupsExcludedImportTypes: ['builtin'],
99107
'newlines-between': 'never',
100-
101108
alphabetize: {
102109
order: 'asc',
103110
caseInsensitive: true,

packages/ai/src/components/Button/Button.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import ButtonDesign from '@ui5/webcomponents/dist/types/ButtonDesign.js';
33
import aiIcon from '@ui5/webcomponents-icons/dist/ai.js';
44
import navDownIcon from '@ui5/webcomponents-icons/dist/navigation-down-arrow.js';
55
import stopIcon from '@ui5/webcomponents-icons/dist/stop.js';
6-
import type { MenuPropTypes } from '@ui5/webcomponents-react';
76
import { Menu, MenuItem, MenuSeparator } from '@ui5/webcomponents-react';
7+
import type { MenuPropTypes } from '@ui5/webcomponents-react';
88
import { useRef, useState } from 'react';
99
import { ButtonState } from '../ButtonState/index.js';
1010
import type { ButtonDomRef, ButtonPropTypes } from './index.js';

packages/ai/src/components/TextArea/TextArea.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Meta, StoryObj } from '@storybook/react-vite';
2-
import type { MenuPropTypes } from '@ui5/webcomponents-react';
32
import { Menu, MenuItem } from '@ui5/webcomponents-react';
3+
import type { MenuPropTypes } from '@ui5/webcomponents-react';
44
import { useRef, useState } from 'react';
55
import { useFakeStream, useStopStreamByESC } from '../../../../../.storybook/utils.js';
66
import type { TextAreaPropTypes } from './index.js';

packages/compat/src/components/Toolbar/OverflowPopover.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import type {
1515
import { ToggleButton } from '@ui5/webcomponents-react/dist/webComponents/ToggleButton/index.js';
1616
import { Device, useI18nBundle, useSyncRef } from '@ui5/webcomponents-react-base';
1717
import { clsx } from 'clsx';
18-
import type { Dispatch, FC, HTMLAttributes, ReactElement, ReactNode, Ref, SetStateAction } from 'react';
1918
import { isValidElement, cloneElement, useEffect, useRef, useState } from 'react';
19+
import type { Dispatch, FC, HTMLAttributes, ReactElement, ReactNode, Ref, SetStateAction } from 'react';
2020
import { createPortal } from 'react-dom';
2121
import { getOverflowPopoverContext } from '../../internal/OverflowPopoverContext.js';
2222
import type { ToolbarPropTypes } from './index.js';

packages/main/src/components/AnalyticalTable/AnalyticalTable.cy.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import NoFilterResults from '@ui5/webcomponents-fiori/dist/illustrations/NoFilte
44
import paperPlaneIcon from '@ui5/webcomponents-icons/paper-plane.js';
55
import { isIOS, isMac } from '@ui5/webcomponents-react-base/Device';
66
import { ThemingParameters } from '@ui5/webcomponents-react-base/ThemingParameters';
7-
import type { ComponentClass, ComponentProps } from 'react';
87
import { useCallback, useEffect, useMemo, useRef, useState, version as reactVersion } from 'react';
8+
import type { ComponentClass, ComponentProps } from 'react';
99
import type {
1010
AnalyticalTableCellInstance,
1111
AnalyticalTableColumnDefinition,

packages/main/src/components/AnalyticalTable/ColumnHeader/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import iconSortAscending from '@ui5/webcomponents-icons/dist/sort-ascending.js';
77
import iconSortDescending from '@ui5/webcomponents-icons/dist/sort-descending.js';
88
import { ThemingParameters, useIsomorphicLayoutEffect } from '@ui5/webcomponents-react-base';
99
import { clsx } from 'clsx';
10+
import { useRef, useState } from 'react';
1011
import type {
1112
AriaAttributes,
1213
CSSProperties,
@@ -15,7 +16,6 @@ import type {
1516
MouseEventHandler,
1617
ReactNode,
1718
} from 'react';
18-
import { useRef, useState } from 'react';
1919
import { Icon } from '../../../webComponents/Icon/index.js';
2020
import { Text } from '../../../webComponents/Text/index.js';
2121
import type { ClassNames, ColumnType, DivWithCustomScrollProp } from '../types/index.js';

packages/main/src/components/AnalyticalTable/pluginHooks/useF2CellEdit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { Ui5DomRef } from '@ui5/webcomponents-react-base';
21
import { useI18nBundle } from '@ui5/webcomponents-react-base';
2+
import type { Ui5DomRef } from '@ui5/webcomponents-react-base';
33
import type { FocusEventHandler, KeyboardEventHandler } from 'react';
44
import { useCallback, useEffect } from 'react';
55
import { INCLUDES_X } from '../../../i18n/i18n-defaults.js';

packages/main/src/components/FilterBar/FilterDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import listIcon from '@ui5/webcomponents-icons/dist/list.js';
66
import searchIcon from '@ui5/webcomponents-icons/dist/search.js';
77
import { enrichEventWithDetails, useI18nBundle, useStylesheet } from '@ui5/webcomponents-react-base';
88
import { addCustomCSSWithScoping } from '@ui5/webcomponents-react-base/internal/utils';
9-
import type { ReactElement, RefObject } from 'react';
109
import { Children, cloneElement, useEffect, useId, useReducer, useRef, useState } from 'react';
10+
import type { ReactElement, RefObject } from 'react';
1111
import { FlexBoxDirection } from '../../enums/FlexBoxDirection.js';
1212
import { FlexBoxJustifyContent } from '../../enums/FlexBoxJustifyContent.js';
1313
import { MessageBoxAction } from '../../enums/MessageBoxAction.js';

0 commit comments

Comments
 (0)