Skip to content

Instantly share code, notes, and snippets.

@poad
Last active January 5, 2021 05:45
Show Gist options
  • Save poad/2e6645c3f5fc8e020cf9afdb228c71cf to your computer and use it in GitHub Desktop.
Save poad/2e6645c3f5fc8e020cf9afdb228c71cf to your computer and use it in GitHub Desktop.
GitHub Actions (by TypeScript)

create node project

yarn init

add the dependencies

yarn add --dev typescript \
    @types/jest \
    @types/node \
    @typescript-eslint/eslint-plugin \
    @typescript-eslint/parser \
    eslint \
    eslint-config-airbnb-base \
    eslint-config-airbnb-typescript \
    eslint-config-import \
    eslint-config-prettier \
    eslint-import-resolver-typescript \
    eslint-plugin-flowtype \
    eslint-plugin-import \
    eslint-plugin-jest \
    eslint-plugin-prettier \
    jest \
    jest-circus \
    prettier \
    ts-jest
yarn add @actions/core

create tsconfig.json

tsc --init

add script section to package.json

  "scripts": {
    "test": "NODE_ENV=test jest --coverage --passWithNoTests",
    "clean": "rm -rf dist",
    "tsc": "tsc",
    "build": "yarn clean && yarn tsc",
    "dev": "ts-node",
    "lint": "eslint src/**/*.ts src/*.ts"
  },

add the eslintrc

node_modules/.bin/eslint --init
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment