From 4925f6348bae837dab71cb428654424959e96030 Mon Sep 17 00:00:00 2001 From: Tiago Pascoal Date: Sat, 2 Nov 2024 18:39:40 +0000 Subject: [PATCH] Upload ESLint results to code scanning --- .github/workflows/main.yml | 8 +++++++- .gitignore | 1 + package-lock.json | 34 ++++++++++++++++++++++++++++++++++ package.json | 3 ++- 4 files changed, 44 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9d560a9..da4b440 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,6 +36,13 @@ jobs: - name: Run Linting run: npm run lint + - name: Upload eslint results code scanning + uses: github/codeql-action/upload-sarif@v3 + if: always() && github.actor != 'dependabot[bot]' + with: + category: eslint + sarif_file: eslint.sarif + - name: Run tests Linux run: xvfb-run -a npm test if: runner.os == 'Linux' @@ -62,6 +69,5 @@ jobs: with: name: extension path: '*.vsix' - name: Release Extension \ No newline at end of file diff --git a/.gitignore b/.gitignore index 4a6b8bd..afd35d8 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ node_modules .vscode-test/ *.vsix coverage/ +*.sarif \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index faddb5d..e002848 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,7 @@ "name": "tspascoal-copilot-chat-parrot", "version": "0.0.9", "devDependencies": { + "@microsoft/eslint-formatter-sarif": "^3.1.0", "@types/mocha": "^10.0.7", "@types/node": "20.x", "@types/sinon": "^17.0.3", @@ -649,6 +650,22 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@microsoft/eslint-formatter-sarif": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@microsoft/eslint-formatter-sarif/-/eslint-formatter-sarif-3.1.0.tgz", + "integrity": "sha512-/mn4UXziHzGXnKCg+r8HGgPy+w4RzpgdoqFuqaKOqUVBT5x2CygGefIrO4SusaY7t0C4gyIWMNu6YQT6Jw64Cw==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint": "^8.9.0", + "jschardet": "latest", + "lodash": "^4.17.14", + "utf8": "^3.0.0" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -3082,6 +3099,16 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jschardet": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/jschardet/-/jschardet-3.1.4.tgz", + "integrity": "sha512-/kmVISmrwVwtyYU40iQUOp3SUPk2dhNCMsZBQX0R1/jZ8maaXJ/oZIzUOiyOqcgtLnETFKYChbJ5iDC/eWmFHg==", + "dev": true, + "license": "LGPL-2.1+", + "engines": { + "node": ">=0.1.90" + } + }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", @@ -5152,6 +5179,13 @@ "punycode": "^2.1.0" } }, + "node_modules/utf8": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz", + "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==", + "dev": true, + "license": "MIT" + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", diff --git a/package.json b/package.json index 9d8b9c7..30a5a02 100644 --- a/package.json +++ b/package.json @@ -80,10 +80,11 @@ "watch-tests": "tsc -p . -w --outDir out", "pretest": "npm run compile-tests && npm run compile && npm run lint", "check-types": "tsc --noEmit", - "lint": "eslint src --ext ts", + "lint": "eslint src --ext ts -f @microsoft/eslint-formatter-sarif -o eslint.sarif", "test": "vscode-test" }, "devDependencies": { + "@microsoft/eslint-formatter-sarif": "^3.1.0", "@types/mocha": "^10.0.7", "@types/node": "20.x", "@types/sinon": "^17.0.3",