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

ci(lint): add github action workflow for linting #13

Merged
merged 11 commits into from
Nov 29, 2024
Merged
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
25 changes: 25 additions & 0 deletions .github/workflows/client-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Client Lint

on:
pull_request:

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'

- name: Install dependencies (client)
working-directory: ./client
run: yarn install

- name: Run linter (client)
working-directory: ./client
run: yarn lint
25 changes: 25 additions & 0 deletions .github/workflows/server-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Server Lint

on:
pull_request:

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'

- name: Install dependencies (server)
working-directory: ./server
run: yarn install

- name: Run linter (server)
working-directory: ./server
run: yarn lint
14 changes: 14 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "weather-app",
"version": "1.0.0",
"description": "A simple weather app",
"scripts": {
"client": "cd client && yarn run dev",
"server": "cd server && node --watch server.js",
"lint::client": "cd client && yarn run lint",
"lint::server": "cd server && yarn run lint",
"lint": "yarn run lint::client && yarn run lint::server"
},
"author": "",
"license": "ISC"
}