Skip to content

Commit

Permalink
chore: #141 Add typescript CI (#145)
Browse files Browse the repository at this point in the history
* Add ci

* Add issue url

* add typecheck

* Add prettier

* add prettier

* Run code through prettier

* Add husky, lint-staged

* Add pre-commit hook

* Add more eslint checks

* remove prepare script

* Add eslintrc

* Add prettier ignore

* Add a prettier ignore
  • Loading branch information
mikeldking authored Jan 4, 2023
1 parent 953212a commit 3d87097
Show file tree
Hide file tree
Showing 19 changed files with 6,434 additions and 3,315 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/typescript-CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Typescript CI

on:
push:
branches: [main]
pull_request:
paths:
- "app/**"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

concurrency:
group: test-typescript-${{ github.head_ref }}
cancel-in-progress: true

jobs:
lint:
name: Lint Typescript
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Nodejs
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install dependencies
working-directory: ./app
run: npm ci
- name: Type Check
working-directory: ./app
run: npm run typecheck
- name: Formatting
working-directory: ./app
run: |
npm run prettier:check
- name: Lint
working-directory: ./app
run: |
npm run lint
- name: Relay Codegen
working-directory: ./app
run: |
npm run build:relay
git diff --exit-code
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
24 changes: 24 additions & 0 deletions app/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// eslint-disable-next-line no-undef
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
],
overrides: [],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
plugins: ["react", "@typescript-eslint"],
rules: {
"react/no-unknown-property": ["error", { ignore: ["css"] }],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
},
};
1 change: 1 addition & 0 deletions app/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__generated__
1 change: 1 addition & 0 deletions app/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Loading

0 comments on commit 3d87097

Please sign in to comment.