diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..d1783ed --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,41 @@ +name: Lint and Format + +on: + push: + branches: ['*'] + pull_request: + branches: ['*'] + +jobs: + lint-and-format: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: '20' + + - name: Cache node modules + uses: actions/cache@v3 + env: + cache-name: cache-node-modules + with: + path: ~/.yarn-cache + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: Install Dependencies + run: yarn install --frozen-lockfile + + - name: Build ESLint Config + run: yarn workspace @ubahnchen/eslint-plugin build + + - name: Run Linter + run: yarn lint + + - name: Run Formatter + run: yarn format diff --git a/package.json b/package.json index 328a642..c58a312 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "clean": "turbo run clean && del-cli \"**/.turbo\" -d", "purge": "yarn clean && del-cli \"**/node_modules\" node_modules -d", "dev": "turbo run dev --no-cache --parallel --continue", - "format": "prettier --write \"**/*.{ts,tsx,md}\"", + "format": "prettier --write \"**/*.{ts,tsx,md,yml}\"", "lint": "turbo run lint --parallel --", "lintall": "eslint . --quiet --fix --ext .js,.ts,.jsx,.tsx,.html,.vue,.md,.json,.sql,.mjs,.cjs", "ncu": "npx npm-check-updates --workspaces --upgrade --root",