Skip to content

Commit

Permalink
enable no-param-reassign rule
Browse files Browse the repository at this point in the history
  • Loading branch information
sickelap committed Nov 5, 2023
1 parent bd0480d commit a93432d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ module.exports = {
extends: ["airbnb", "airbnb-typescript", "airbnb/hooks", "prettier"],
plugins: ["prettier"],
rules: {
"no-param-reassign": "off",
"import/prefer-default-export": "off",
"import/no-cycle": "off",
"react/jsx-props-no-spreading": "off", // some Mantine components need to use spread operator
Expand Down
2 changes: 2 additions & 0 deletions src/components/locationLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ export function LocationLink(props: Props) {
rx={5}
stroke="#dddddd"
onClick={() => {
// eslint-disable-next-line no-param-reassign
node.data.isExpanded = !node.data.isExpanded;
}}
/>
Expand All @@ -212,6 +213,7 @@ export function LocationLink(props: Props) {
strokeOpacity={!node.data.children ? 1 : 1}
rx={!node.data.children ? 5 : 5}
onClick={() => {
// eslint-disable-next-line no-param-reassign
node.data.isExpanded = !node.data.isExpanded;
}}
/>
Expand Down
4 changes: 2 additions & 2 deletions src/components/react-pig/computeLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
import getMinAspectRatio from "./utils/getMinAspectRatio";

export default function computeLayout({ imageData, settings, totalHeight, wrapperWidth, scaleOfImages }) {
export default function computeLayout({ imageData, settings, wrapperWidth, scaleOfImages }) {
// Compute the minimum aspect ratio that should be applied to the rows.
const minAspectRatio = getMinAspectRatio(wrapperWidth, scaleOfImages);

Expand Down Expand Up @@ -82,7 +82,7 @@ export default function computeLayout({ imageData, settings, totalHeight, wrappe
}
});
// No space below the last image
totalHeight = translateY - settings.gridGap;
const totalHeight = translateY - settings.gridGap;

return {
imageData: tempImgData,
Expand Down
4 changes: 2 additions & 2 deletions src/components/react-pig/computeLayoutGroups.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// like computeLayout but specific for groups. Could combine them but it might get messy
import getMinAspectRatio from "./utils/getMinAspectRatio";

export default function computeLayoutGroups({ imageData, settings, totalHeight, wrapperWidth, scaleOfImages }) {
export default function computeLayoutGroups({ imageData, settings, wrapperWidth, scaleOfImages }) {
// Compute the minimum aspect ratio that should be applied to the rows.
const minAspectRatio = getMinAspectRatio(wrapperWidth, scaleOfImages);
const groupTitleHeight = 50; // wrapperWidth < settings.breakpoint ? 50 : 50
Expand Down Expand Up @@ -87,7 +87,7 @@ export default function computeLayoutGroups({ imageData, settings, totalHeight,
});

// No space below the last image
totalHeight = translateY - settings.gridGap;
const totalHeight = translateY - settings.gridGap;

return {
imageData: tempGroupData,
Expand Down
1 change: 1 addition & 0 deletions src/store/faces/faceSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ const faceSlice = createSlice({
const { tab, position } = action.payload;
if (tab in state.tabs) {
// @ts-ignore
// eslint-disable-next-line no-param-reassign
state.tabs[tab].scrollPosition = position;
}
},
Expand Down

0 comments on commit a93432d

Please sign in to comment.