Skip to content

Svelte-check tool outputs wrong line number in machine-verbose mode #2830

@junajan

Description

@junajan

Describe the bug

Hello all!

When I use svelte-check command with --output machine vs --output machine-verbose it returns different line numbers.

The reason for this is that here it returns:

  • machine mode:
this.log(`${type} ${fn} ${start.line + 1}:${start.character + 1} ${msg}`);
// line and character numbers are being incremented by one
  • vs in machine-verbose mode does this:
this.log(
    JSON.stringify({
        type,
        filename,
        start,
        end,
        message,
        code,
        codeDescription,
        source
    })
);
// it returns start and end numbers without incrementing them

Should it be consistent?

Reproduction

just run it for any project with errors/warnings

Expected behaviour

It should output same line number in machine and machine-verbose mode.

System Info

macos

Which package is the issue about?

No response

Additional Information, eg. Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions