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

A wrong behavior after upgrade to 4.14.0 #2947

Closed
3 tasks done
mlc-mlapis opened this issue Jan 19, 2021 · 4 comments
Closed
3 tasks done

A wrong behavior after upgrade to 4.14.0 #2947

mlc-mlapis opened this issue Jan 19, 2021 · 4 comments
Labels
duplicate This issue or pull request already exists package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@mlc-mlapis
Copy link

mlc-mlapis commented Jan 19, 2021

  • I have tried restarting my IDE, and the issue persists.
  • I have updated to the latest version of the packages.
  • I have read the FAQ and my problem is not listed.

Repro

If AppState is imported:

import {AppState} from '@m-kbase/shared/general/states';

and later used only in a constructor, like:

constructor(
   private _store: Store<AppState>
) {}

then the warning appears in many places (in relation to the import {AppState} from '@m-kbase/shared/general/states'; line):

warning 'AppState' is defined but never used @typescript-eslint/no-unused-vars

Expected Result

The same result as with the previous version 4.13.0 or earlier, with no warnings.

Additional Info

Probably similar to #2946

Versions

package version
@typescript-eslint/eslint-plugin 4.14.0
@typescript-eslint/parser 4.14.0
TypeScript 4.0.5
ESLint 7.18.0
node 12.13.1
@mlc-mlapis mlc-mlapis added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels Jan 19, 2021
@chunghha
Copy link

I see same warning after updating from 4.13.0 to 4.14.0. For example with this code, it throws "3:22 warning 'HealthResponse' is defined but never used @typescript-eslint/no-unused-vars",

import { Controller, Get } from '@nestjs/common';

import { AppService, HealthResponse } from './app.service';

@Controller('tfapi')
export class AppController {
	constructor(private readonly appService: AppService) {}

	@Get('/isHealthy')
	async getHealth(): Promise<HealthResponse> {
		return this.appService.getHealth();
	}
}

@vladimiry
Copy link

vladimiry commented Jan 19, 2021

Same here. Btw, the warning doesn't get triggered in the case of inline type import use:

constructor(
   private _store: Store<import("@m-kbase/shared/general/states").AppState>,
) {}

@bradzacher
Copy link
Member

Same as #2941, #2942, #2945

Fixed in #2943

Please use the search next time.

@bradzacher bradzacher added duplicate This issue or pull request already exists and removed triage Waiting for maintainers to take a look labels Jan 19, 2021
@mlc-mlapis
Copy link
Author

@bradzacher Thanks for your PR, I was too fast. You are right. 🥇

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

No branches or pull requests

4 participants