JSON formatter "source" attribute should focus on relevant lines
See original GitHub issueTell 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:
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:
- Created 5 years ago
- Comments:10 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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!
Okay, thanks for the information. I will investigate those options.