Skip to content

Commit 22dd8bb

Browse files
committed
Fix ESLint issues
1 parent 71fb8fc commit 22dd8bb

18 files changed

Lines changed: 79 additions & 90 deletions

File tree

packages/javascript/src/models/config.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,17 +302,17 @@ export interface I18nPreferences {
302302
* (URL param, stored preference, browser language).
303303
*/
304304
language?: string;
305-
/**
306-
* The storage strategy to use for persisting the user's language selection.
307-
* @default 'cookie'
308-
*/
309-
storageStrategy?: I18nStorageStrategy;
310305
/**
311306
* The key used when reading/writing the language to the chosen storage.
312307
* For `localStorage` this is the key name; for `cookie` this is the cookie name.
313308
* @default 'asgardeo-i18n-language'
314309
*/
315310
storageKey?: string;
311+
/**
312+
* The storage strategy to use for persisting the user's language selection.
313+
* @default 'cookie'
314+
*/
315+
storageStrategy?: I18nStorageStrategy;
316316
/**
317317
* The URL query-parameter name to inspect for a language override.
318318
* Set to `false` to disable URL-parameter detection entirely.

packages/react/src/components/presentation/CreateOrganization/BaseCreateOrganization.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,16 @@ export interface BaseCreateOrganizationProps {
5959
onSubmit?: (payload: CreateOrganizationPayload) => void | Promise<void>;
6060
onSuccess?: (organization: any) => void;
6161
open?: boolean;
62-
renderAdditionalFields?: () => ReactNode;
63-
style?: CSSProperties;
64-
title?: string;
65-
6662
/**
6763
* Component-level preferences to override global i18n and theme settings.
6864
* Preferences are deep-merged with global ones, with component preferences
6965
* taking precedence. Affects this component and all its descendants.
7066
*/
7167
preferences?: Preferences;
68+
renderAdditionalFields?: () => ReactNode;
69+
style?: CSSProperties;
70+
71+
title?: string;
7272
}
7373

7474
/**

packages/react/src/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ import {
3333
import {FC, ReactElement, ReactNode, useState} from 'react';
3434
import useStyles from './BaseLanguageSwitcher.styles';
3535
import useTheme from '../../../contexts/Theme/useTheme';
36-
import ChevronDown from '../../primitives/Icons/ChevronDown';
3736
import Check from '../../primitives/Icons/Check';
37+
import ChevronDown from '../../primitives/Icons/ChevronDown';
3838

3939
/**
4040
* A resolved language option with display name and emoji flag.
@@ -107,7 +107,7 @@ const BaseLanguageSwitcher: FC<BaseLanguageSwitcherProps> = ({
107107
onLanguageChange,
108108
}: BaseLanguageSwitcherProps): ReactElement => {
109109
const {theme, colorScheme} = useTheme();
110-
const styles = useStyles(theme, colorScheme);
110+
const styles: Record<string, string> = useStyles(theme, colorScheme);
111111
const [isOpen, setIsOpen] = useState(false);
112112

113113
const {refs, floatingStyles, context} = useFloating({
@@ -117,12 +117,12 @@ const BaseLanguageSwitcher: FC<BaseLanguageSwitcherProps> = ({
117117
whileElementsMounted: autoUpdate,
118118
});
119119

120-
const click = useClick(context);
121-
const dismiss = useDismiss(context);
122-
const role = useRole(context, {role: 'listbox'});
120+
const click: ReturnType<typeof useClick> = useClick(context);
121+
const dismiss: ReturnType<typeof useDismiss> = useDismiss(context);
122+
const role: ReturnType<typeof useRole> = useRole(context, {role: 'listbox'});
123123
const {getReferenceProps, getFloatingProps} = useInteractions([click, dismiss, role]);
124124

125-
const currentOption: LanguageOption | undefined = languages.find(l => l.code === currentLanguage);
125+
const currentOption: LanguageOption | undefined = languages.find((l: LanguageOption) => l.code === currentLanguage);
126126

127127
if (children) {
128128
return (

packages/react/src/components/presentation/OrganizationList/BaseOrganizationList.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ export interface BaseOrganizationListProps {
8888
* Whether the popup is open (only used in popup mode)
8989
*/
9090
open?: boolean;
91+
/**
92+
* Component-level preferences to override global i18n and theme settings.
93+
* Preferences are deep-merged with global ones, with component preferences
94+
* taking precedence. Affects this component and all its descendants.
95+
*/
96+
preferences?: Preferences;
9197
/**
9298
* Custom renderer for when no organizations are found
9399
*/
@@ -116,17 +122,11 @@ export interface BaseOrganizationListProps {
116122
* Inline styles to apply to the container
117123
*/
118124
style?: CSSProperties;
125+
119126
/**
120127
* Title for the popup dialog (only used in popup mode)
121128
*/
122129
title?: string;
123-
124-
/**
125-
* Component-level preferences to override global i18n and theme settings.
126-
* Preferences are deep-merged with global ones, with component preferences
127-
* taking precedence. Affects this component and all its descendants.
128-
*/
129-
preferences?: Preferences;
130130
}
131131

