diff --git a/.eslintrc.json b/.eslintrc.json index 61c4f09011a..a65953f7a08 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -82,6 +82,7 @@ "eqeqeq": "error", // Only type-safe equality operators "unicorn/expiring-todo-comments": ["error"], "no-console": "error", - "react-compiler/react-compiler": 2 + "react-compiler/react-compiler": 2, + "no-useless-computed-key": "error" } } diff --git a/packages/vkui/src/components/AspectRatio/AspectRatio.tsx b/packages/vkui/src/components/AspectRatio/AspectRatio.tsx index 000bfc12143..77e923494b9 100644 --- a/packages/vkui/src/components/AspectRatio/AspectRatio.tsx +++ b/packages/vkui/src/components/AspectRatio/AspectRatio.tsx @@ -30,7 +30,7 @@ export function AspectRatio({ ...props }: AspectRatioProps): JSX.Element { const style: React.CSSProperties & CSSCustomProperties = { - ['--vkui_internal--aspect_ratio']: String(ratio), + '--vkui_internal--aspect_ratio': String(ratio), }; return ( diff --git a/packages/vkui/src/components/Button/Button.tsx b/packages/vkui/src/components/Button/Button.tsx index 7dec436287a..60721758748 100644 --- a/packages/vkui/src/components/Button/Button.tsx +++ b/packages/vkui/src/components/Button/Button.tsx @@ -39,7 +39,7 @@ const stylesAlign = { const sizeYClassNames = { none: styles['Button--sizeY-none'], - ['regular']: styles['Button--sizeY-regular'], + regular: styles['Button--sizeY-regular'], }; export interface VKUIButtonProps extends HasAlign { diff --git a/packages/vkui/src/components/CardGrid/CardGrid.tsx b/packages/vkui/src/components/CardGrid/CardGrid.tsx index c384a68e3cd..a69f115a313 100644 --- a/packages/vkui/src/components/CardGrid/CardGrid.tsx +++ b/packages/vkui/src/components/CardGrid/CardGrid.tsx @@ -6,7 +6,7 @@ import styles from './CardGrid.module.css'; const sizeXClassNames = { none: styles['CardGrid--sizeX-none'], - ['compact']: styles['CardGrid--sizeX-compact'], + compact: styles['CardGrid--sizeX-compact'], }; const stylesSize = { diff --git a/packages/vkui/src/components/CustomSelect/CustomSelect.tsx b/packages/vkui/src/components/CustomSelect/CustomSelect.tsx index e002bc060dd..393375a3f56 100644 --- a/packages/vkui/src/components/CustomSelect/CustomSelect.tsx +++ b/packages/vkui/src/components/CustomSelect/CustomSelect.tsx @@ -34,7 +34,7 @@ import styles from './CustomSelect.module.css'; const sizeYClassNames = { none: styles['CustomSelect--sizeY-none'], - ['compact']: styles['CustomSelect--sizeY-compact'], + compact: styles['CustomSelect--sizeY-compact'], }; const warn = warnOnce('CustomSelect'); @@ -178,7 +178,7 @@ export function CustomSelect { diff --git a/packages/vkui/src/components/DateInput/DateInput.tsx b/packages/vkui/src/components/DateInput/DateInput.tsx index b378ee79d09..9c2b1674c24 100644 --- a/packages/vkui/src/components/DateInput/DateInput.tsx +++ b/packages/vkui/src/components/DateInput/DateInput.tsx @@ -20,7 +20,7 @@ import styles from './DateInput.module.css'; const sizeYClassNames = { none: styles['DateInput--sizeY-none'], - ['compact']: styles['DateInput--sizeY-compact'], + compact: styles['DateInput--sizeY-compact'], }; export interface DateInputProps diff --git a/packages/vkui/src/components/DateRangeInput/DateRangeInput.tsx b/packages/vkui/src/components/DateRangeInput/DateRangeInput.tsx index 3113e22197a..537a269b142 100644 --- a/packages/vkui/src/components/DateRangeInput/DateRangeInput.tsx +++ b/packages/vkui/src/components/DateRangeInput/DateRangeInput.tsx @@ -26,7 +26,7 @@ import dateInputStyles from '../DateInput/DateInput.module.css'; const sizeYClassNames = { none: styles['DateRangeInput--sizeY-none'], - ['compact']: styles['DateRangeInput--sizeY-compact'], + compact: styles['DateRangeInput--sizeY-compact'], }; export interface DateRangeInputProps diff --git a/packages/vkui/src/components/FormField/FormField.tsx b/packages/vkui/src/components/FormField/FormField.tsx index c1863e6ac8d..4e01c841b27 100644 --- a/packages/vkui/src/components/FormField/FormField.tsx +++ b/packages/vkui/src/components/FormField/FormField.tsx @@ -9,7 +9,7 @@ import styles from './FormField.module.css'; const sizeYClassNames = { none: styles['FormField--sizeY-none'], - ['compact']: styles['FormField--sizeY-compact'], + compact: styles['FormField--sizeY-compact'], }; const stylesStatus = { diff --git a/packages/vkui/src/components/FormItem/FormItem.tsx b/packages/vkui/src/components/FormItem/FormItem.tsx index 3f2e34867cd..8c4c790ca96 100644 --- a/packages/vkui/src/components/FormItem/FormItem.tsx +++ b/packages/vkui/src/components/FormItem/FormItem.tsx @@ -15,7 +15,7 @@ import styles from './FormItem.module.css'; const sizeYClassNames = { none: classNames(styles['FormItem--sizeY-none'], 'vkuiInternalFormItem--sizeY-none'), - ['compact']: classNames(styles['FormItem--sizeY-compact'], 'vkuiInternalFormItem--sizeY-compact'), + compact: classNames(styles['FormItem--sizeY-compact'], 'vkuiInternalFormItem--sizeY-compact'), }; const stylesStatus = { diff --git a/packages/vkui/src/components/FormLayoutGroup/FormLayoutGroup.tsx b/packages/vkui/src/components/FormLayoutGroup/FormLayoutGroup.tsx index 4bdd0898a19..536f0de7e01 100644 --- a/packages/vkui/src/components/FormLayoutGroup/FormLayoutGroup.tsx +++ b/packages/vkui/src/components/FormLayoutGroup/FormLayoutGroup.tsx @@ -12,7 +12,7 @@ const sizeYClassNames = { styles['FormLayoutGroup--sizeY-none'], 'vkuiInternalFormLayoutGroup--sizeY-none', ), - ['compact']: classNames( + compact: classNames( styles['FormLayoutGroup--sizeY-compact'], 'vkuiInternalFormLayoutGroup--sizeY-compact', ), diff --git a/packages/vkui/src/components/Input/Input.tsx b/packages/vkui/src/components/Input/Input.tsx index 38d4d1dadeb..471afcf792e 100644 --- a/packages/vkui/src/components/Input/Input.tsx +++ b/packages/vkui/src/components/Input/Input.tsx @@ -8,7 +8,7 @@ import styles from './Input.module.css'; const sizeYClassNames = { none: styles['Input--sizeY-none'], - ['compact']: styles['Input--sizeY-compact'], + compact: styles['Input--sizeY-compact'], }; export interface InputProps diff --git a/packages/vkui/src/components/NativeSelect/NativeSelect.tsx b/packages/vkui/src/components/NativeSelect/NativeSelect.tsx index edd2aeaa537..d9d639e85c2 100644 --- a/packages/vkui/src/components/NativeSelect/NativeSelect.tsx +++ b/packages/vkui/src/components/NativeSelect/NativeSelect.tsx @@ -14,7 +14,7 @@ import styles from '../Select/Select.module.css'; const sizeYClassNames = { none: styles['Select--sizeY-none'], - ['compact']: styles['Select--sizeY-compact'], + compact: styles['Select--sizeY-compact'], }; export interface NativeSelectProps diff --git a/packages/vkui/src/components/Panel/Panel.tsx b/packages/vkui/src/components/Panel/Panel.tsx index 6ee0c0e7f3d..388b738b9ea 100644 --- a/packages/vkui/src/components/Panel/Panel.tsx +++ b/packages/vkui/src/components/Panel/Panel.tsx @@ -13,8 +13,8 @@ import styles from './Panel.module.css'; const sizeXClassNames = { none: styles['Panel--sizeX-none'], - ['compact']: styles['Panel--sizeX-compact'], - ['regular']: styles['Panel--sizeX-regular'], + compact: styles['Panel--sizeX-compact'], + regular: styles['Panel--sizeX-regular'], }; const stylesMode = { diff --git a/packages/vkui/src/components/RichCell/RichCell.tsx b/packages/vkui/src/components/RichCell/RichCell.tsx index ea285cd1fd6..ca75c5b6588 100644 --- a/packages/vkui/src/components/RichCell/RichCell.tsx +++ b/packages/vkui/src/components/RichCell/RichCell.tsx @@ -8,7 +8,7 @@ import styles from './RichCell.module.css'; const sizeYClassNames = { none: styles['RichCell--sizeY-none'], - ['compact']: styles['RichCell--sizeY-compact'], + compact: styles['RichCell--sizeY-compact'], }; const alignAfterClassNames = { diff --git a/packages/vkui/src/components/SegmentedControl/SegmentedControl.tsx b/packages/vkui/src/components/SegmentedControl/SegmentedControl.tsx index 105678f86ff..ee096e555f5 100644 --- a/packages/vkui/src/components/SegmentedControl/SegmentedControl.tsx +++ b/packages/vkui/src/components/SegmentedControl/SegmentedControl.tsx @@ -11,7 +11,7 @@ import styles from './SegmentedControl.module.css'; const sizeYClassNames = { none: styles['SegmentedControl--sizeY-none'], - ['regular']: styles['SegmentedControl--sizeY-regular'], + regular: styles['SegmentedControl--sizeY-regular'], }; export type SegmentedControlValue = string | number | undefined; diff --git a/packages/vkui/src/components/SelectMimicry/SelectMimicry.tsx b/packages/vkui/src/components/SelectMimicry/SelectMimicry.tsx index 9c4dd985bcc..3a2b3f6dc78 100644 --- a/packages/vkui/src/components/SelectMimicry/SelectMimicry.tsx +++ b/packages/vkui/src/components/SelectMimicry/SelectMimicry.tsx @@ -13,7 +13,7 @@ import styles from '../Select/Select.module.css'; const sizeYClassNames = { none: styles['Select--sizeY-none'], - ['compact']: styles['Select--sizeY-compact'], + compact: styles['Select--sizeY-compact'], }; export interface SelectMimicryProps diff --git a/packages/vkui/src/components/SimpleCell/SimpleCell.tsx b/packages/vkui/src/components/SimpleCell/SimpleCell.tsx index ed83e27c92d..2ea1026898f 100644 --- a/packages/vkui/src/components/SimpleCell/SimpleCell.tsx +++ b/packages/vkui/src/components/SimpleCell/SimpleCell.tsx @@ -12,7 +12,7 @@ import styles from './SimpleCell.module.css'; const sizeYClassNames = { none: styles['SimpleCell--sizeY-none'], - ['compact']: styles['SimpleCell--sizeY-compact'], + compact: styles['SimpleCell--sizeY-compact'], }; export interface SimpleCellOwnProps extends HasComponent { diff --git a/packages/vkui/src/components/Slider/Slider.tsx b/packages/vkui/src/components/Slider/Slider.tsx index b10ee80c198..2e8351307e4 100644 --- a/packages/vkui/src/components/Slider/Slider.tsx +++ b/packages/vkui/src/components/Slider/Slider.tsx @@ -21,7 +21,7 @@ import styles from './Slider.module.css'; const sizeYClassNames = { none: styles['Slider--sizeY-none'], - ['compact']: styles['Slider--sizeY-compact'], + compact: styles['Slider--sizeY-compact'], }; const sizeClassNames = { diff --git a/packages/vkui/src/components/SubnavigationButton/SubnavigationButton.tsx b/packages/vkui/src/components/SubnavigationButton/SubnavigationButton.tsx index 1cc3a3a28cd..2bf8fbff6dd 100644 --- a/packages/vkui/src/components/SubnavigationButton/SubnavigationButton.tsx +++ b/packages/vkui/src/components/SubnavigationButton/SubnavigationButton.tsx @@ -27,7 +27,7 @@ const sizeStyles = { const sizeYClassNames = { none: styles['SubnavigationButton--sizeY-none'], - ['compact']: styles['SubnavigationButton--sizeY-compact'], + compact: styles['SubnavigationButton--sizeY-compact'], }; export interface SubnavigationButtonProps extends Omit { diff --git a/packages/vkui/src/components/TabsItem/TabsItem.tsx b/packages/vkui/src/components/TabsItem/TabsItem.tsx index b16f6f659ce..22cb36f6212 100644 --- a/packages/vkui/src/components/TabsItem/TabsItem.tsx +++ b/packages/vkui/src/components/TabsItem/TabsItem.tsx @@ -15,7 +15,7 @@ import styles from './TabsItem.module.css'; const sizeYClassNames = { none: styles['TabsItem--sizeY-none'], - ['compact']: styles['TabsItem--sizeY-compact'], + compact: styles['TabsItem--sizeY-compact'], }; const stylesMode = { diff --git a/packages/vkui/src/components/Textarea/Textarea.tsx b/packages/vkui/src/components/Textarea/Textarea.tsx index 2c753925790..f5b58a9a706 100644 --- a/packages/vkui/src/components/Textarea/Textarea.tsx +++ b/packages/vkui/src/components/Textarea/Textarea.tsx @@ -14,7 +14,7 @@ import styles from './Textarea.module.css'; const sizeYClassNames = { none: styles['Textarea--sizeY-none'], - ['compact']: styles['Textarea--sizeY-compact'], + compact: styles['Textarea--sizeY-compact'], }; export interface TextareaProps diff --git a/packages/vkui/src/components/Typography/Headline/Headline.tsx b/packages/vkui/src/components/Typography/Headline/Headline.tsx index ec236d14361..ab0330516d6 100644 --- a/packages/vkui/src/components/Typography/Headline/Headline.tsx +++ b/packages/vkui/src/components/Typography/Headline/Headline.tsx @@ -10,7 +10,7 @@ const stylesLevel = { const sizeYClassNames = { none: styles['Headline--sizeY-none'], - ['compact']: styles['Headline--sizeY-compact'], + compact: styles['Headline--sizeY-compact'], }; export interface HeadlineProps extends TypographyProps { diff --git a/packages/vkui/src/components/Typography/Subhead/Subhead.tsx b/packages/vkui/src/components/Typography/Subhead/Subhead.tsx index ae293a574f2..abeb0a66109 100644 --- a/packages/vkui/src/components/Typography/Subhead/Subhead.tsx +++ b/packages/vkui/src/components/Typography/Subhead/Subhead.tsx @@ -5,7 +5,7 @@ import styles from './Subhead.module.css'; const sizeYClassNames = { none: styles['Subhead--sizeY-none'], - ['compact']: styles['Subhead--sizeY-compact'], + compact: styles['Subhead--sizeY-compact'], }; export type SubheadProps = TypographyProps; diff --git a/packages/vkui/src/components/Typography/Text/Text.tsx b/packages/vkui/src/components/Typography/Text/Text.tsx index deb7299a285..20f2f544878 100644 --- a/packages/vkui/src/components/Typography/Text/Text.tsx +++ b/packages/vkui/src/components/Typography/Text/Text.tsx @@ -5,7 +5,7 @@ import styles from './Text.module.css'; const sizeYClassNames = { none: styles['Text--sizeY-none'], - ['compact']: styles['Text--sizeY-compact'], + compact: styles['Text--sizeY-compact'], }; export type TextProps = TypographyProps; diff --git a/packages/vkui/src/hooks/useAdaptivityConditionalRender/constants.ts b/packages/vkui/src/hooks/useAdaptivityConditionalRender/constants.ts index b6277d6570e..828dae3c517 100644 --- a/packages/vkui/src/hooks/useAdaptivityConditionalRender/constants.ts +++ b/packages/vkui/src/hooks/useAdaptivityConditionalRender/constants.ts @@ -2,22 +2,22 @@ import styles from '../../styles/adaptivity.module.css'; export const sizeXCompactClassNames: Record<'mq' | 'compact', { className: string }> = { mq: { className: styles['-sizeX--compact-mq'] }, - ['compact']: { className: styles['-sizeX--compact-forced'] }, + compact: { className: styles['-sizeX--compact-forced'] }, }; export const sizeXRegularClassNames: Record<'mq' | 'regular', { className: string }> = { mq: { className: styles['-sizeX--regular-mq'] }, - ['regular']: { className: styles['-sizeX--regular-forced'] }, + regular: { className: styles['-sizeX--regular-forced'] }, }; export const sizeYCompactClassNames: Record<'mq' | 'compact', { className: string }> = { mq: { className: styles['-sizeY--compact-mq'] }, - ['compact']: { className: styles['-sizeY--compact-forced'] }, + compact: { className: styles['-sizeY--compact-forced'] }, }; export const sizeYRegularClassNames: Record<'mq' | 'regular', { className: string }> = { mq: { className: styles['-sizeY--regular-mq'] }, - ['regular']: { className: styles['-sizeY--regular-forced'] }, + regular: { className: styles['-sizeY--regular-forced'] }, }; export const viewWidthClassNames: Record<