Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: lint

on:
pull_request:
branches:
- main

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install dependencies
run: npm install

- name: Run linter
run: npm run lint
6 changes: 3 additions & 3 deletions src/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const page = () => {
window.analytics.page();
};

export const track = (name: string, properties: any) => {
export const track = (name: string, properties: any) => { // eslint-disable-line @typescript-eslint/no-explicit-any
window.analytics.track(name, properties);
};

Expand Down Expand Up @@ -53,7 +53,7 @@ export const trackLoginStepMovedBack = () => {
track("Login Step Moved Back", {});
};

export const trackSignupStepCompleted = (step: number, data: any) => {
export const trackSignupStepCompleted = (step: number, data: any) => { // eslint-disable-line @typescript-eslint/no-explicit-any
track("Signup Step Completed", { step, data });
};

Expand All @@ -73,7 +73,7 @@ export const trackSettingsTabChanged = (tab: string) => {
track("Settings Tab Changed", { tab });
};

export const trackSettingsSectionModified = (section: string, values?: any) => {
export const trackSettingsSectionModified = (section: string, values?: any) => { // eslint-disable-line @typescript-eslint/no-explicit-any
track("Settings Section Modified", { section, ...values });
};

Expand Down
4 changes: 2 additions & 2 deletions src/components/Auth/ForgotPassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function ForgotPassword() {
onClick: () => {},
},
});
} catch (e) {
} catch (e) { // eslint-disable-line @typescript-eslint/no-unused-vars
setFormError("Failed to start the reset password flow")
} finally {
setLoading(false)
Expand All @@ -110,7 +110,7 @@ function ForgotPassword() {
control={form.control}
name="tenant"
render={({ field }) => {
const { ref, ...restField } = field;
const { ref, ...restField } = field; // eslint-disable-line @typescript-eslint/no-unused-vars
return (
<FormItem>
<FormLabel>Enter your Organization URL</FormLabel>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Auth/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function LoginForm({ onStepChange, onOrganizationURLChange }: LoginFormProps) {
setFormError(null);
const stockError = "Login failed. Please try again.";

const handleLoginErrors = (error: any) => {
const handleLoginErrors = (error: any) => { // eslint-disable-line @typescript-eslint/no-explicit-any
if (isAxiosError(error)) {
const responseError = error.response?.data?.errors?.body;

Expand Down Expand Up @@ -142,4 +142,4 @@ function LoginForm({ onStepChange, onOrganizationURLChange }: LoginFormProps) {
);
}

export default LoginForm;
export default LoginForm;
4 changes: 2 additions & 2 deletions src/components/Auth/LoginOrganizationURLStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function LoginOrganizationURLStep({ onSubmit }: LoginOrganizationURLStepP
control={control}
name="organizationURL"
render={({ field }) => {
const { ref, ...restField } = field;
const { ref, ...restField } = field; // eslint-disable-line @typescript-eslint/no-unused-vars
return (
<FormItem>
<FormLabel>Enter your Organization URL</FormLabel>
Expand Down Expand Up @@ -62,4 +62,4 @@ export function LoginOrganizationURLStep({ onSubmit }: LoginOrganizationURLStepP
</Button>
</form>
);
}
}
4 changes: 3 additions & 1 deletion src/components/Auth/ResetPassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ const ResetPasswordSchema = z.object({
type ResetPasswordData = z.infer<typeof ResetPasswordSchema>;

function ResetPasswordForm() {
// eslint-disable-next-line prefer-const, @typescript-eslint/no-unused-vars
let [searchParams, _] = useSearchParams();

const navigate = useNavigate();
const [loading, setLoading] = useState(false);
const [formError, setFormError] = useState("");
Expand Down Expand Up @@ -170,4 +172,4 @@ function ResetPasswordForm() {
);
}

export default ResetPasswordForm;
export default ResetPasswordForm;
6 changes: 3 additions & 3 deletions src/components/Auth/SignupCredentialsStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import { Button } from "@/components/ui/button";
import { LucideLoader } from "lucide-react";
import NewPasswordField from "./fields/NewPasswordField";

const SignupCredentialsStep = ({ onSubmit, onBack, loading }: { onSubmit: (data: any) => void, onBack: () => void, loading: boolean }) => {
const SignupCredentialsStep = ({ onSubmit, onBack, loading }: { onSubmit: (data: any) => void, onBack: () => void, loading: boolean }) => { // eslint-disable-line @typescript-eslint/no-explicit-any
const { handleSubmit, control } = useFormContext();
const [submittedWithErrors, setSubmittedWithErrors] = useState(false);

const handleFormSubmit = (data: any) => {
const handleFormSubmit = (data: any) => { // eslint-disable-line @typescript-eslint/no-explicit-any
setSubmittedWithErrors(false);
onSubmit(data);
};
Expand Down Expand Up @@ -76,4 +76,4 @@ const SignupCredentialsStep = ({ onSubmit, onBack, loading }: { onSubmit: (data:
);
};

export default SignupCredentialsStep;
export default SignupCredentialsStep;
4 changes: 2 additions & 2 deletions src/components/Auth/SignupForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function SignupForm() {
const maxLoginRetries = 6;
const loginRetryDelay = 3000;

const handleSignupErrors = (error: any) => {
const handleSignupErrors = (error: any) => { // eslint-disable-line @typescript-eslint/no-explicit-any
if (isAxiosError(error)) {
const responseError = error.response?.data?.errors?.body;

Expand Down Expand Up @@ -172,4 +172,4 @@ function SignupForm() {
);
}

export default SignupForm;
export default SignupForm;
6 changes: 3 additions & 3 deletions src/components/AxiosInterceptor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ const AxiosInterceptor: React.FC<AxiosInterceptorProps> = ({ children }) => {
const signOut = useSignOut();

useEffect(() => {
const resInterceptor = (response: any) => {
const resInterceptor = (response: any) => { // eslint-disable-line @typescript-eslint/no-explicit-any
return response;
};

const errInterceptor = (error: any) => {
const errInterceptor = (error: any) => { // eslint-disable-line @typescript-eslint/no-explicit-any
if (error?.response?.status === 401) {
signOut();
trackSignedOut(false);
Expand All @@ -36,4 +36,4 @@ const AxiosInterceptor: React.FC<AxiosInterceptorProps> = ({ children }) => {
return <>{children}</>;
};

export default AxiosInterceptor;
export default AxiosInterceptor;
5 changes: 3 additions & 2 deletions src/components/Settings/AppearanceSettings.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useTheme } from "@/components/ThemeProvider";
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "@/components/ui/form";
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "@/components/ui/form"; // eslint-disable-line @typescript-eslint/no-unused-vars

import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
import { zodResolver } from "@hookform/resolvers/zod";
import React, { useEffect } from 'react';
Expand Down Expand Up @@ -85,4 +86,4 @@ const AppearanceSettings: React.FC = () => {
);
};

export default AppearanceSettings;
export default AppearanceSettings;
14 changes: 9 additions & 5 deletions src/components/Settings/OrganizationSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ const OrganizationSettings: React.FC = () => {
deleteForm.reset({
tenant_id: "",
});
} catch (error) {
} catch (error) { // eslint-disable-line @typescript-eslint/no-unused-vars

toast.error('Failed to load organization data');
}
};
Expand All @@ -99,7 +100,8 @@ const OrganizationSettings: React.FC = () => {
toast.success('Organization details updated successfully');
setAccountData((prev) => ({ ...prev, ...dataToSend }));
form.reset(values);
} catch (error) {
} catch (error) { // eslint-disable-line @typescript-eslint/no-unused-vars

toast.error('Failed to update Organization details');
}
}
Expand All @@ -112,7 +114,8 @@ const OrganizationSettings: React.FC = () => {
signOut();
trackSignedOut(false);
navigate('/login');
} catch (error) {
} catch (error) { // eslint-disable-line @typescript-eslint/no-unused-vars

toast.error('Failed to delete Organization');
}
}
Expand Down Expand Up @@ -201,7 +204,8 @@ const OrganizationSettings: React.FC = () => {
control={deleteForm.control}
name="tenant_id"
render={({ field }) => {
const { ref, ...restField } = field;
const { ref, ...restField } = field; // eslint-disable-line @typescript-eslint/no-unused-vars

return (
<FormItem>
<FormLabel>Enter your Organization URL to confirm</FormLabel>
Expand Down Expand Up @@ -250,4 +254,4 @@ const OrganizationSettings: React.FC = () => {
);
};

export default OrganizationSettings;
export default OrganizationSettings;
7 changes: 4 additions & 3 deletions src/components/Settings/ProfileSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ const ProfileSettings: React.FC = () => {
form.reset({
name: data.name,
});
} catch (error) {
} catch (error) { // eslint-disable-line @typescript-eslint/no-unused-vars

toast.error('Failed to load profile data');
}
}
Expand All @@ -59,7 +60,7 @@ const ProfileSettings: React.FC = () => {
await updateUserData(userData.id, values);
toast.success('Profile updated successfully');
form.reset(values);
} catch (error) {
} catch (error) { // eslint-disable-line @typescript-eslint/no-unused-vars
toast.error('Failed to update profile');
}
}
Expand Down Expand Up @@ -110,4 +111,4 @@ const ProfileSettings: React.FC = () => {
);
};

export default ProfileSettings;
export default ProfileSettings;
8 changes: 4 additions & 4 deletions src/components/Settings/SettingsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ interface Subsection {
interface SettingsSectionProps {
title: string;
description: string;
form: UseFormReturn<any>;
onSubmit: (values: any) => void;
form: UseFormReturn<any>; // eslint-disable-line @typescript-eslint/no-explicit-any
onSubmit: (values: any) => void; // eslint-disable-line @typescript-eslint/no-explicit-any
subsections: Subsection[];
}

Expand All @@ -24,7 +24,7 @@ const SettingsSection: React.FC<SettingsSectionProps> = ({ title, description, f
"Appearance": true,
};

const handleSettingsSectionFormSubmit = (values: any) => {
const handleSettingsSectionFormSubmit = (values: any) => { // eslint-disable-line @typescript-eslint/no-explicit-any
if (sectionsToSendValues[title]) {
trackSettingsSectionModified(title, values);
} else {
Expand Down Expand Up @@ -78,4 +78,4 @@ const SettingsSection: React.FC<SettingsSectionProps> = ({ title, description, f
);
};

export default SettingsSection;
export default SettingsSection;
9 changes: 5 additions & 4 deletions src/components/Settings/SubscriptionsSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import { LucideCircleAlert } from 'lucide-react';

const SubscriptionSettings: React.FC = () => {
const [subscriptions, setSubscriptions] = useState<Subscription[]>([]);

useEffect(() => {
const fetchSubscriptions = async () => {
try {
const subscriptionsData = await getSubscriptions();
setSubscriptions(subscriptionsData);
} catch (error) {
} catch (error) { // eslint-disable-line @typescript-eslint/no-unused-vars

toast.error('Failed to load subscriptions');
}
};
Expand All @@ -27,7 +28,7 @@ const SubscriptionSettings: React.FC = () => {
Manage your subscription information
</h3>

<div className="space-y-4">
<div className="space-y-4">
{subscriptions.length > 0 ? (
subscriptions.map((subscription) => {

Expand Down Expand Up @@ -73,4 +74,4 @@ const SubscriptionSettings: React.FC = () => {
);
};

export default SubscriptionSettings;
export default SubscriptionSettings;
12 changes: 6 additions & 6 deletions src/components/ui/DataProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Loader } from "@/components/ui/Loader"

interface DataProviderContextValue<TData> {
data: TData[]
columns: ColumnDef<TData, any>[]
columns: ColumnDef<TData, any>[] // eslint-disable-line @typescript-eslint/no-explicit-any
sorting: SortingState
setSorting: (sorting: SortingState) => void
globalFilter: string
Expand All @@ -19,7 +19,7 @@ interface DataProviderContextValue<TData> {
isLoading?: boolean
}

const DataProviderContext = React.createContext<DataProviderContextValue<any>>({} as any)
const DataProviderContext = React.createContext<DataProviderContextValue<any>>({} as any) // eslint-disable-line @typescript-eslint/no-explicit-any

interface DataWithId {
id: string | number;
Expand All @@ -31,7 +31,7 @@ interface DataWithId {
*/
interface DataProviderProps<TData extends DataWithId> {
data: TData[];
columns: ColumnDef<TData, any>[];
columns: ColumnDef<TData, any>[]; // eslint-disable-line @typescript-eslint/no-explicit-any
children: React.ReactNode;
initialSort?: { id: string; desc: boolean };
reactTableExtraOptions?: Partial<TableOptions<TData>>;
Expand Down Expand Up @@ -137,7 +137,7 @@ const DataSort = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivEl
DataSort.displayName = "DataSort"

interface DataGridProps {
renderItem: (item: any) => React.ReactNode
renderItem: (item: any) => React.ReactNode // eslint-disable-line @typescript-eslint/no-explicit-any
children?: React.ReactNode
className?: string
}
Expand All @@ -159,8 +159,8 @@ const DataGrid = React.forwardRef<HTMLDivElement, DataGridProps>(
})
DataGrid.displayName = "DataGrid"

interface DataTableProps<TMeta = any> extends React.HTMLAttributes<HTMLDivElement> {
onRowClick?: (row: any) => void;
interface DataTableProps<TMeta = any> extends React.HTMLAttributes<HTMLDivElement> { // eslint-disable-line @typescript-eslint/no-explicit-any
onRowClick?: (row: any) => void; // eslint-disable-line @typescript-eslint/no-explicit-any
rowsAppend?: React.ReactNode;
meta?: TMeta;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/Multi-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export const MultiSelect = React.forwardRef<
animation = 0,
maxCount = 3,
modalPopover = false,
asChild = false,
asChild = false, // eslint-disable-line @typescript-eslint/no-unused-vars
className,
...props
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { cn } from "@/lib/utils"

type CardProps = React.HTMLAttributes<HTMLDivElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & { asChild?: boolean };

const getCardComponentType = (asChild: boolean | undefined, onClick: React.MouseEventHandler<any> | undefined) => {
const getCardComponentType = (asChild: boolean | undefined, onClick: React.MouseEventHandler<any> | undefined) => { // eslint-disable-line @typescript-eslint/no-explicit-any
if (asChild) return Slot;
if (onClick) return 'button';
return 'div';
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ ChartContainer.displayName = "Chart"

const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {
const colorConfig = Object.entries(config).filter(
([_, config]) => config.theme || config.color
([_, config]) => config.theme || config.color // eslint-disable-line @typescript-eslint/no-unused-vars
)

if (!colorConfig.length) {
Expand Down
Loading