Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

🐛 expected an identifier, an array pattern, or an object pattern but instead found '(' #3746

Closed
1 task done
Newbie012 opened this issue Nov 15, 2022 · 2 comments
Closed
1 task done
Labels
S-To triage Status: user report of a possible bug that needs to be triaged

Comments

@Newbie012
Copy link

Environment information

CLI:
  Version:              10.0.1
  Color support:        true

Platform:
  CPU Architecture:     x86_64
  OS:                   linux

Environment:
  ROME_LOG_DIR:         unset
  NO_COLOR:             unset
  TERM:                 "xterm-256color"

Rome Configuration:
  Status:               unset

Workspace:
  Open Documents:       0

Discovering running Rome servers...

Server:
  Status:               stopped

What happened?

  1. create a file called geo_tz.d.ts
  2. write:
declare module "geo-tz" {
    export default function (lat: number, lng: number): string[];
}
  1. get an error:
    1 │ declare module "geo-tz" {
  > 2 │     export default function (lat: number, lng: number): string[];
      │                             ^
    3 │ }
    4 │ 
  
  ℹ Expected an identifier, an array pattern, or an object pattern here
  
    1 │ declare module "geo-tz" {
  > 2 │     export default function (lat: number, lng: number): string[];
      │                             ^
    3 │ }
    4 │ 

Expected result

While it's fixable by specifying a name to the function (identifier), it's still considered a valid TypeScript code. Thus, the formatter should not crash (See playground).

PS - The results are very impressive!

Formatted 1731 files in 452ms

Code of Conduct

  • I agree to follow Rome's Code of Conduct
@Newbie012 Newbie012 added the S-To triage Status: user report of a possible bug that needs to be triaged label Nov 15, 2022
@denbezrukov
Copy link
Contributor

it seems that it's related #3485

@ematipico
Copy link
Contributor

ematipico commented Nov 15, 2022

Duplicate of #3485

So we can keep track of one single issue :) Thank you @denbezrukov for your comment!

@ematipico ematipico closed this as not planned Won't fix, can't repro, duplicate, stale Nov 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
S-To triage Status: user report of a possible bug that needs to be triaged
Projects
None yet
Development

No branches or pull requests

3 participants