Skip to content

Commit

Permalink
build: lint (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
peterpeterparker authored Nov 10, 2023
1 parent 9cc9cce commit e9b18e9
Show file tree
Hide file tree
Showing 31 changed files with 5,570 additions and 289 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
30 changes: 30 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"root": true,
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": ["standard-with-typescript", "plugin:prettier/recommended"],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"project": ["./tsconfig.json"]
},
"rules": {
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-misused-promises": "off",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/prefer-nullish-coalescing": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
}
]
}
}
17 changes: 17 additions & 0 deletions .github/actions/prepare/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Prepare

description: Checkout and install dependencies

runs:
using: composite
steps:
- uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- name: Install npm
shell: bash
run: npm install -g npm
- name: Install dependencies
shell: bash
run: npm ci
45 changes: 45 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Checks

on:
pull_request:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Prepare
uses: ./.github/actions/prepare
- name: Build
run: npm run build

format:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Prepare
uses: ./.github/actions/prepare
- name: Lint
run: npm run format:check

lint:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Prepare
uses: ./.github/actions/prepare
- name: Lint
run: npm run lint

may-merge:
needs: ['format', 'lint', 'build']
runs-on: ubuntu-latest
steps:
- name: Cleared for merging
run: echo OK
Loading

0 comments on commit e9b18e9

Please sign in to comment.