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

chore: Define type for Extra(s) #2727

Merged

Conversation

Shinigami92
Copy link
Contributor

This PR introduces a type for Extra and Extras so developers can reference these types in their code

e.g.:

import { Extras } from '@sentry/types';

export class LogService {
  // ...

  public error(message: string, extras?: Extras): void {
    console.error(message, extras);
    this.message(/* ... */, extras);
  }

  // ...

  private message(/* ... */, extras: Extras = {}): void {
    // ...
    Sentry.setExtras(extras);
    // ...
  }
}

@Shinigami92
Copy link
Contributor Author

I'm confused by the lint message

@sentry/hub: ERROR: 20:1 ordered-imports Imports from this module are not allowed in this group. The expected groups (in order) are: libraries, parent directories, current directory.

I already used vscode's Organize Imports 🤔

@Shinigami92 Shinigami92 marked this pull request as ready for review July 8, 2020 10:12
@kamilogorek
Copy link
Contributor

Looks good, thanks!

@kamilogorek kamilogorek merged commit 038453d into getsentry:master Jul 8, 2020
@Shinigami92 Shinigami92 deleted the chore/define-extra-typedef branch July 8, 2020 12:31
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