-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moves @microsoft/eslint-formatter from sarif-sdk to sarif-js-sdk (#23)
Co-authored-by: Chris Raynor <[email protected]> Co-authored-by: Chris Meyer <[email protected]> Co-authored-by: Eddy Nakamura <[email protected]> Co-authored-by: Larry Golding <[email protected]> Co-authored-by: lukadlet <[email protected]> Co-authored-by: Mike Huguet <[email protected]> Co-authored-by: Rusty Scrivens <[email protected]> Co-authored-by: tosmolka <[email protected]>
- Loading branch information
1 parent
599024f
commit 8222955
Showing
7 changed files
with
11,470 additions
and
6,870 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# SARIF formatter for ESLint | ||
|
||
`eslint-formatter-sarif` is a formatter for [ESLint](https://www.npmjs.com/package/eslint) that produces output in the SARIF (Static Analysis Results Interchange Format) v2.1.0 format. | ||
|
||
It is available as an npm module [@microsoft/eslint-formatter-sarif](https://www.npmjs.com/package/@microsoft/eslint-formatter-sarif). | ||
|
||
# Installation and usage | ||
|
||
1. To install ESLint, follow the instructions at [Getting Started with ESLint](https://eslint.org/docs/3.0.0/user-guide/getting-started). | ||
|
||
2. To install the ESLint SARIF formatter: | ||
|
||
``` | ||
npm install @microsoft/eslint-formatter-sarif --save-dev | ||
``` | ||
|
||
3. To run ESLint with the SARIF formatter: | ||
|
||
``` | ||
./node-modules/.bin/eslint -f @microsoft/eslint-formatter-sarif -o yourfile.sarif yourfile.js | ||
``` | ||
|
||
Note that you *cannot* use the abbreviated form `-f sarif`, because that only works when the npm module name is of the form `eslint-formatter-example`, and the ESLint SARIF formatter module is not `eslint-formatter-sarif`; it's `@microsoft/eslint-formatter-sarif`. Alternatively, you can use the form `-f @microsoft/sarif`. | ||
|
||
# Developer details | ||
|
||
To embed the contents of the analyzed source files in the resulting SARIF file: | ||
|
||
```bat | ||
set SARIF_ESLINT_EMBED=true | ||
``` | ||
|
||
To disable content embedding: | ||
|
||
```bat | ||
set SARIF_ESLINT_EMBED= | ||
``` | ||
|
||
To run unit tests: | ||
|
||
```bat | ||
RunTests.cmd | ||
``` |
Oops, something went wrong.