Skip to content

Commit c6453cf

Browse files
author
Andre Rabold
committed
Rewrite library using Typescript; updated to latest dependencies
1 parent 479430b commit c6453cf

15 files changed

+4031
-1770
lines changed

.editorconfig

Lines changed: 0 additions & 11 deletions
This file was deleted.

.eslintrc

Lines changed: 0 additions & 28 deletions
This file was deleted.

.eslintrc.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
env:
3+
es6: true
4+
node: true
5+
mocha: true
6+
plugins:
7+
- promise
8+
- prettier
9+
- "@typescript-eslint"
10+
extends:
11+
- eslint:recommended
12+
- plugin:promise/recommended
13+
- plugin:@typescript-eslint/eslint-recommended
14+
- plugin:@typescript-eslint/recommended
15+
- plugin:@typescript-eslint/recommended-requiring-type-checking
16+
parser: "@typescript-eslint/parser"
17+
parserOptions:
18+
tsconfigRootDir: .
19+
project:
20+
- ./tsconfig.json
21+
sourceType: module
22+
rules:
23+
"@typescript-eslint/ban-types": 0 # to allow "{}" as a type
24+
"@typescript-eslint/camelcase": 0 #deprecated
25+
"@typescript-eslint/explicit-function-return-type": 0 # allow implicit return types
26+
"@typescript-eslint/interface-name-prefix": 0 # interfaces prefixed with "I" are perfectly fine
27+
"@typescript-eslint/no-empty-function": 0
28+
"@typescript-eslint/no-explicit-any": 0
29+
"@typescript-eslint/no-floating-promises": error
30+
"@typescript-eslint/no-inferrable-types": 0
31+
"@typescript-eslint/no-unused-vars": [error, { vars: all, ignoreRestSiblings: true }]
32+
"@typescript-eslint/no-useless-constructor": error
33+
"@typescript-eslint/no-var-requires": 0 # allow `require()`
34+
"@typescript-eslint/require-await": 0
35+
import/order: 0 # we use prettier import sorting by module
36+
no-console: 0
37+
no-unused-expressions: 0 # use @typescript-eslint/no-unused-expressions instead
38+
no-unused-vars: 0 # use @typescript-eslint/no-unused-vars instead
39+
no-useless-constructor: 0 # use @typescript-eslint/no-useless-constructor instead
40+
prettier/prettier: error
41+
overrides:
42+
- files: ["*.test.*"]
43+
rules:
44+
"@typescript-eslint/no-floating-promises": 0
45+
"@typescript-eslint/no-unused-vars": 0
46+
"promise/always-return": 0

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
/node_modules
1+
node_modules
2+
.history

README.md

Lines changed: 146 additions & 211 deletions
Large diffs are not rendered by default.

dist/index.d.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import * as Sentry from "@sentry/node";
2+
import { Callback, Context } from "aws-lambda";
3+
export declare type Handler<TEvent = any, TResult = any> = (event: TEvent, context: Context, callback?: Callback<TResult>) => void | Promise<TResult>;
4+
export declare type PluginConfig = {
5+
filterLocal?: boolean;
6+
sourceMaps?: boolean;
7+
autoBreadcrumbs?: boolean;
8+
captureErrors?: boolean;
9+
captureUnhandledRejections?: boolean;
10+
captureMemoryWarnings?: boolean;
11+
captureTimeoutWarnings?: boolean;
12+
init?: Sentry.NodeOptions;
13+
scope?: {
14+
tags?: {
15+
[key: string]: string;
16+
};
17+
extras?: {
18+
[key: string]: any;
19+
};
20+
user?: Sentry.User | null;
21+
};
22+
sentryClient: typeof Sentry;
23+
};
24+
export default class SentryLambdaWrapper {
25+
static handler(pluginConfigOrSentry: PluginConfig | typeof Sentry, handler: Handler<any, any>): Handler<any, any>;
26+
}

0 commit comments

Comments
 (0)