Skip to content

Commit

Permalink
Merge pull request #163 from sebanimm/main
Browse files Browse the repository at this point in the history
chore(lint): eslint react-hooks/exhaustive-deps 규칙 관련 코드 수정
  • Loading branch information
Ubinquitous authored Jan 5, 2024
2 parents 705b153 + 4ba6237 commit 8e3422f
Show file tree
Hide file tree
Showing 10 changed files with 4 additions and 14 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,6 @@ module.exports = {
],
"react/no-array-index-key": 0,
"consistent-return": 0,
"react-hooks/exhaustive-deps": "off",
},
};
3 changes: 2 additions & 1 deletion src/assets/icons/ArrowIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ const ArrowIcon = ({

const StyledSVG = styled.svg`
cursor: pointer;
`
`;

export default ArrowIcon;
4 changes: 0 additions & 4 deletions src/components/common/DragDrop/hooks/useDragDrop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const useDragDrop = (handler: (file?: File) => void) => {
handler(currentFile);
setFile(currentFile);
},
// eslint-disable-next-line
[],
);

Expand All @@ -40,13 +39,11 @@ const useDragDrop = (handler: (file?: File) => void) => {
const handleDragOut = React.useCallback((e: DragEvent) => {
handleDragIn(e);
setIsDragging(false);
// eslint-disable-next-line
}, []);

const handleDragOver = React.useCallback((e: DragEvent) => {
handleDragIn(e);
if (e.dataTransfer) setIsDragging(true);
// eslint-disable-next-line
}, []);

const handleDrop = React.useCallback(
Expand All @@ -55,7 +52,6 @@ const useDragDrop = (handler: (file?: File) => void) => {
handleChangeFiles(e as unknown as React.DragEvent<HTMLInputElement>);
setIsDragging(false);
},
// eslint-disable-next-line
[handleChangeFiles],
);

Expand Down
1 change: 0 additions & 1 deletion src/hooks/useDidMountEffect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const useDidMountEffect = (func: () => void, deps: React.DependencyList) => {
React.useEffect(() => {
if (didMount.current) func();
else didMount.current = true;
// eslint-disable-next-line
}, deps);
};

Expand Down
3 changes: 1 addition & 2 deletions src/provider/StyledComponentsProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ const StyledComponentsRegistry = ({ children }: React.PropsWithChildren) => {
useServerInsertedHTML(() => {
const styles = styledComponentsStyleSheet.getStyleElement();
styledComponentsStyleSheet.instance.clearTag();
// eslint-disable-next-line

return <>{styles}</>;
});

// eslint-disable-next-line
if (typeof window !== "undefined") return <>{children}</>;

return (
Expand Down
1 change: 0 additions & 1 deletion src/templates/meal/hooks/useMeal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ const useMeal = () => {

window.addEventListener("keydown", handleMealDateKeyDown);
return () => window.removeEventListener("keydown", handleMealDateKeyDown);
// eslint-disable-next-line
}, []);

return {
Expand Down
2 changes: 0 additions & 2 deletions src/templates/meister/hooks/useMeister.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,11 @@ const useMeister = () => {
setViewType("분석");
meisterDetailQuery.refetch().then(() => setButtonSwitch(false));
}
// eslint-disable-next-line
}, [buttonSwitch]);

React.useEffect(() => {
handleStudentSearchClick();
setStudentNum(getStudentId(grade, classNum, studentNumber));
// eslint-disable-next-line
}, []);

React.useEffect(() => {
Expand Down
1 change: 0 additions & 1 deletion src/templates/meister/layouts/Ranking.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const Ranking = () => {

useDidMountEffect(() => {
refetch();
// eslint-disable-next-line
}, [currentGrade]);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const CommentWritableBox = ({ ...comment }: Comment) => {

React.useEffect(() => {
setCommentInput(comment.detail);
// eslint-disable-next-line
}, []);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const RecommentWritableBox = ({ ...recomment }: Recomment) => {

React.useEffect(() => {
setRecommentInput(recomment.detail);
// eslint-disable-next-line
}, []);

return (
Expand Down

0 comments on commit 8e3422f

Please sign in to comment.