console/.github/workflows/lint.yaml
renovate[bot] 16b0e13989
chore(deps): pin dependencies (#6627)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-19 17:44:39 +02:00

73 lines
2 KiB
YAML

on:
workflow_call:
jobs:
eslint-and-prettier:
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 2
- name: setup environment
uses: ./.github/actions/setup
with:
actor: lint
- name: lint .env.template files
run: pnpm lint:env-template
- name: Cache ESLint and Prettier
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
with:
path: |
.eslintcache
node_modules/.cache/prettier
key:
lint-cache-${{ hashFiles('**/pnpm-lock.yaml', 'packages/web/*/tailwind.config.ts',
'tsconfig.eslint.json', 'packages/web/app/tsconfig.json') }}-${{github.sha}}
restore-keys: |
lint-cache-${{ hashFiles('**/pnpm-lock.yaml', 'packages/web/*/tailwind.config.ts',
'tsconfig.eslint.json', 'packages/web/app/tsconfig.json') }}-
- name: eslint
id: eslint
run: |
pnpm lint --cache-strategy content || \
( \
echo "" && \
echo "To fix it, run" && \
echo "$ pnpm run lint:fix" && \
echo "" && \
exit 1 \
)
env:
TIMING: 'true'
- name: prettier
id: prettier
shell: sh
run: |
pnpm lint:prettier || \
( \
echo "" && \
echo "To fix it, run" && \
echo "$ pnpm run prettier" && \
echo "" && \
exit 1 \
)
- name: Generate Types
run: pnpm graphql:generate
- name: Operation Check
run: |
npx graphql-inspector validate \
"packages/web/app/src/**/*.{graphql,tsx}|packages/libraries/cli/**/*.graphql|packages/web/app/src/lib/**/*.ts" \
"packages/**/module.graphql.ts" \
--maxDepth=20 \
--maxAliasCount=20 \
--maxDirectiveCount=20 \
--maxTokenCount=1000