Skip to content

Commit

Permalink
chore: enable no-constant-binary-expression lint rule; fix offendin…
Browse files Browse the repository at this point in the history
…g code (#1384)
  • Loading branch information
kswenson authored Jul 31, 2024
1 parent 8cc89cd commit 7d25d65
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions v3/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ module.exports = {
"keyword-spacing": ["warn"],
"max-len": ["warn", { code: 120, ignoreUrls: true }],
"no-bitwise": "error",
"no-constant-binary-expression": "error",
"no-debugger": "off",
"no-duplicate-imports": "error",
"no-sequences": "error",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ export const EditAttributePropertiesModal = ({ attributeId, isOpen, onClose }: I
)
attribute.setName(newName)
}
if (description !== attribute.description ?? "") {
if (description !== (attribute.description ?? "")) {
attribute.setDescription(description || undefined)
}
if (units !== attribute.units ?? "") {
if (units !== (attribute.units ?? "")) {
attribute.setUnits(units || undefined)
}
if (userType !== attribute.userType ?? "none") {
if (userType !== (attribute.userType ?? "none")) {
attribute.setUserType(userType === "none" ? undefined : userType)
}
if (precision !== `${attribute?.precision ?? ""}`) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export const NormalCurveAdornmentComponent = observer(
const labelSelection = select(labelRef.current)
const labelCoords = measure.labelCoords
const lineHeight = 20
const topOffset = lineHeight * adornmentsStore?.getLabelLinesAboveAdornment(model) ?? 0
const topOffset = lineHeight * (adornmentsStore?.getLabelLinesAboveAdornment(model) ?? 0)
const labelLeft = labelCoords
? labelCoords.x / cellCounts.x
: isVertical.current
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const StandardErrorAdornmentComponent = observer(
const labelSelection = select(labelRef.current)
const labelCoords = measure.labelCoords
const lineHeight = 20
const topOffset = lineHeight * adornmentsStore?.getLabelLinesAboveAdornment(model, isGaussianFit) ?? 0
const topOffset = lineHeight * (adornmentsStore?.getLabelLinesAboveAdornment(model, isGaussianFit) ?? 0)
const labelLeft = labelCoords
? labelCoords.x / cellCounts.x
: isVertical.current
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const UnivariateMeasureAdornmentSimpleComponent = observer(
const lineHeight = 20
// We have to pass isGaussianFit to getLabelLinesAboveAdornment because the Gaussian fit is a special case where
// if there is a gaussianFit (not just a normal curve), we need to add an extra line for the adornment title.
const topOffset = lineHeight * adornmentsStore?.getLabelLinesAboveAdornment(model, isGaussianFit) ?? 0
const topOffset = lineHeight * (adornmentsStore?.getLabelLinesAboveAdornment(model, isGaussianFit) ?? 0)
let labelLeft = labelCoords
? labelCoords.x / cellCounts.x
: isVertical.current
Expand Down

0 comments on commit 7d25d65

Please sign in to comment.