question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Working with custom formatters" page is out of date

See original GitHub issue

I noticed a few problems when reading through the “Working with custom formatters” page in our documentation.

  • The fixableWarningCount and fixableErrorCount properties aren’t included in the results objects, and they aren’t described in the section below. (This was an oversight from when the properties were added in https://github.com/eslint/eslint/commit/f5a7e4239071c5b56d2e476bced5c763b7e01c8d#diff-885d4b90cffa47361b72fc3c446d912a.)

  • The example formatters have patterns like this:

    module.exports = function(results) {
        var results = results || [];
        // ...
    }
    

    However, the results array should never be null, so there is no need to redeclare the variable with a default like that.

  • Several of the example formatters use console.log to output results, which is not recommended (since it doesn’t work when the formatter is used by an integration). Instead, formatters should return a string.

  • The example here for “Using a JSON formatter first” is unnecessarily complicated – I don’t think we need to walk people through how to create a separate script that reads from stdin. Also, we can tell people to use the built-in json formatter rather than creating their own custom formatter that does the same thing.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
dominictwleecommented, May 1, 2018

Hi, if no one else is working on this I’d like to give it a go! I’m new to this but I’ll read through the contributing guidelines thoroughly and make sure I’m helping out rather than causing a hindrance. I reckon i could look into in the next couple of days.

2reactions
marla294commented, Jul 10, 2018

Hi, I’m also new… would like to take on that last bullet point. Will shoot for completion by the end of the week at the latest (7/13/18). LMK if any issues with this. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

pages custom date format - Apple Community
I'm looking for a way to create a custom date format outside a Pages formatted cell. In other words, in text paragraphs, I...
Read more >
Custom date and time format strings | Microsoft Learn
The "d" custom format specifier represents the day of the month as a number from 1 through 31. A single-digit day is formatted...
Read more >
How to change Excel date format and create custom formatting
Tip. If you want to quickly set date format in Excel to dd-mmm-yy, press Ctrl+Shift+#. Just keep in mind that this shortcut always...
Read more >
Formatters - Product Documentation | ServiceNow
A formatter is a form element used to display information that is not ... To create a custom formatter, create a UI macro...
Read more >
PDF22: Indicating when user input falls outside the required ...
The objective of this technique is to notify the user when user input to a field that requires a specific, required format (e.g.,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found