Skip to content
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

"Working with custom formatters" page is out of date #9950

Closed
not-an-aardvark opened this issue Feb 6, 2018 · 8 comments
Closed

"Working with custom formatters" page is out of date #9950

not-an-aardvark opened this issue Feb 6, 2018 · 8 comments
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly documentation Relates to ESLint's documentation good first issue Good for people who haven't worked on ESLint before

Comments

@not-an-aardvark
Copy link
Member

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 f5a7e42#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.

@not-an-aardvark not-an-aardvark added bug ESLint is working incorrectly documentation Relates to ESLint's documentation accepted There is consensus among the team that this change meets the criteria for inclusion labels Feb 6, 2018
@platinumazure platinumazure added the good first issue Good for people who haven't worked on ESLint before label Mar 27, 2018
@platinumazure
Copy link
Member

I've gone ahead and marked this as "good first issue" in case any new contributors want to take this on.

Prospective contributors: Please don't feel like you need to solve all of the issues at once. You are more than welcome to solve 1 or 2 of the issues identified above. Just make sure your commit summary ends with "(refs #9950)" instead of fixes in that case, so the issue stays open when we merge your pull request. Please stop by our Gitter chat with any questions. Thanks!

@dominictwlee
Copy link
Contributor

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.

@Hirse
Copy link
Contributor

Hirse commented May 25, 2018

With the @dominictwlee's PR merged, is this issue solved?

@not-an-aardvark
Copy link
Member Author

I think most of the bullet points have been addressed, with the exception of the last bullet point.

@marla294
Copy link
Contributor

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!

@platinumazure
Copy link
Member

Hi @marla294, please feel free to jump in! I look forward to your PR 😄

@marla294
Copy link
Contributor

@platinumazure Thanks! I'll do my best!

@ViggoV
Copy link

ViggoV commented Dec 4, 2018

The docs say that the filePath is supposed to be relative to the working directory. In my case however, they are absolute relative to the system root. I have reported an issue: #11156

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Jan 11, 2019
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Jan 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly documentation Relates to ESLint's documentation good first issue Good for people who haven't worked on ESLint before
Projects
None yet
Development

No branches or pull requests

6 participants