Skip to content

linter: oxc incorrectly emits oxc(eslint(vars-on-top)) for declare block in TypeScript code #14951

@hamirmahal

Description

@hamirmahal

What version of Oxlint are you using?

1.18.0

What command did you run?

npx oxlint

What does your .oxlintrc.json config file look like?

{
	"categories": {
		"style": "deny"
	}
}

What happened?

oxc emits oxc(eslint(vars-on-top)) for

declare global {
	var __CUSTOM_FLAG__: boolean | undefined;
}

but this needs to be var.


If we use let instead,

declare global {
	let __CUSTOM_FLAG__: boolean | undefined;
}

TypeScript reports

Property '__CUSTOM_FLAG__' does not exist on type 'typeof globalThis'.ts(2339)

when accessing

globalThis.__CUSTOM_FLAG__

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions