Skip to content

Commit

Permalink
chore(clerk-js): Fix or temp disable ESLint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tmilewski committed Oct 19, 2023
1 parent ad9e965 commit 6086101
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .changeset/empty-terms-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
with:
use-turbo-cache: 'true'
- name: Run lint
run: npm run lint
run: npm run lint -- --output-logs=errors-only -- --quiet

unit-tests:
name: Run unit tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const InviteMembersPage = withCardStateProvider(() => {
const reachedOrganizationMemberLimit =
!!__unstable_manageBillingMembersLimit &&
runIfFunctionOrReturn(__unstable_manageBillingMembersLimit) <=
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
organization.pendingInvitationsCount + organization.membersCount;

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ export const MembershipWidget = () => {
return null;
}

// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
const totalCount = organization?.membersCount + organization?.pendingInvitationsCount;

return (
<Flex
sx={theme => ({
Expand Down Expand Up @@ -57,7 +60,7 @@ export const MembershipWidget = () => {
color: t.colors.$blackAlpha600,
})}
>
{organization?.membersCount + organization?.pendingInvitationsCount} of{' '}
{totalCount} of{' '}
{__unstable_manageBillingMembersLimit
? `${runIfFunctionOrReturn(__unstable_manageBillingMembersLimit)} members`
: 'unlimited'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const ProfileSettingsPage = withCardStateProvider(() => {
const dataChanged = organization.name !== nameField.value || organization.slug !== slugField.value;
const canSubmit = (dataChanged || avatarChanged) && !slugField.errorText;

// eslint-disable-next-line @typescript-eslint/require-await
const onSubmit = async (e: React.FormEvent) => {
e.preventDefault();
return (dataChanged ? organization.update({ name: nameField.value, slug: slugField.value }) : Promise.resolve())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ const NotificationCountBadgeSwitcherTrigger = withGate(
});

const notificationCount =
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
(userInvitations.count || 0) + (userSuggestions.count || 0) + (membershipRequests?.count || 0);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const AddConnectedAccount = () => {
const isModal = mode === 'modal';

const enabledStrategies = strategies.filter(s => s.startsWith('oauth')) as OAuthStrategy[];
const connectedStrategies = user.verifiedExternalAccounts.map(a => 'oauth_' + a.provider) as OAuthStrategy[];
const connectedStrategies = user.verifiedExternalAccounts.map(a => `oauth_${a.provider}`) as OAuthStrategy[];

const unconnectedStrategies = enabledStrategies.filter(provider => {
return !connectedStrategies.includes(provider);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const EmailPage = withCardStateProvider(() => {

const canSubmit = emailField.value.length > 1 && user.username !== emailField.value;

// eslint-disable-next-line @typescript-eslint/require-await
const addEmail = async (e: React.FormEvent) => {
e.preventDefault();
return user
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export const AddPhone = (props: AddPhoneProps) => {

const canSubmit = phoneField.value.length > 1 && user.username !== phoneField.value;

// eslint-disable-next-line @typescript-eslint/require-await
const addPhone = async (e: React.FormEvent) => {
e.preventDefault();
return user
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export const ProfilePage = withCardStateProvider(() => {

const nameEditDisabled = user.samlAccounts.some(sa => sa.active);

// eslint-disable-next-line @typescript-eslint/require-await
const onSubmit = async (e: React.FormEvent) => {
e.preventDefault();

Expand Down

0 comments on commit 6086101

Please sign in to comment.