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

should ignoreTypeReferences be false in no-use-before-define? #221

Open
yubaoquan opened this issue Jun 24, 2021 · 1 comment
Open

should ignoreTypeReferences be false in no-use-before-define? #221

yubaoquan opened this issue Jun 24, 2021 · 1 comment

Comments

@yubaoquan
Copy link

Currently, rule no-use-before-define is using default options, that is

"@typescript-eslint/no-use-before-define": ['error', {
  enums: true,
  typedefs: true,
  ignoreTypeReferences: true,
}]

In this situation, we can use type before it is defined like code below without errors.

export function aaa() {
  const person: Person = { name: 'someone' };
  console.info(person);
}

type Person = { name: string };

Should we setignoreTypeReferences to false in order to make sure types are defined before they are used?

@Zamiell
Copy link
Contributor

Zamiell commented Aug 13, 2021

Agree with this!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants