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

馃悰 lint/suspicious/noRedeclare - Index signatures in same object marked as invalid #4478

Closed
1 task done
Vivalldi opened this issue May 15, 2023 · 0 comments 路 Fixed by #4519
Closed
1 task done
Assignees
Labels
A-Linter Area: linter S-Bug: confirmed Status: report has been confirmed as a valid bug

Comments

@Vivalldi
Copy link
Contributor

Vivalldi commented May 15, 2023

Environment information

CLI:
  Version:                      12.1.0
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  ROME_LOG_DIR:                 unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v18.14.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "yarn/3.3.1"

Rome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    true
  VCS disabled:                 true

Workspace:
  Open Documents:               0

Discovering running Rome servers...

Running Rome Server: 鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣鈹佲攣

i The client isn't connected to any server but rage discovered this running Rome server.

Server:
  Version:                      12.1.0
  Name:                         rome_lsp
  CPU Architecture:             aarch64
  OS:                           macos

Workspace:
  Open Documents:               0

Other Active Server Workspaces:

Workspace:
  Open Documents:               2
  Client Name:                  Visual Studio Code
  Client Version:               1.78.2

Rome Server Log:

! Please review the content of the log file before sharing it publicly as it may contain sensitive information:
  * Path names that may reveal your name, a project name, or the name of your employer.
  * Source code

What happened?

Specifying multiple index signatures with the same name in separate type fields causes noRedeclare to mark all except first as invalid.

Playground

export type TypeWithObjects = {
  valid: {
    [index: string]: string;
  }

  invalid: {
    [index: string]: string;
  }
}

Expected result

index on line 7 should not be marked as invalid

Code of Conduct

  • I agree to follow Rome's Code of Conduct
@Vivalldi Vivalldi added the S-To triage Status: user report of a possible bug that needs to be triaged label May 15, 2023
@ematipico ematipico added S-Bug: confirmed Status: report has been confirmed as a valid bug A-Linter Area: linter and removed S-To triage Status: user report of a possible bug that needs to be triaged labels May 15, 2023
@unvalley unvalley self-assigned this May 20, 2023
lgarron added a commit to cubing/cubing.js that referenced this issue Jun 25, 2023
This picks up a fix for multiple false positives in our codebase: rome/tools#4478
lgarron added a commit to cubing/cubing.js that referenced this issue Jun 25, 2023
This picks up a fix for multiple false positives in our codebase: rome/tools#4478
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Linter Area: linter S-Bug: confirmed Status: report has been confirmed as a valid bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants