https://bugs.kde.org/show_bug.cgi?id=456493

--- Comment #9 from nat...@upchur.ch ---
(In reply to Waqar Ahmed from comment #8)
> I have removed "Eslint current file" from the "Code Analysis" tab and
> replaced it with "ESLint" which will run on the whole project instead of
> just the current file. 
This makes sense. I imagine many users wouldn't think to enable the projects
plugin, especially for simple web projects.

For testing purposes, I created a directory containing two JS files: 

Kate ESLint Test/
├─ test.js
├─ test2.js

File content:
-------------------------------------------
const count = (n) => {
        for (let i=1; i<=n; i++) {
                console.log(i);
        }
};

count(10);
-------------------------------------------

When I used File > Open Folder and clicked Project > ESLint > Start Analysis
with no errors in either .js file, ESLint failed to run with the following
error in the Output panel: 

[16:40:36  CodeAnalsis Error] Analysis failed with exit code 0, Error:
[{"filePath":"/home/user/Kate ESLint
Test/test.js","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/home/user/Kate
ESLint
Test/test2.js","messages":[],"suppressedMessages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]}]

When I introduce an error into each file (an extra semicolon on line 4) and run
Project > ESLint > Start Analysis, the error is output into Diagnostics output
for test.js, but not test2.js. 

When I introduce the same error only to test1.js and run Project > ESLint >
Start Analysis, everything behaves as expected.

When I introduce the same error only to test2.js and run Project > ESLint >
Start Analysis, no error is sent to Diagnostics, but ESLint does not fail to
run per the below output from the Output panel:

[16:56:57  CodeAnalsis Log] Analysis on ESLint files finished.

> Additionally, I have added a new plugin named "ESLint" which will run only
> on the current file on saving. 
The duplicated error issue looks resolved in the ESLint plugin. I do find that
errors aren't removed from Diagnostics output when correcting the error and
saving (is this what you meant by auto-fix?). The error is removed from
Diagnostics output when a new error (from the same file) is sent to
Diagnostics. This also applies to line highlighting.

I also notice that the log messages in the Output panel contain a typo:
CodeAnalsis should be CodeAnalysis.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to