Skip to content

Commit

Permalink
Merge pull request #26 from jphacks/feat/setup-linter-formater
Browse files Browse the repository at this point in the history
Add ESLint and Prettier for code formatting
  • Loading branch information
yuto-trd authored Oct 26, 2024
2 parents bf643c2 + 4cf14b8 commit 4ad28c5
Show file tree
Hide file tree
Showing 10 changed files with 859 additions and 95 deletions.
32 changes: 29 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,32 @@ env:
on: push

jobs:
lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: task_yell
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
check-latest: true

- name: Install dependencies
run: npm install

- name: Run ESLint
run: npm run lint

- name: Run Prettier
run: npm run format:check

preview:
needs: lint
if: ${{ github.ref != 'refs/heads/main' }}
runs-on: ubuntu-latest
environment:
Expand All @@ -24,12 +49,12 @@ jobs:
node-version: 18
check-latest: true

- name: Install Vercel CLI
run: npm install --global vercel@latest

- name: Mv directory
run: cd ./task_yell

- name: Install Vercel CLI
run: npm install --global vercel@latest

- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}

Expand All @@ -45,6 +70,7 @@ jobs:
run: vercel alias ${{ steps.deploy.outputs.url }} stg.my-service.com --scope=my-team --token=${{ secrets.VERCEL_TOKEN }}

prod:
needs: lint
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion task_yell/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": ["next/core-web-vitals", "next/typescript"]
"extends": ["next/core-web-vitals", "next/typescript", "prettier"]
}
Loading

0 comments on commit 4ad28c5

Please sign in to comment.