8000 Implement SARIF formatter for Eslint (#4956) · glitchkyle/rushstack@2242751 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2242751

Browse files
Implement SARIF formatter for Eslint (microsoft#4956)
* [heft-lint-plugin] Support outputting SARIF logs * fixed type issues in typescript for Sarifformmater. Upgrade @types/eslint to version 18.56.10 * PR fixes for creating SARIF Formatter * rush update * rush change * rush update * rush update * updated test snapshot * rush change * pnpm file fix * updated snapshot * 2nd round PR fixes for sarifFormatter * resolve repo-state.json merge conflict * deleted change file for webpack5-localization-plugin. Changes were reverted. * PR changes 3 for implementing SARIF formatter * 3rd round PR changes for SARIF formatter * made IRegion interface exportable * created snapshot tests and updated schema descriptions * minor fixes and improvements to formatEslintResultsAsSARIF function * edited rush changes * fixed functionality of sarifFormmater to properly track rule and artifact indicies. Added more snapshot tests. URL tracked in sariff formatter are relative vs absolute. Rules Meta now included in sarif file * fixed bug with importing linter * imporved efficiency of formatAsASARIF function
1 parent 982df68 commit 2242751

File tree

22 files changed

+1751
-50
lines changed

22 files changed

+1751
-50
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/eslint-patch",
5+
"comment": "",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@rushstack/eslint-patch"
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/eslint-plugin-packlets",
5+
"comment": "",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@rushstack/eslint-plugin-packlets"
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/eslint-plugin-security",
5+
"comment": "",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@rushstack/eslint-plugin-security"
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/eslint-plugin",
5+
"comment": "",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@rushstack/eslint-plugin"
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/heft-lint-plugin",
5+
"comment": "Add an option `sarifLogPath` that, when specified, will emit logs in the SARIF format: https://sarifweb.azurewebsites.net/. Note that this is only supported by ESLint.",
6+
"type": "minor"
7+
}
8+
],
9+
"packageName": "@rushstack/heft-lint-plugin"
10+
}

common/config/subspaces/build-tests-subspace/repo-state.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
{
33 10000
"pnpmShrinkwrapHash": "5b75a8ef91af53a8caf52319e5eb0042c4d06852",
44
"preferredVersionsHash": "ce857ea0536b894ec8f346aaea08cfd85a5af648",
5-
"packageJsonInjectedDependenciesHash": "8927ca4e0147b9436659f98a2ff8ca347107d52f"
5+
"packageJsonInjectedDependenciesHash": "5ff2fabbffcfb22bb3e29f56c997f7c762e89d20"
66
}

common/config/subspaces/default/pnpm-lock.yaml

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush.
22
{
3-
"pnpmShrinkwrapHash": "5afee1d392a0c2404869d7eda687b5571fe88515",
3+
"pnpmShrinkwrapHash": "673f7de41244835915a7947c11b6dbe80f944010",
44
"preferredVersionsHash": "ce857ea0536b894ec8f346aaea08cfd85a5af648"
55
}

eslint/eslint-patch/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"devDependencies": {
3333
"@rushstack/heft": "0.67.2",
3434
"@rushstack/heft-node-rig": "2.6.31",
35-
"@types/eslint": "8.2.0",
35+
"@types/eslint": "8.56.10",
3636
"@types/node": "18.17.15",
3737
"@typescript-eslint/types": "~5.59.2",
3838
"eslint": "~8.57.0",

eslint/eslint-patch/src/eslint-bulk-suppressions/cli/runEslint.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export async function runEslintAsync(files: string[], mode: 'suppress' | 'prune'
3535

3636
if (results.length > 0) {
3737
const stylishFormatter: ESLint.Formatter = await eslint.loadFormatter();
38-
const formattedResults: string = stylishFormatter.format(results);
38+
const formattedResults: string = await Promise.resolve(stylishFormatter.format(results));
3939
console.log(formattedResults);
4040
}
4141

0 commit comments

Comments
 (0)
0