Skip to content
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

Add UI5 Linter Results to the VSCode's Report tab #160

Open
d3xter666 opened this issue Jun 17, 2024 · 1 comment
Open

Add UI5 Linter Results to the VSCode's Report tab #160

d3xter666 opened this issue Jun 17, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@d3xter666
Copy link
Contributor

Description

Currently, the UI5 Linter outputs results in an ESLint-like style to the console. To make these findings transferrable to the VSCode "Reports" tab, we need to adopt VSCode's formatter style.

Steps to Reproduce

  1. Set up VSCode tasks for the project using the following sample code:

    // .vscode > tasks.json
    {
        "version": "2.0.0",
        "tasks": [
            {
                "label": "UI5 version 2.0 check",
                "type": "shell",
                "command": "npx --yes @ui5/linter@latest",
                "problemMatcher": ["$eslint-stylish"]
            }
        ]
    }
  2. Run the task on a Windows machine.

Expected Behavior

The VSCode "Reports" tab should correctly parse the output from the UI5 Linter and display all findings.

Actual Behavior

On Windows machines, the output format is not properly parsed, and not all findings are transferred to the "Reports" tab.

Documentation

For more information on configuring VSCode tasks, refer to the documentation: VSCode Tasks Documentation.

Findings & Possible Solution

Currently, on Windows, when a new row is added by the terminal (not programmatically by the linter), it adds some whitespaces. These whitespaces are interpreted by the "problemMatcher": ["$eslint-stylish"] as a data separator, causing the description to be cut off.

We must find a way to make the problemMatcher treat the description as a whole text.
Hint: The issue is not related to the chalk module. It does add some ANSI characters, but the issue is reproducible even without it.

A possible solution is to check ESLint's formatter implementation: ESLint Stylish Formatter. The table module used in the implementation orders the data in columns and rows, and the "divider" is a whitespace, which is likely causing the formatting issue on Windows.

@d3xter666 d3xter666 added the enhancement New feature or request label Jun 17, 2024
@d3xter666
Copy link
Contributor Author

This one seems like a known problem:

The core issue seems to be in the Windows terminal, VSCode (actually, a submodule) has tried to do some heuristics to resolve the issue, but without big success: https://github.com/xtermjs/xterm.js/blob/32d6613811e403b3693d004b86c8a664553eaa59/src/WindowsMode.ts#L11-L29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant