-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
How to use the ESLint annotations? #96
Comments
Just as a FYI, I've also tried with the |
After some investigation: Currently the error matchers require that ESLint errors have an error code in them: {
"regexp": "^(.+):\\sline\\s(\\d+),\\scol\\s(\\d+),\\s(Error|Warning|Info)\\s-\\s(.+)\\s\\((.+)\\)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5,
"code": 6
} However, not all ESLint error messages have associated codes, specially if it's invalid JavaScript like: const a = (a: number, b: number): number => a + b;
export const handler = () => {
make javascript fail again
async function foo(things) {
const results = [];
for (const thing of things) {
// Bad: each loop iteration is delayed until the entire asynchronous operation completes
results.push(await bar(thing));
}
return baz(results);
}
}; The script above will result in the following error message:
While it has line and column, it has no error code associated. |
The action could potential only register the problem matcher is it detects an eslint config file ... |
Could the code capture group be made optional? so it still matches? |
I might be wrong, but as a consequence of this, this action doesn't create annotations for typescript/* and react-hooks/* ESLint warning/errors. Which means that it doesn't annotate around 80% of real-world linting messages. |
Yeah, I'd had to use the |
A regex such as:
Would likely fix this. I can raise a PR if people are happy with this. |
…ash-4.17.21 Bump lodash from 4.17.20 to 4.17.21
Did this ever get merged? I can't get this to work either |
It's my first time using the annotations feature, so please forgive me if this issue is irrelevant.
I'm trying to have annotations in the PR, however all I can get is a simple annotation in the actions screen with irrelevant information. I'm guessing that's a problem of mine, and since there's not a lot documentation (that I could find) about this might as well ask.
That's the output of a failing eslint job. The current configuration is:
where my package.json looks like:
I expected that the following error would actually appear in the annotation, and hopefully in the PR too.
but as you can get the from screenshot, all I have is that the process completed with error 1.
Is my expectation wrong? Or do I have something misconfigured?
Thanks
The text was updated successfully, but these errors were encountered: