Skip to content

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
@Shinigami92 Shinigami92 requested a review from kamilogorek as a code owner 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.

2 participants