Skip to content

Configs: fix TS2629 & no-class-assign duplicate #10229

Closed
@Rudxain

Description

@Rudxain

Before You File a Proposal Please Confirm You Have Done The Following...

Description

I followed the official instructions, but still stumbled upon this ESL rule enabled by default

Impacted Configurations

recommended

Additional Info

eslint.config.mjs:

import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

export default tseslint.config(
	eslint.configs.recommended,
	...tseslint.configs.recommended,
);

tsconfig.json:

{
"compilerOptions": {
	"target": "ES2023",
	"skipLibCheck": true
},
"exclude": [ "node_modules" ]
}

package.json:

{
"name": "tsesl-min-repro",
"version": "0.0.0",
"main": "main.js",
"devDependencies": {
	"@eslint/js": "^9.13.0",
	"@types/eslint__js": "^8.42.3",
	"eslint": "^9.13.0",
	"typescript": "^5.6.3",
	"typescript-eslint": "^8.12.1"
}
}

main.ts:

class c { }
c = null

npx eslint .:

/home/rudxain/tsesl-min-repro/main.ts
  2:1  error  'c' is a class                          no-class-assign
  2:1  error  'c' is assigned a value but never used  @typescript-eslint/no-unused-vars

✖ 2 problems (2 errors, 0 warnings)

npx tsc --noEmit:

main.ts(2,1): error TS2629: Cannot assign to 'c' because it is a class.

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuelocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: eslint-pluginIssues related to @typescript-eslint/eslint-pluginpreset config changeProposal for an addition, removal, or general change to a preset config

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions