the-simian / es6-plato

JavaScript source code visualization, static analysis, and complexity tool
MIT License
205 stars 40 forks source link

linting errors (eslint) not shown #99

Closed DanielRuf closed 4 years ago

DanielRuf commented 5 years ago

In my case (website-checks with the refactor/modularize branch) does not show the linting errors (warnings).

Should es6-plato show them normally?

the-simian commented 5 years ago

image

when you run the report, open the index.html file you should (hopefully) see reports for

below that is the file-by-file breakdown, you can sort by linter errors

image

As far as I can tell this feature is working, but I also may be misunderstanding something, did this answer your question @DanielRuf ?

DanielRuf commented 5 years ago

I meant my refactor branch of my website-checks repo which us merged in master.

The CLI does not output / list these errors.

Is this wanted or should we see them? A number does not tell much.

So if there are eslint errors we have to run a standalone version of it and check the code again?

the-simian commented 5 years ago

I meant my refactor branch of my website-checks repo which us merged in master.

The CLI does not output / list these errors.

The artifact is the html document I mentioned, it is intended for the user to open it or build it iteratively in ci. By default this is put in the /reports directory, I believe.

Is this wanted or should we see them? A number does not tell much.

Yes, it is wanted. I'll explain.

They are visible in the report. You are correct a number does not tell much, that is why there is more information in the files of the report, let me show you. I'm sure you saw the first page, this is just like a table of contents:

image

Now click the bar...

image

Every file generates a report per file. So you can scroll down...

image

You can see all the lint errors and the gears will show you complexity,etc per function

So if there are eslint errors we have to run a standalone version of it and check the code again?

Sorta, this is not the same thing as say, an eslint command-line tool, where its 'always on' its more of a report. When I'm developing I also use tools like prettier, etc to do code formatting. This is more for a report, such as something that could run over every PR or in CI, or to do some analysis. The linter is included alongside the complexity analysis to improve your ability to review the file.

that said, In the past I've used it as a post hook while running integration tests and that's not bad. For unit tests, there's some effort in generating all the html files. It is not yet so intelligent that it does HMR or diffing and only updating just the files you touched last. I've considered working that out in the past, but that would take a lot of effort, and there is a lot else I'd probably work on with that. I suppose a fast enough machine could do that?

Foe Eslint, I personally use other things to put out info in my command line on every reload. The primary output of this is a 'nice' html report. and also a convenient way to explore a project and get a sense of the state of it in terms of complexity and lint errors, etc.

Does this answer your questions?

DanielRuf commented 5 years ago

https://github.com/DanielRuf/website-checks

In some cases your CLI prints some eslint errors / exceptions (parsing errors) but not for all / normal eslint findings.

DanielRuf commented 5 years ago

You can see all the lint errors

I don't see the one error per file in my case.

the-simian commented 5 years ago

So you're saying when you click into one of the individual file reports, you see the gears with the complexity information, but nothing about the lint errors (eye icons)? And this is in a situation where there's known lint errors (as in if you were to run eslint standalone, you'd see the output.)

Is that the problem?

Just trying to zero in on what needs fixing, here.

FWIW the screenshots I posted are based on the master branch right now, I literally just ran the tool on whatever I had open, via the command I showed you. I just checked with running eslint directly and they seem to be at parity for me. If something is wrong can you give me a way to reproduce it?

the-simian commented 5 years ago

@DanielRuf reason I'm asking: I'm going to be upgrading to eslint 3 like, pretty soon... if I'm gonna work on that I might as well look then

DanielRuf commented 5 years ago

I have found the bug, I will provide a PR.

the-simian commented 5 years ago

I must admit I don't fully understand what the issue was, can you explain the bug? I'd happily check out a PR too, is this so that eslint logs warnings, as well as errors in the console, particularly, or, was this to make the lint errors appear in the files?