Skip to content

Commit

Permalink
chore: add prettier to front-end
Browse files Browse the repository at this point in the history
- add prettier;
- format code using prettier;
- change github workflow and pre-commit to run prettier

Closes #74
  • Loading branch information
lfjnascimento committed Jul 10, 2024
1 parent 0f2f38c commit f6f24d5
Show file tree
Hide file tree
Showing 20 changed files with 5,294 additions and 7,812 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
node-version-file: './dashboard/.nvmrc'

- name: Run eslint
run: pnpm lint
run: pnpm lint-staged
working-directory: ./dashboard

build-front:
Expand Down
1 change: 1 addition & 0 deletions dashboard/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module.exports = {
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:storybook/recommended",
"plugin:prettier/recommended",
],
ignorePatterns: [".eslintrc.cjs", "*.config.js", "/src/components/ui/*"],
parser: "@typescript-eslint/parser",
Expand Down
2 changes: 1 addition & 1 deletion dashboard/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env sh
cd dashboard && pnpm lint
cd dashboard && pnpm lint-staged
pnpm pycommit
9 changes: 9 additions & 0 deletions dashboard/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"printWidth": 80,
"trailingComma": "all",
"tabWidth": 2,
"semi": true,
"bracketSpacing": true,
"singleQuote": true,
"arrowParens": "avoid"
}
6 changes: 5 additions & 1 deletion dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"build": "tsc -b && vite build",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"lint": "eslint --cache --max-warnings=0 --ext .ts,.tsx,.js,.jsx src --fix",
"lint-staged": "eslint --max-warnings=0 --ext .ts,.tsx,.js,.jsx src",
"lint": "pnpm run lint-staged --fix",
"preview": "vite preview",
"prepare": "cd .. && husky dashboard/.husky",
"pycommit": "cd .. && cd backend && sh pre-commit",
Expand Down Expand Up @@ -56,13 +57,16 @@
"@typescript-eslint/parser": "^7.13.1",
"autoprefixer": "^10.4.19",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.34.3",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.7",
"eslint-plugin-storybook": "^0.8.0",
"husky": "^9.0.11",
"postcss": "^8.4.38",
"prettier": "3.3.2",
"storybook": "^8.1.10",
"tailwindcss": "^3.4.4",
"typescript": "^5.2.2"
Expand Down
Loading

0 comments on commit f6f24d5

Please sign in to comment.