首页 > 解决方案 > GitLab Web IDE 中 TypeScript 中的重复标识符“匹配”

问题描述

我已经阅读了有关此的多个问题,但所有这些问题似乎都是关于node_modules并说不包括在 中tsconfig.json,但我的问题在我自己的代码中。

我有 2 个文件,每个文件都有一个类。我的这两个文件的仓库在这里。在 GitLab IDE 中,根据文件将鼠标悬停在 Match 或 Player 上时,它会显示Duplicate identifier 'Match'or Duplicate identifier 'Player'。是因为文件名相同吗?

class Match {
    type: void
    players: object[] = []
    constructor(type: void, players: object[]) {
        this.type = type
        this.players = players
    }
}

悬停时

标签: typescript

解决方案


推荐阅读