Skip to content

Commit

Permalink
chore: eslint import change
Browse files Browse the repository at this point in the history
  • Loading branch information
sikkzz committed Apr 10, 2024
1 parent d327d9f commit ffa13bb
Show file tree
Hide file tree
Showing 48 changed files with 934 additions and 886 deletions.
33 changes: 29 additions & 4 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"endOfLine": "auto",
"singleQuote": false,
"parser": "typescript",
"semi": true,
"tabWidth": 2,
"trailingComma": "all",
"useTabs": true,
"printWidth": 100
"printWidth": 100,
"semi": true,
"importOrderSeparation": true,
"importOrderSortSpecifiers": true
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"eslint-plugin-n": "^15.0.0 || ^16.0.0 ",
"eslint-plugin-prettier": "4.0.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react": "^7.34.1",
"husky": "^8.0.3",
"lint-staged": "^15.0.2",
"prettier": "2.8.8",
Expand Down
2 changes: 1 addition & 1 deletion packages/waggle-design-system/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"node": true
},
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint","import"],
"plugins": ["@typescript-eslint", "react"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
Expand Down
19 changes: 19 additions & 0 deletions packages/waggle-design-system/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"endOfLine": "auto",
"singleQuote": false,
"tabWidth": 2,
"printWidth": 100,
"semi": true,
"importOrder": [
"^@/utils/(.*)$",
"^@/api/(.*)$",
"^@/hooks/(.*)$",
"^@/pages/(.*)$",
"^@/components/(.*)$",
"^@/styles/(.*)$",
"^[./]"
],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true
}

2 changes: 2 additions & 0 deletions packages/waggle-design-system/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"@storybook/react-webpack5": "^7.6.8",
"@storybook/testing-library": "^0.0.14-next.2",
"@svgr/webpack": "^8.0.1",
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
"@types/babel__core": "^7",
"@types/babel__preset-env": "^7",
"@types/eslint": "^8",
Expand All @@ -79,6 +80,7 @@
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.6",
"eslint-plugin-storybook": "^0.6.15",
Expand Down
8 changes: 4 additions & 4 deletions packages/waggle-design-system/src/WaggleProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import { Theme } from "@/styles/Theme";
type WaggleProviderProps = PropsWithChildren;

const WaggleProvider = ({ children }: WaggleProviderProps) => (
<ThemeProvider theme={Theme}>
<Global styles={GlobalStyle} />
{children}
</ThemeProvider>
<ThemeProvider theme={Theme}>
<Global styles={GlobalStyle} />
{children}
</ThemeProvider>
);

export default WaggleProvider;
6 changes: 3 additions & 3 deletions packages/waggle-design-system/src/assets/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
declare module "*.svg" {
import type React from "react";
import type React from "react";

const SVG: React.FC<React.SVGProps<SVGSVGElement>>;
export default SVG;
const SVG: React.FC<React.SVGProps<SVGSVGElement>>;
export default SVG;
}
154 changes: 77 additions & 77 deletions packages/waggle-design-system/src/components/Box/Box.styles.ts
Original file line number Diff line number Diff line change
@@ -1,85 +1,85 @@
import { css } from "@emotion/react";

export interface BoxStylingProps {
width?: string;
height?: string;
margin?: string;
marginRight?: string;
marginTop?: string;
marginLeft?: string;
marginBottom?: string;
padding?: string;
paddingTop?: string;
paddingRight?: string;
paddingBottom?: string;
paddingLeft?: string;
border?: string;
borderRadius?: string;
borderColor?: string;
borderTop?: string;
borderRight?: string;
borderBottom?: string;
borderLeft?: string;
backgroundColor?: string;
color?: string;
position?: "static" | "absolute" | "relative" | "fixed" | "inherit";
boxShadow?: string;
maxWidth?: string;
maxHeight?: string;
width?: string;
height?: string;
margin?: string;
marginRight?: string;
marginTop?: string;
marginLeft?: string;
marginBottom?: string;
padding?: string;
paddingTop?: string;
paddingRight?: string;
paddingBottom?: string;
paddingLeft?: string;
border?: string;
borderRadius?: string;
borderColor?: string;
borderTop?: string;
borderRight?: string;
borderBottom?: string;
borderLeft?: string;
backgroundColor?: string;
color?: string;
position?: "static" | "absolute" | "relative" | "fixed" | "inherit";
boxShadow?: string;
maxWidth?: string;
maxHeight?: string;
}

export const getBoxStyling = ({
width = "",
height = "",
margin = "",
marginRight = "",
marginTop = "",
marginLeft = "",
marginBottom = "",
padding = "",
paddingTop = "",
paddingRight = "",
paddingBottom = "",
paddingLeft = "",
border = "",
borderRadius = "",
borderColor = "",
borderTop = "",
borderRight = "",
borderBottom = "",
borderLeft = "",
backgroundColor = "",
color = "",
position = "static",
boxShadow = "",
maxWidth = "",
maxHeight = "",
width = "",
height = "",
margin = "",
marginRight = "",
marginTop = "",
marginLeft = "",
marginBottom = "",
padding = "",
paddingTop = "",
paddingRight = "",
paddingBottom = "",
paddingLeft = "",
border = "",
borderRadius = "",
borderColor = "",
borderTop = "",
borderRight = "",
borderBottom = "",
borderLeft = "",
backgroundColor = "",
color = "",
position = "static",
boxShadow = "",
maxWidth = "",
maxHeight = "",
}: BoxStylingProps) => {
return css({
width,
height,
margin,
marginRight,
marginTop,
marginLeft,
marginBottom,
padding,
paddingTop,
paddingRight,
paddingBottom,
paddingLeft,
border,
borderRadius,
borderColor,
borderTop,
borderRight,
borderBottom,
borderLeft,
backgroundColor,
color,
position,
boxShadow,
maxWidth,
maxHeight,
});
return css({
width,
height,
margin,
marginRight,
marginTop,
marginLeft,
marginBottom,
padding,
paddingTop,
paddingRight,
paddingBottom,
paddingLeft,
border,
borderRadius,
borderColor,
borderTop,
borderRight,
borderBottom,
borderLeft,
backgroundColor,
color,
position,
boxShadow,
maxWidth,
maxHeight,
});
};
28 changes: 14 additions & 14 deletions packages/waggle-design-system/src/components/Box/Box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@ import type { BoxStylingProps } from "@/components/Box/Box.styles";
import { getBoxStyling } from "@/components/Box/Box.styles";

export interface BoxProps extends ComponentPropsWithoutRef<"div"> {
/**
* Box 컴포넌트가 사용할 HTML 태그
*
* @default 'div'
*/
tag?: ElementType;
/** Box 컴포넌트 스타일 옵션 */
styles?: BoxStylingProps;
/**
* Box 컴포넌트가 사용할 HTML 태그
*
* @default 'div'
*/
tag?: ElementType;
/** Box 컴포넌트 스타일 옵션 */
styles?: BoxStylingProps;
}

const Box = ({ tag = "div", styles = {}, children, ...attributes }: BoxProps) => {
const Tag = tag;
const Tag = tag;

return (
<Tag css={getBoxStyling(styles)} {...attributes}>
{children}
</Tag>
);
return (
<Tag css={getBoxStyling(styles)} {...attributes}>
{children}
</Tag>
);
};

export default Box;
Loading

0 comments on commit ffa13bb

Please sign in to comment.