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

Usage with ESLint #185

Open
j opened this issue Aug 13, 2019 · 2 comments
Open

Usage with ESLint #185

j opened this issue Aug 13, 2019 · 2 comments

Comments

@j
Copy link

j commented Aug 13, 2019

When you're using a class as the type, you get the error: @typescript-eslint/no-use-before-define.

I'd rather not disable this line. Any chance to make @provide() without any arguments passed in default to the class type?

@j
Copy link
Author

j commented Aug 13, 2019

#186

@Web-Engine
Copy link

I encountered the error ReferenceError: Cannot access before initialization, and I really need this pull requests.

If someone want to use this pull request without any modifying original source before merging,
Use your own decorator like

import { interfaces } from 'inversify';
import { provide } from 'inversify-binding-decorators';

function provideAuto(serviceIdentifier?: interfaces.ServiceIdentifier<any>, force?: boolean) {
  return function (target: any) {
    const result = provide(serviceIdentifier || target, force)(target);

    return result;
  };
}

export default provideAuto;

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

No branches or pull requests

2 participants