Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Bug: Duplicateextends clause forinterface should be reported #11077

Open
Labels
ASTPRs and Issues about the AST structureaccepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workingpackage: typescript-estreeIssues related to @typescript-eslint/typescript-estree
@leaysgur

Description

@leaysgur

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I havesearched for related issues and found none that matched my issue.
  • I haveread the FAQ and my problem is not listed.

Relevant Package

typescript-estree

Playground Link

https://typescript-eslint.io/play/#ts=5.4.3&fileType=.tsx&code=MYGwhgzhAECiCM0DeBfAUKSNYCZno3CmgA1EBTADwBdyA7AE20VTQHo3pNiS8rbGzaP3pM4eVtxgkAzNACWAWwAOIcovrUhrDlyLSALApVqNdLXERLV6zdgnoppAKzCaooddN3x%2BdpycSADZjGzMLBDcBMVw-NHlzcgAnADMwYHJoAE0Kd0FLPwTaVPTMrL48mNzo%2B3xoXUBeDcABHegAFQALeRgIdoB7AFcQBmgAI0yk8mVepNphkYBPaGUwJIhkgBpoEHkAa0ze6nbkiH8FRJKM7LkvW3NtdF0i5LTLrKMb8M8TW4iHU6eLmVXB8fJERPlYjpOACXmUQuCqqFvHdfKggA&eslintrc=N4KABGBEBOCuA2BTAzpAXGYBfEWg&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA&tokens=false

Repro Code

classE1{}classE2{}// class X2 extends E1 extends E2 {} // This is reportedinterfaceY2extendsE1extendsE2{}// This is NOT reported

ESLint Config

tsconfig

Expected Result

Parser should report internal errorTS1172: 'extends' clause already seen. like TS does.

https://www.typescriptlang.org/play/?#code/MYGwhgzhAECiCM0DeBfAUKSNYCZno3CmgA1EBTADwBdyA7AE20VTQHo3pNiS8rbGzaP3pM4eVtxgkAzNACWAWwAOIcovrUhrDlyLSALApVqNdLXERLV6zdgnoppAKzCaooddN3x+dpycSADZjGzMLBDcBMVw-NHlzcgAnADMwYHJoAE0Kd0FLPwTaVPTMrL48mNzo+z9dIuS0jOy5L1tzbXR6xJLmrKM28M8TdoiHfwUeprLXQZ9IkXzYnU4G3rKQxarQ7w7fVCA

Actual Result

No errors are reported.

Additional Info

Since duplicateextends are reported correctly forclass, they should be reported forinterface too?

if(token===SyntaxKind.ExtendsKeyword){
if(extendsClause){
this.#throwUnlessAllowInvalidAST(
heritageClause,
"'extends' clause already seen.",
);
}

I can send a PR if this is acceptable change.

leaysgur@0a6d4db

Versions

packageversion
@typescript-eslint/typescript-estree8.30.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    ASTPRs and Issues about the AST structureaccepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workingpackage: typescript-estreeIssues related to @typescript-eslint/typescript-estree

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp