Skip to content
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
45 changes: 45 additions & 0 deletions .github/workflows/syntax.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Syntax Gate

on:
pull_request:
types: [opened, synchronize]

concurrency:
group: syntax-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
syntax:
name: Syntax & Type Check
runs-on: ubuntu-latest
timeout-minutes: 10

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

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Cache node modules
id: cache-node-modules
uses: actions/cache@v4
with:
path: |
node_modules
~/.npm
key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-modules-

- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci --prefer-offline --no-audit --legacy-peer-deps

- name: TypeScript type check
run: npx tsc --noEmit

- name: ESLint check (no-fix)
run: npx eslint . --max-warnings=0
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,5 @@ GoogleService-Info.plist
# Documentation files (except README.md)
*.md
!README.md
!CONTRIBUTING.md
!docs/**/*.md
27 changes: 27 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Contributing to TeachLink Mobile

Thank you for contributing to TeachLink Mobile!

## Pull Request Guidelines

Before submitting a Pull Request, please ensure that your changes pass all local lint and type checks.

### Fast-Fail Syntax Gate
We have a dedicated **Syntax Gate** workflow (`.github/workflows/syntax.yml`) that runs on every pull request `opened` or `synchronize` event.
- This gate checks TypeScript compiler errors (`tsc --noEmit`) and code style rules (`eslint --max-warnings=0`).
- It is optimized to complete in **under 90 seconds** using a warm cache.
- The syntax check is a **required check** for branch protection. Pull requests cannot be merged if it fails.
- To avoid CI failures, you should run linting and type checking locally before pushing.

### Local Quality Checks
You can run the checks locally:
```bash
# Run ESLint linting
npm run lint

# Run Prettier format check
npm run format:check

# Run TypeScript type check
npx tsc --noEmit
```
Loading
Loading