Skip to content

Exact position of invalid characters not reported by scanner #43653

@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Bug Report

🔎 Search Terms

invalid character exact position scanner

🕗 Version & Regression Information

  • This is the behavior in every version I tried, and I reviewed the FAQ

⏯ Playground Link

Playground link with relevant code

💻 Code


var x;   

🙁 Actual behavior

The errors are reported without any column information.

index.ts:1:2 - error TS1127: Invalid character.

1 
   

index.ts:1:3 - error TS1127: Invalid character.

1 

🙂 Expected behavior

TypeScript should show exactly which character is invalid, no?

index.ts:1:2 - error TS1127: Invalid character.

1 
   ~


index.ts:1:3 - error TS1127: Invalid character.

1 
    ~

Noticed this while investigating #43005 (comment)...

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptHelp WantedYou can do this

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions