Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implimented prittier into the github action #256

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,34 @@ jobs:
if [ -e "server/firebase-secret.json" ] || [ -e ".env" ]; then
echo "Error: Found .env or firebase-secret.json in the pull request. Please remove them before merging."
exit 1
fi

prettier-check:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [21.x]

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm ci
working-directory: server/

- name: Check Prettier Formatting in Server
run: npm run format:check
working-directory: server/

- name: Install dependencies
run: npm ci
working-directory: client/

- name: Check Prettier Formatting in Client
run: npm run format:check
working-directory: client/
16 changes: 16 additions & 0 deletions client/package-lock.json

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

11 changes: 7 additions & 4 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
"ios": "expo start --ios",
"web": "expo start --web",
"test": "jest --watchAll",
"lint": "expo lint"
"lint": "expo lint",
"format": "prettier --write .",
"format:check": "prettier --check ."
},
"jest": {
"preset": "jest-expo"
Expand Down Expand Up @@ -51,12 +53,13 @@
"@types/jest": "^29.5.12",
"@types/react": "~18.2.45",
"@types/react-test-renderer": "^18.0.7",
"eslint": "^8.57.0",
"eslint-config-expo": "^7.0.0",
"jest": "^29.2.1",
"jest-expo": "~51.0.1",
"prettier": "^3.3.3",
"react-test-renderer": "18.2.0",
"typescript": "~5.3.3",
"eslint": "^8.57.0",
"eslint-config-expo": "^7.0.0"
"typescript": "~5.3.3"
},
"private": true
}
11 changes: 11 additions & 0 deletions server/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"bracketSpacing": true,
"jsxBracketSameLine": true,
"singleQuote": false,
"endofline": "lf",
"semi": true,
"tabWidth": 2,
"useTabs": false,
"printWidth": 80,
"trailingComma": "all"
}
16 changes: 16 additions & 0 deletions server/package-lock.json

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

5 changes: 4 additions & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"start": "node build/index.js",
"build": "npx tsc",
"build:watch": "npx tsc -w",
"start:watch": "nodemon build/index.js"
"start:watch": "nodemon build/index.js",
"format": "prettier --write .",
"format:check": "prettier --check ."
},
"author": "",
"license": "ISC",
Expand All @@ -19,6 +21,7 @@
"@types/jest": "^29.5.11",
"jest": "^29.7.0",
"nodemon": "^3.0.3",
"prettier": "^3.3.3",
"socket.io-client": "^4.7.4",
"ts-node": "^10.9.1",
"typescript": "^5.2.2"
Expand Down