132132
/**

packages/react/src/components/presentation/OrganizationProfile/BaseOrganizationProfile.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@ export interface BaseOrganizationProfileProps {
9999
*/
100100
organization?: OrganizationDetails | null;
101101

102+
/**
103+
* Component-level preferences to override global i18n and theme settings.
104+
* Preferences are deep-merged with global ones, with component preferences
105+
* taking precedence. Affects this component and all its descendants.
106+
*/
107+
preferences?: Preferences;
108+
102109
/**
103110
* Text for the save button (only used in editable mode).
104111
*/
@@ -108,13 +115,6 @@ export interface BaseOrganizationProfileProps {
108115
* Custom title for the profile.
109116
*/
110117
title?: string;
111-
112-
/**
113-
* Component-level preferences to override global i18n and theme settings.
114-
* Preferences are deep-merged with global ones, with component preferences
115-
* taking precedence. Affects this component and all its descendants.
116-
*/
117-
preferences?: Preferences;
118118
}
119119

120120
/**

packages/react/src/components/presentation/OrganizationProfile/OrganizationProfile.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* under the License.
1717
*/
1818

19-
import {OrganizationDetails, createPackageComponentLogger, Preferences} from '@asgardeo/browser';
19+
import {OrganizationDetails, createPackageComponentLogger} from '@asgardeo/browser';
2020
import {FC, ReactElement, useEffect, useState} from 'react';
2121
import BaseOrganizationProfile, {BaseOrganizationProfileProps} from './BaseOrganizationProfile';
2222
import getOrganization from '../../../api/getOrganization';

packages/react/src/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,12 @@ export interface BaseOrganizationSwitcherProps {
132132
* The HTML element ID where the portal should be mounted
133133
*/
134134
portalId?: string;
135+
/**
136+
* Component-level preferences to override global i18n and theme settings.
137+
* Preferences are deep-merged with global ones, with component preferences
138+
* taking precedence. Affects this component and all its descendants.
139+
*/
140+
preferences?: Preferences;
135141
/**
136142
* Custom render function for the error state.
137143
*/
@@ -156,17 +162,11 @@ export interface BaseOrganizationSwitcherProps {
156162
* Show organization name next to avatar in the trigger button
157163
*/
158164
showTriggerLabel?: boolean;
165+
159166
/**
160167
* Custom styles for the component.
161168
*/
162169
style?: CSSProperties;
163-
164-
/**
165-
* Component-level preferences to override global i18n and theme settings.
166-
* Preferences are deep-merged with global ones, with component preferences
167-
* taking precedence. Affects this component and all its descendants.
168-
*/
169-
preferences?: Preferences;
170170
}
171171

172172
/**

packages/react/src/components/presentation/OrganizationSwitcher/OrganizationSwitcher.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
* under the License.
1717
*/
1818

19-
import {Preferences} from '@asgardeo/browser';
2019
import {FC, ReactElement, useState} from 'react';
2120

2221
import {

packages/react/src/components/presentation/UserProfile/BaseUserProfile.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,17 @@ export interface BaseUserProfileProps {
7878
onOpenChange?: (open: boolean) => void;
7979
onUpdate?: (payload: any) => Promise<void>;
8080
open?: boolean;
81-
profile?: User;
82-
schemas?: Schema[];
83-
showFields?: string[];
84-
title?: string;
85-
8681
/**
8782
* Component-level preferences to override global i18n and theme settings.
8883
* Preferences are deep-merged with global ones, with component preferences
8984
* taking precedence. Affects this component and all its descendants.
9085
*/
9186
preferences?: Preferences;
87+
profile?: User;
88+
schemas?: Schema[];
89+
showFields?: string[];
90+
91+
title?: string;
9292
}
9393

9494
// Fields to skip based on schema.name

packages/react/src/components/presentation/UserProfile/UserProfile.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* under the License.
1717
*/
1818

19-
import {AsgardeoError, User, Preferences} from '@asgardeo/browser';
19+
import {AsgardeoError, User} from '@asgardeo/browser';
2020
import {FC, ReactElement, useState} from 'react';
2121
// eslint-disable-next-line import/no-named-as-default
2222
import BaseUserProfile, {BaseUserProfileProps} from './BaseUserProfile';

0 commit comments

Comments
 (0)