New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: Formatters page updates #16566
Merged
mdjermanovic
merged 8 commits into
eslint:main
from
bpmutter:formatters_cleanup_expansion
Dec 6, 2022
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7bc4769
docs: Formatters page updates
bpmutter 9d097f7
add formatter text generation
bpmutter 5278558
fix issue and rename manifest
bpmutter ab47d3c
fix manifest formatting issues
bpmutter eab1e0b
restore generated page to state of eslint/eslint:main
bpmutter 4fd1366
rename and refactor as json
bpmutter 93adca6
fix template spacing
bpmutter 7658246
Apply suggestions from code review
bpmutter File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
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,64 @@ | ||
/** | ||
* @fileoverview Metadata about built-in formatters | ||
* @author Ben Perlmutter | ||
*/ | ||
"use strict"; | ||
|
||
/** | ||
* @typedef Formatter | ||
* @type {Object} | ||
* @property {string} name Name of formatter. | ||
* @property {string} description Description of formatter in Markdown. | ||
*/ | ||
|
||
/** | ||
* @type {Array<Formatter>} Array of Formatter metadata objects | ||
*/ | ||
const formatterMetadata = [ | ||
{ | ||
name: "checkstyle", | ||
description: "Outputs results to the [Checkstyle](https://checkstyle.sourceforge.io/) format." | ||
}, | ||
{ | ||
name: "compact", | ||
description: "Human-readable output format. Mimics the default output of JSHint." | ||
}, | ||
{ | ||
name: "html", | ||
description: "Outputs results to HTML. The `html` formatter is useful for visual presentation in the browser." | ||
}, | ||
{ | ||
name: "jslint-xml", | ||
description: "Outputs results to format compatible with the [JSLint Jenkins plugin](https://plugins.jenkins.io/jslint/)." | ||
}, | ||
{ | ||
name: "json-with-metadata", | ||
description: "Outputs JSON-serialized results. The `json-with-meta` provides the same linting results as the [`json`](#json) formatter with additional metadata about the rules applied. The linting results are included in the `results` property and the rules metadata is included in the `metadata` property.\n\nAlternatively, you can use the [ESLint Node.js API](../../developer-guide/nodejs-api.md) to programmatically use ESLint." | ||
}, | ||
{ | ||
name: "json", | ||
description: "Outputs JSON-serialized results. The `json` formatter is useful when you want to programmatically work with the CLI's linting results.\n\nAlternatively, you can use the [ESLint Node.js API](../../developer-guide/nodejs-api.md) to programmatically use ESLint." | ||
}, | ||
{ | ||
name: "junit", | ||
description: "Outputs results to format compatible with the [JUnit Jenkins plugin](https://plugins.jenkins.io/junit/)." | ||
}, | ||
{ | ||
name: "stylish", | ||
description: "Human-readable output format. This is the default formatter." | ||
}, | ||
{ | ||
name: "tap", | ||
description: "Outputs results to the [Test Anything Protocol (TAP)](https://testanything.org/) specification format." | ||
}, | ||
{ | ||
name: "unix", | ||
description: "Outputs results to a format similar to many commands in UNIX-like systems. Parsable with tools such as [grep](https://www.gnu.org/software/grep/manual/grep.html), [sed](https://www.gnu.org/software/sed/manual/sed.html), and [awk](https://www.gnu.org/software/gawk/manual/gawk.html)." | ||
}, | ||
{ | ||
name: "visualstudio", | ||
description: "Outputs results to format compatible with the integrated terminal of the [Visual Studio](https://visualstudio.microsoft.com/) IDE. When using Visual Studio, you can click on the linting results in the integrated terminal to go to the issue in the source code." | ||
} | ||
]; | ||
|
||
module.exports = formatterMetadata; |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this is just data, can we just create a JSON file here? I'd call it
formatter-data.json
and you'd still be able torequire()
it, but would otherwise be ignored.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sgtm, i like this approach