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.

JSON formatter "source" attribute should focus on relevant lines

See original GitHub issue

Tell us about your environment

  • ESLint Version: 5.12.0
  • Node Version: 11.9.0
  • npm Version: 6.5.0

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

/**
 * Save a file to a specific location and create required directories
 * @param {string} filePath path to file relative to main directory
 * @param {string} data file contents
 */
function writeFileCreateDirs (filePath, data) {
  fs.mkdirpSync(path.dirname(filePath))
  fs.writeFileSync(filePath, data)
}
node_modules/.bin/eslint --format=json -o=eslint_result.json cache.js

What did you expect to happen? I want an understandable and short JSON formatted output.

What actually happened? Please include the actual, raw output from ESLint. In the eslint_result.json I have this content when I console.log it:

image

I think it will much more useful if every single issue contains its JSON attribute called “filePath” and in the source attribute is not the whole file but instead the problematic line or problematic block.

Are you willing to submit a pull request to fix this bug?

Yes, but maybe I will need help.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
nzakascommented, Feb 18, 2019

As this is a question rather than an action item, I’m closing the issue. If you still need help, please send a message to our mailing list or chatroom. Thanks!

0reactions
MVrachevcommented, Feb 8, 2019

Okay, thanks for the information. I will investigate those options.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JSON Formatter & Validator
The JSON Formatter & Validator beautifies and debugs JSON data with advanced formatting and validation algorithms.
Read more >
Create Your Own JSON Formatter with JavaScript (Prettify ...
View the SOURCE CODE here: https://codepen.io/dcode-software/pen/ZEJWJZj In today's video I'll be showing you how to build your own JSON ...
Read more >
Use column formatting to customize SharePoint
To format a column, enter the column formatting JSON in the box. To preview the formatting, select Preview. To commit your changes, select...
Read more >
SharePoint modern view formatting with JSON – part 1 of 2
It is important that you understand JSON as that is what is used to create these custom views. JSON data is written as...
Read more >
Working with JSON - Learn web development | MDN
JSON is purely a string with a specified data format — it contains only properties, no methods. JSON requires double quotes to be...
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