Skip to content

Commit

Permalink
Set up CI for Prettier and ESLint
Browse files Browse the repository at this point in the history
  • Loading branch information
psvenk committed Nov 30, 2024
1 parent 4e7c605 commit 51c4aeb
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: ESLint

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install node dependencies
run: npm install
- name: Run ESLint
run: npm run ci-eslint
30 changes: 30 additions & 0 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Prettier

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install node dependencies
run: npm install
- name: Run Prettier
run: npm run ci-prettier
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@
"start": "react-scripts start",
"build": "react-scripts build",
"eject": "react-scripts eject",
"format": "prettier --check **/*.{ts,tsx}"
"format": "prettier --write **/*.{ts,tsx}",
"ci-prettier": "prettier --check **/*.{ts,tsx}",
"ci-eslint": "eslint **/*.{ts,tsx}"
},
"eslintConfig": {
"extends": [
Expand Down

0 comments on commit 51c4aeb

Please sign in to comment.