Skip to content

Commit

Permalink
[Fix] Roll back lint coalescing bugs (#11757)
Browse files Browse the repository at this point in the history
* Fix lint coalescing bugs

* type to boolean

* type coercion to boolean
  • Loading branch information
petertgiles authored Oct 16, 2024
1 parent 837063d commit 1d9e2f0
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const DialogFooter = ({ saveText, disabled }: DialogFooterProps) => {
type="submit"
mode="solid"
color="secondary"
disabled={disabled ?? isSubmitting}
disabled={disabled || isSubmitting}
>
<span>{saveText ?? intl.formatMessage(formMessages.saveChanges)}</span>
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ const ResponsiveTable = <TData extends object, TFilters = object>({
))}
</Table.Body>
</Table.Table>
{(rowSelect ?? download?.all) && (
{(!!rowSelect || !!download?.all) && (
<RowSelection.Actions
{...{
rowSelect: !!rowSelect,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ const Actions = ({
})}
</Button>
</span>
{(download?.csv?.enable ?? download?.doc?.enable) && (
{(download?.csv?.enable || download?.doc?.enable) && (
<span
data-h2-align-items="base(center)"
data-h2-display="base(flex)"
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/Table/ResponsiveTable/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const getCellStyles: GetCellStyles = ({
isRowSelect,
shouldShrink,
}) => {
const shrinkCol = shouldShrink ?? isRowSelect;
const shrinkCol = shouldShrink || isRowSelect;
return {
td: {
...(!isRowTitle &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const DiversityEquityInclusionSection = ({
</div>
</div>
)}
{(isWoman ?? isVisibleMinority ?? hasDisability) && (
{(isWoman || isVisibleMinority || hasDisability) && (
<ul
data-h2-font-weight="base(700)"
data-h2-padding="base(x1, 0, 0, x1)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,8 @@ const SpecialNoteSection = ({
});

const dataToFormValues = (initialData: Pool): FormValues => ({
hasSpecialNote: !!(
initialData.specialNote?.en ?? initialData.specialNote?.fr
),
hasSpecialNote:
!!initialData.specialNote?.en || !!initialData.specialNote?.fr,
specialNoteEn: initialData.specialNote?.en ?? "",
specialNoteFr: initialData.specialNote?.fr ?? "",
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const AboutSection = ({ user }: BasicUserInformationProps) => {
)}
</p>
</div>
{(user.currentCity ?? user.currentProvince) && (
{(!!user.currentCity || !!user.currentProvince) && (
<div data-h2-flex-item="base(1of1) p-tablet(1of2) desktop(1of3)">
<p data-h2-font-weight="base(700)">
{intl.formatMessage({
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/Accordion/Accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ const Trigger = forwardRef<
</span>
</span>

{(Icon ?? context) && (
{(!!Icon || !!context) && (
<span
data-h2-align-items="base(center)"
data-h2-display="base(flex)"
Expand Down

0 comments on commit 1d9e2f0

Please sign in to comment.