Skip to content

Commit

Permalink
Setting prettier, eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
cause38 committed Jun 13, 2024
1 parent 8156a9e commit 41befb0
Show file tree
Hide file tree
Showing 156 changed files with 3,793 additions and 3,122 deletions.
39 changes: 8 additions & 31 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,19 @@
"node": true,
"jest": true
},
"extends": [
"plugin:@typescript-eslint/recommended"
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"parser": "@typescript-eslint/parser",
"plugins": [
"@stylistic",
"react"
],
"plugins": ["prettier", "react"],
"rules": {
"@stylistic/jsx-indent": ["error", 2],
"@stylistic/quotes": ["error", "double"],
"@stylistic/object-curly-spacing": ["error", "always"],
"@stylistic/comma-dangle": ["error", "always-multiline"],
"@stylistic/eol-last": ["error", "always"],
"@stylistic/no-trailing-spaces": "error",
"@stylistic/no-multi-spaces": "error",
"@stylistic/comma-spacing": ["error", { "before": false, "after": true }],
"@stylistic/key-spacing": ["error", { "afterColon": true, "beforeColon": false }],
"@stylistic/semi": ["error", "always"],
"@stylistic/space-in-parens": ["error", "never"],
"@stylistic/arrow-spacing": "error",
"@stylistic/no-extra-semi": "error",
"@stylistic/array-bracket-spacing": ["error","always",{"singleValue": false}],
"@stylistic/comma-style": ["error","last"],
"@stylistic/array-element-newline" : ["error","consistent"],
"@stylistic/arrow-parens": ["error", "as-needed"],
"@stylistic/block-spacing": "error",
"@stylistic/brace-style": "error",
"@stylistic/jsx-equals-spacing": [2, "always"],
"@stylistic/function-call-argument-newline": ["error", "consistent"],
"@stylistic/no-multiple-empty-lines": ["error", { "max": 1, "maxEOF": 1 }],
"react/jsx-first-prop-new-line": ["error", "multiline"],
"@typescript-eslint/no-inferrable-types": "off"
}
"@typescript-eslint/no-inferrable-types": "off",
"semi": [2, "always"]
},
"extends": [
"plugin:prettier/recommended",
"prettier"
]
}
10 changes: 10 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"semi": true,
"useTabs": false,
"tabWidth": 2,
"singleQuote": true,
"jsxSingleQuote": true,
"trailingComma": "all",
"plugins": ["prettier-plugin-tailwindcss"],
"tailwindFunctions": ["clsx"]
}
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"lint:fix": "eslint . --ext ts,tsx --report-unused-disable-directives --fix",
"preview": "vite preview",
"storybook": "storybook dev -p 6006",
"storybook:build": "storybook build"
"storybook:build": "storybook build",
"format": "prettier --write \"src/**/*.{ts,tsx,css}\""
},
"peerDependencies": {
"@types/react": "18.2.0",
Expand Down Expand Up @@ -71,13 +72,17 @@
"@typescript-eslint/parser": "6.11.0",
"@vitejs/plugin-react": "4.0.3",
"eslint": "8.54.0",
"eslint-config-prettier": "9.1.0",
"eslint-config-standard-with-typescript": "39.1.1",
"eslint-plugin-import": "2.29.0",
"eslint-plugin-n": "16.3.1",
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-promise": "6.1.1",
"eslint-plugin-react": "7.33.2",
"eslint-plugin-react-hooks": "4.6.0",
"eslint-plugin-storybook": "0.6.15",
"prettier": "3.1.1",
"prettier-plugin-tailwindcss": "0.5.11",
"storybook": "7.5.3",
"tailwind-merge": "2.0.0",
"tsc-alias": "1.8.8",
Expand Down
50 changes: 26 additions & 24 deletions src/constants/color.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
export const THEME_COLOR = {
WHITE: "white",
BLACK: "black",
GRAY_09: "gray-09",
GRAY_08: "gray-08",
GRAY_07: "gray-07",
GRAY_06: "gray-06",
GRAY_05: "gray-05",
GRAY_04: "gray-04",
GRAY_03: "gray-03",
GRAY_02: "gray-02",
GRAY_01: "gray-01",
GRAY_00: "gray-00",
PRIMARY_06: "primary-06",
PRIMARY_05: "primary-05",
PRIMARY_04: "primary-04",
PRIMARY_03: "primary-03",
PRIMARY_02: "primary-02",
PRIMARY_01: "primary-01",
PRIMARY_00: "primary-00",
ERROR: "error",
WARNING: "warning",
SUCCESS: "success",
TRANSPARENT: "transparent",
WHITE: 'white',
BLACK: 'black',
GRAY_09: 'gray-09',
GRAY_08: 'gray-08',
GRAY_07: 'gray-07',
GRAY_06: 'gray-06',
GRAY_05: 'gray-05',
GRAY_04: 'gray-04',
GRAY_03: 'gray-03',
GRAY_02: 'gray-02',
GRAY_01: 'gray-01',
GRAY_00: 'gray-00',
PRIMARY_06: 'primary-06',
PRIMARY_05: 'primary-05',
PRIMARY_04: 'primary-04',
PRIMARY_03: 'primary-03',
PRIMARY_02: 'primary-02',
PRIMARY_01: 'primary-01',
PRIMARY_00: 'primary-00',
ERROR: 'error',
WARNING: 'warning',
SUCCESS: 'success',
TRANSPARENT: 'transparent',
};

export const ColorOptions = Object.keys(THEME_COLOR).map(color => THEME_COLOR[color as keyof typeof THEME_COLOR]);
export const ColorOptions = Object.keys(THEME_COLOR).map(
(color) => THEME_COLOR[color as keyof typeof THEME_COLOR],
);
90 changes: 45 additions & 45 deletions src/constants/index.ts
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
export const ColorOptions = [
"white",
"black",
"gray-09",
"gray-08",
"gray-07",
"gray-06",
"gray-05",
"gray-04",
"gray-03",
"gray-02",
"gray-01",
"gray-00",
"primary-06",
"primary-05",
"primary-04",
"primary-03",
"primary-02",
"primary-01",
"primary-00",
"error",
"warning",
"success",
"transparent",
'white',
'black',
'gray-09',
'gray-08',
'gray-07',
'gray-06',
'gray-05',
'gray-04',
'gray-03',
'gray-02',
'gray-01',
'gray-00',
'primary-06',
'primary-05',
'primary-04',
'primary-03',
'primary-02',
'primary-01',
'primary-00',
'error',
'warning',
'success',
'transparent',
];

export const TypographyOptions = [
"head-01-regular",
"head-01-medium",
"head-01-bold",
"head-02-regular",
"head-02-medium",
"head-02-bold",
"subhead-01-regular",
"subhead-01-medium",
"subhead-01-bold",
"subhead-02-regular",
"subhead-02-medium",
"subhead-02-bold",
"body-01-regular",
"body-01-medium",
"body-01-bold",
"body-02-regular",
"body-02-medium",
"body-02-bold",
"body-03-regular",
"body-03-medium",
"body-03-bold",
'head-01-regular',
'head-01-medium',
'head-01-bold',
'head-02-regular',
'head-02-medium',
'head-02-bold',
'subhead-01-regular',
'subhead-01-medium',
'subhead-01-bold',
'subhead-02-regular',
'subhead-02-medium',
'subhead-02-bold',
'body-01-regular',
'body-01-medium',
'body-01-bold',
'body-02-regular',
'body-02-medium',
'body-02-bold',
'body-03-regular',
'body-03-medium',
'body-03-bold',
];

export const Weekdays = {
Expand All @@ -58,4 +58,4 @@ export const Weekdays = {
SATURDAY: 6,
};

export const HOLIDAYS = [ Weekdays["SUNDAY"], Weekdays["SATURDAY"] ];
export const HOLIDAYS = [Weekdays['SUNDAY'], Weekdays['SATURDAY']];
34 changes: 18 additions & 16 deletions src/constants/theme.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
import { ColorThemeType } from "@/types";
import { ColorThemeType } from '@/types';

export const COLOR_THEME = {
PRIMARY: "primary",
ERROR: "error",
WARNING: "warning",
SUCCESS: "success",
SECONDARY: "secondary",
GRAY: "gray",
WHITE: "white",
PRIMARY: 'primary',
ERROR: 'error',
WARNING: 'warning',
SUCCESS: 'success',
SECONDARY: 'secondary',
GRAY: 'gray',
WHITE: 'white',
} as const;

export const COLOR_THEME_STYLES: Record<ColorThemeType, string> = {
[COLOR_THEME["PRIMARY"]]: "bg-primary-03 text-white",
[COLOR_THEME["SECONDARY"]]: "text-primary-03 bg-primary-00",
[COLOR_THEME["ERROR"]]: "text-rose-600 bg-rose-300/20",
[COLOR_THEME["WARNING"]]: "text-amber-600 bg-amber-300/20",
[COLOR_THEME["SUCCESS"]]: "text-green-600 bg-green-300/20",
[COLOR_THEME["GRAY"]]: "text-gray-07 bg-gray-02",
[COLOR_THEME["WHITE"]]: "text-gray-06 bg-white border border-gray-03",
[COLOR_THEME['PRIMARY']]: 'bg-primary-03 text-white',
[COLOR_THEME['SECONDARY']]: 'text-primary-03 bg-primary-00',
[COLOR_THEME['ERROR']]: 'text-rose-600 bg-rose-300/20',
[COLOR_THEME['WARNING']]: 'text-amber-600 bg-amber-300/20',
[COLOR_THEME['SUCCESS']]: 'text-green-600 bg-green-300/20',
[COLOR_THEME['GRAY']]: 'text-gray-07 bg-gray-02',
[COLOR_THEME['WHITE']]: 'text-gray-06 bg-white border border-gray-03',
};

export const colorThemeOptions = Object.values(COLOR_THEME).map(theme => theme);
export const colorThemeOptions = Object.values(COLOR_THEME).map(
(theme) => theme,
);
46 changes: 24 additions & 22 deletions src/constants/typography.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
export const THEME_TYPOGRAPHY = {
HEAD_01_REGULAR: "head-01-regular",
HEAD_01_MEDIUM: "head-01-medium",
HEAD_01_BOLD: "head-01-bold",
HEAD_02_REGULAR: "head-02-regular",
HEAD_02_MEDIUM: "head-02-medium",
HEAD_02_BOLD: "head-02-bold",
SUBHEAD_01_REGULAR: "subhead-01-regular",
SUBHEAD_01_MEDIUM: "subhead-01-medium",
SUBHEAD_01_BOLD: "subhead-01-bold",
SUBHEAD_02_REGULAR: "subhead-02-regular",
SUBHEAD_02_MEDIUM: "subhead-02-medium",
SUBHEAD_02_BOLD: "subhead-02-bold",
BODY_01_REGULAR: "body-01-regular",
BODY_01_MEDIUM: "body-01-medium",
BODY_01_BOLD: "body-01-bold",
BODY_02_REGULAR: "body-02-regular",
BODY_02_MEDIUM: "body-02-medium",
BODY_02_BOLD: "body-02-bold",
BODY_03_REGULAR: "body-03-regular",
BODY_03_MEDIUM: "body-03-medium",
BODY_03_BOLD: "body-03-bold",
HEAD_01_REGULAR: 'head-01-regular',
HEAD_01_MEDIUM: 'head-01-medium',
HEAD_01_BOLD: 'head-01-bold',
HEAD_02_REGULAR: 'head-02-regular',
HEAD_02_MEDIUM: 'head-02-medium',
HEAD_02_BOLD: 'head-02-bold',
SUBHEAD_01_REGULAR: 'subhead-01-regular',
SUBHEAD_01_MEDIUM: 'subhead-01-medium',
SUBHEAD_01_BOLD: 'subhead-01-bold',
SUBHEAD_02_REGULAR: 'subhead-02-regular',
SUBHEAD_02_MEDIUM: 'subhead-02-medium',
SUBHEAD_02_BOLD: 'subhead-02-bold',
BODY_01_REGULAR: 'body-01-regular',
BODY_01_MEDIUM: 'body-01-medium',
BODY_01_BOLD: 'body-01-bold',
BODY_02_REGULAR: 'body-02-regular',
BODY_02_MEDIUM: 'body-02-medium',
BODY_02_BOLD: 'body-02-bold',
BODY_03_REGULAR: 'body-03-regular',
BODY_03_MEDIUM: 'body-03-medium',
BODY_03_BOLD: 'body-03-bold',
};

export const TypographyOptions = Object.keys(THEME_TYPOGRAPHY).map(color => THEME_TYPOGRAPHY[color as keyof typeof THEME_TYPOGRAPHY]);
export const TypographyOptions = Object.keys(THEME_TYPOGRAPHY).map(
(color) => THEME_TYPOGRAPHY[color as keyof typeof THEME_TYPOGRAPHY],
);
Loading

0 comments on commit 41befb0

Please sign in to comment.