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.

[feature] Add custom `data` into `LintMessage`

See original GitHub issue

The 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:open
  • Created 3 years ago
  • Comments:22 (20 by maintainers)

github_iconTop GitHub Comments

1reaction
nzakascommented, Mar 19, 2021

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?

0reactions
saberduckcommented, Jan 24, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

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