Skip to content

feat: Ported the project to Typescript #93

feat: Ported the project to Typescript

feat: Ported the project to Typescript #93

# Job name
name: Application linting
# When the to run the greeting
on: [pull_request]
# Jobs to run for the action (You can have multiple actions in one file)
jobs:
run-linters:
# Job display name
name: Linting Action
# Runs on a Linux based OS
runs-on: ubuntu-latest
# Steps involved for this particular task
steps:
# Checks out the repository and enables the use of commands made available in the project ie npm run
- name: Checkout Git repository
uses: actions/checkout@v3
# Configure yarn
- name: Setup Node.js version
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
# Cache the node_modules, only invalidate when the yarn lock file changes
# Original source: https://dev.to/mpocock1/how-to-cache-nodemodules-in-github-actions-with-yarn-24eh
- uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
# Installs all the project dependencies e.g. prettier, eslint etc via a custom project script
- name: Install yarn dependencies
run: 'yarn install'
# Run the linting action
- name: Run linters
uses: wearerequired/lint-action@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }} # Authorizes the github action via a Github token which is for this repo only (Generated automatically)
eslint: true # Enables eslint
prettier: true # Enables prettier to prettieifer the code when commiting and spots any violations
auto_fix: false # Auto fixes an prettier or eslint violations
eslint_extensions: ts,tsx