Skip to content

Commit

Permalink
add lint in CI match config with start-ui-web
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoPerard committed Jan 27, 2025
1 parent e44d824 commit 4052d55
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
{ "argsIgnorePattern": "^_" }
],
"sonarjs/no-duplicate-string": "off",
"sonarjs/cognitive-complexity": ["warn", 50]
"sonarjs/cognitive-complexity": ["warn", 50],
"sonarjs/prefer-immediate-return": "warn"
},
"overrides": [
{
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: 🔎 Code Quality

on:
push:
branches:
- master
- main
- develop
- staging
pull_request:

env:
API_URL: https://demo.start-ui.com/api/rest
OPEN_API_URL: https://demo.start-ui.com/api/openapi.json

jobs:
lint-code:
timeout-minutes: 10
name: Lint and Type Check
runs-on: ubuntu-latest

strategy:
matrix:
node: [20, 22, 'lts/*']

steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 8
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Cache node modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-${{ env.cache-name }}-
${{ runner.os }}-pnpm-store-
${{ runner.os }}-
- name: Install dependencies
run: pnpm install

- name: TypeScript check
run: pnpm lint:staged

0 comments on commit 4052d55

Please sign in to comment.