Update tslint.yml #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
run-linters: | |
name: Run linters | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
checks: write | |
steps: | |
# Paso 1: Check out Git repository | |
- name: Check out Git repository | |
uses: actions/checkout@v4 | |
# Paso 2: Set up Node.js con la versión deseada | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 18 | |
# Paso 3: Instala las dependencias de Node.js desde package.json | |
- name: Install Node.js dependencies | |
run: npm ci | |
# Paso 4: Verifica la existencia de tsconfig.json (importante para TypeScript y ESLint) | |
- name: Ensure tsconfig.json exists | |
run: | | |
if [ ! -f tsconfig.json ]; then | |
echo "❌ Error: tsconfig.json not found!"; | |
exit 1; | |
fi | |
# Paso 5: Ejecuta ESLint para verificar los archivos .ts y .js | |
- name: Run ESLint | |
run: npx eslint '**/*.{js,ts}' --ext .js,.ts | |
# Paso 6: Ejecuta Prettier para verificar la formateación del código | |
- name: Run Prettier | |
run: npx prettier --check "**/*.{js,ts,json,md}" |