Skip to content

Commit

Permalink
ci: add workflow file for action to check types, lint, format
Browse files Browse the repository at this point in the history
  • Loading branch information
invertedEcho committed Jun 16, 2024
1 parent a078e90 commit 754c9bc
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 3 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/ci-frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI - Frontend

on:
push:
branches:
- master
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
check:
name: Format, Lint, Types
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend
steps:
- name: Check Format
run: pnpm format:check

- name: Check Lint
run: pnpm lint

- name: Check Types
run: pnpm types
5 changes: 3 additions & 2 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
},
"scripts": {
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"format": "prettier -w \"src/**/*.ts\"",
"format:check": "prettier -c \"src/**/*.ts\"",
"start": "nest start",
"dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "pm2 restart dist/src/main.js",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\"",
"types": "tsc --noEmit",
"test": "jest",
"test:watch": "jest --watch",
Expand Down
25 changes: 25 additions & 0 deletions frontend/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: __dirname,
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
};
4 changes: 4 additions & 0 deletions frontend/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "all"
}
7 changes: 6 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web",
"types": "pnpm tsc"
"types": "pnpm tsc",
"format": "prettier -w \"src/**/*.ts\"",
"format:check": "prettier -c \"src/**/*.ts\"",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\""
},
"dependencies": {
"@expo/metro-runtime": "~3.2.1",
Expand Down Expand Up @@ -51,6 +54,8 @@
"@types/jest": "^29.5.12",
"@types/react": "18.2.79",
"@types/react-test-renderer": "^18.3.0",
"eslint": "^9.5.0",
"prettier": "^3.3.2",
"tailwindcss": "3.3.2",
"typescript": "5.3.3"
},
Expand Down
12 changes: 12 additions & 0 deletions frontend/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 754c9bc

Please sign in to comment.