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

Move @typescript-eslint/no-namespace to disabled list #55180

Merged
merged 1 commit into from
Jul 28, 2023

Conversation

jakebailey
Copy link
Member

This rule fires for these:

/home/jabaile/work/TypeScript/src/compiler/core.ts
  1882:41  error  Unexpected empty function 'noop'        @typescript-eslint/no-empty-function
  2706:43  error  Unexpected empty function 'assertType'  @typescript-eslint/no-empty-function

/home/jabaile/work/TypeScript/src/compiler/debug.ts
  358:43  error  Unexpected empty function 'type'  @typescript-eslint/no-empty-function

/home/jabaile/work/TypeScript/src/testRunner/unittests/evaluation/esDecorators.ts
   741:65  error  Unexpected empty method 'method'   @typescript-eslint/no-empty-function
   768:44  error  Unexpected empty method 'method'   @typescript-eslint/no-empty-function
   785:76  error  Unexpected empty method '#method'  @typescript-eslint/no-empty-function
  1139:70  error  Unexpected empty arrow function    @typescript-eslint/no-empty-function
  1189:70  error  Unexpected empty arrow function    @typescript-eslint/no-empty-function
  1270:70  error  Unexpected empty arrow function    @typescript-eslint/no-empty-function
  1351:70  error  Unexpected empty arrow function    @typescript-eslint/no-empty-function
  1432:70  error  Unexpected empty arrow function    @typescript-eslint/no-empty-function
  1513:70  error  Unexpected empty arrow function    @typescript-eslint/no-empty-function

✖ 12 problems (12 errors, 0 warnings)

The first three are functions which are canonically empty (which we'd exempt). It's possible that we'd always use noop when we wanted an empty function, so it would seem like this rule is fine to keep things consistent.

However, the last file's errors are in a test which checks that the shape of things is correct, such that it's not really a problem that they are empty, but there's no way we could use noop to achieve the same goals, only throw or something to say "this is intentionally empty".

I'm not sure if this rule gets us much; if anything it'd just be an annoyance in the editor when we are working on the code, similarly to my thoughts on no-empty-interface.

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Jul 28, 2023
@jakebailey jakebailey merged commit 21bb216 into microsoft:main Jul 28, 2023
@jakebailey jakebailey deleted the eslint-no-empty-function branch July 28, 2023 04:14
@jakebailey
Copy link
Member Author

I mistitled the PR... Was supposed to be no empty function. Ugh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants