Skip to content

ci: add eslint

ci: add eslint #15

Workflow file for this run

---
name: Code Health
on:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
with:
config: ${{ vars.PERMISSIONS_CONFIG }}
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: package.json
- name: install dependencies
run: |
npm ci
- name: build
run: |
npm run build
- name: Check for uncommitted files
run: |
export FILES=
FILES=$(git ls-files -o -m --directory --exclude-standard --no-empty-directory)
export LINES=
LINES=$(echo "$FILES" | awk 'NF' | wc -l)
if [ "$LINES" -ne 0 ]; then
echo "Detected files that need to be committed:"
echo "${FILES}"
echo ""
echo "Try running: npm run build"
exit 1
fi
prettier:
runs-on: ubuntu-latest
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
with:
config: ${{ vars.PERMISSIONS_CONFIG }}
- name: Checkout Repository
uses: actions/checkout@v2
- uses: actions/setup-node@v4
with:
node-version-file: package.json
- name: install dependencies
run: |
npm ci
- run: |
npm run reformat
- name: Check for uncommitted files
run: |
export FILES=
FILES=$(git ls-files -o -m --directory --exclude-standard --no-empty-directory)
export LINES=
LINES=$(echo "$FILES" | awk 'NF' | wc -l)
if [ "$LINES" -ne 0 ]; then
echo "Detected files that need to be committed:"
echo "${FILES}"
echo ""
echo "Try running: npm run reformat"
exit 1
fi
eslint:
runs-on: ubuntu-latest
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
with:
config: ${{ vars.PERMISSIONS_CONFIG }}
- name: Checkout Repository
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: package.json
- name: install dependencies
run: |
npm ci
- run: |
npm run lint