Skip to content

Commit

Permalink
Fix eslint warnings and add build/lint step to CI (#116)
Browse files Browse the repository at this point in the history
And ignore some of the most noisy ones for now. Should fix
these later obviously, but for now I was mainly just concerned
with fixing the "are you sure you want to continue despite the
errors reported" warning that would be shown each time one started
a debugging session.

Signed-off-by: Anders Eknert <[email protected]>
  • Loading branch information
anderseknert authored Apr 2, 2024
1 parent e2553f9 commit d39b1ea
Show file tree
Hide file tree
Showing 9 changed files with 238 additions and 131 deletions.
19 changes: 19 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
env:
browser: true
es2021: true
extends:
- eslint:recommended
- plugin:@typescript-eslint/recommended
parser: '@typescript-eslint/parser'
parserOptions:
ecmaVersion: latest
sourceType: module
plugins:
- '@typescript-eslint'
rules:
'@typescript-eslint/no-explicit-any': 'off'
'@typescript-eslint/no-var-requires': 'off'
'@typescript-eslint/no-unused-vars': 'off'
'no-undef': 'off'
'no-case-declarations': 'off'
'require-yield': 'off'
34 changes: 34 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build

on:
push:
pull_request:
branches: [ "master" ]
workflow_dispatch:

jobs:
build:
name: Build and lint
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install dependencies
run: |
npm install --include=dev
- name: Compile TypeScript
run: npm run compile

- name: Run ESLint
run: npx eslint --format @microsoft/eslint-formatter-sarif --output-file eslint-results.sarif .
continue-on-error: true

- name: Upload analysis results to GitHub
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: eslint-results.sarif
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ node_modules
.vscode-test/
*.vsix
.DS_Store

eslint-results.sarif
Loading

0 comments on commit d39b1ea

Please sign in to comment.