Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add @typescript-eslint/no-redeclare rule #37

Merged
merged 1 commit into from
Apr 24, 2021

Conversation

andersk
Copy link
Contributor

@andersk andersk commented Apr 24, 2021

Commit 025fcf4 said that no-redeclare has been fixed and removed 'no-redeclare': 'off'. But we still need the typescript-eslint version of this rule, not the base rule. For example, the base rule doesn’t support overloads:

export function f(x: number): number;
export function f(x: string): string;
export function f(x: number | string): number | string {
	return x;
}
  test.ts:2:17
  ✖  2:17  f is already defined.  no-redeclare
  ✖  3:17  f is already defined.  no-redeclare

  2 errors

Commit 025fcf4 said that no-redeclare
has been fixed and removed 'no-redeclare': 'off'.  But we still need
the typescript-eslint version of this rule, not the base rule.  For
example, the base rule doesn’t support overloads:

export function f(x: number): number;
export function f(x: string): string;
export function f(x: number | string): number | string {
	return x;
}

  test.ts:2:17
  ✖  2:17  f is already defined.  no-redeclare
  ✖  3:17  f is already defined.  no-redeclare

  2 errors

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
@sindresorhus sindresorhus changed the title Use typescript-eslint version of no-redeclare Add @typescript-eslint/no-redeclare rule Apr 24, 2021
@sindresorhus sindresorhus merged commit a9481df into xojs:main Apr 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants