[feature] Add custom `data` into `LintMessage`
See original GitHub issueThe version of ESLint you are using.
v7.21.0
The problem you want to solve.
I want to get custom data which reported with context.report({ data })
info in LintMessage
in postprocess
.
Your take on the correct solution to problem.
For now, we got no way to get the custom data, I have to hack to use the message
property with JSON.stringify/parse
instead.
Are you willing to submit a pull request to implement this change?
Yes
Issue Analytics
- State:
- Created 3 years ago
- Comments:22 (20 by maintainers)
Top Results From Across the Web
How can I add custom inputs to the attribute inspector?
I'm building an Attribute Inspector for an application. The application allows the user to click on a feature (displayed from a feature ......
Read more >Node.js API - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >How to Import a Custom PowerShell Module Into a Dockerfile ...
If you want to use a custom PowerShell module in a Docker container, the command to import it correctly is simple when you...
Read more >openlayers: adding unique data to a feature and referencing it
I have my control which draws the point but I want to add some data to it and then reference it later within...
Read more >Index (Desktop Tools and Development Environment) - MatLab
Symbols ! function: %. comment symbol · create comment · %#ok indicator to suppress M-Lint message · %% · , after functions ......
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
Ah okay, thank you. I understand now. You’re looking for a way to pass data from the rules into the processor to determine how to represent the errors better.
That’s an interesting idea. I’m not sure if adding such data would be a breaking change, so I’ll run this by the team and see what they think.
@btmills as our resident processor expert, what do you think?
hello,
I am working on https://github.com/SonarSource/SonarJS which is a static analyzer based on ESLint used in SonarQube/SonarCloud/SonarLint. We would be also interested in the API which would allow passing additional data when reporting the problem from the rule. In Sonar ecosystem we have the concept of additional locations in the source code which helps to understand more complex problems (imagine taint analysis). Here is one example which shows dataflow in SQL injection issue in juice shop https://sonarcloud.io/project/issues?id=saberduck_juice-shop&issues=AX6N9VGbKcvyCvHU0eOA&open=AX6N9VGbKcvyCvHU0eOA
Currently, we have implemented a similar hack, we encode JSON object in the rule message. However this is ugly and we can’t use messageIds properly, so I would like to migrate from this.
I will be more than happy to help with the implementation if we can agree together on the design.