Skip to content

Commit e6599f2

Browse files
committed
build: Switch types to using eslint
1 parent a39a34d commit e6599f2

File tree

9 files changed

+47
-29
lines changed

9 files changed

+47
-29
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@ packages/integrations/**/*
88
packages/node/**/*
99
packages/react/**/*
1010
packages/tracing/**/*
11-
packages/types/**/*
1211
packages/typescript/**/*
1312
packages/utils/**/*

packages/types/.eslintrc.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
es6: true,
5+
},
6+
parserOptions: {
7+
ecmaVersion: 2018,
8+
},
9+
extends: ['../../.eslintrc.js'],
10+
ignorePatterns: ['build/**/*', 'dist/**/*', 'esm/**/*', 'examples/**/*', 'scripts/**/*'],
11+
overrides: [
12+
{
13+
files: ['*.ts', '*.tsx', '*.d.ts'],
14+
parserOptions: {
15+
project: './tsconfig.json',
16+
},
17+
},
18+
],
19+
rules: {
20+
'@typescript-eslint/no-explicit-any': 'off',
21+
},
22+
};

packages/types/package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
"npm-run-all": "^4.1.2",
2020
"prettier": "^1.17.0",
2121
"prettier-check": "^2.0.0",
22-
"tslint": "5.16.0",
2322
"typescript": "3.4.5"
2423
},
2524
"scripts": {
@@ -30,13 +29,13 @@
3029
"build:watch:es5": "tsc -p tsconfig.build.json -w --preserveWatchOutput",
3130
"build:watch:esm": "tsc -p tsconfig.esm.json -w --preserveWatchOutput",
3231
"link:yarn": "yarn link",
33-
"lint": "run-s lint:prettier lint:tslint",
32+
"lint": "run-s lint:prettier lint:eslint",
3433
"lint:prettier": "prettier-check \"{src,test}/**/*.ts\"",
35-
"lint:tslint": "tslint -t stylish -p .",
36-
"lint:tslint:json": "tslint --format json -p . | tee lint-results.json",
37-
"fix": "run-s fix:tslint fix:prettier",
34+
"lint:eslint": "eslint . --format stylish",
35+
"lint:eslint:json": "eslint . --format json | tee lint-results.json",
36+
"fix": "run-s fix:eslint fix:prettier",
3837
"fix:prettier": "prettier --write \"{src,test}/**/*.ts\"",
39-
"fix:tslint": "tslint --fix -t stylish -p ."
38+
"fix:eslint": "lint:eslint --fix"
4039
},
4140
"sideEffects": false
4241
}

packages/types/src/event.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export interface Event {
3232
stacktrace?: Stacktrace;
3333
breadcrumbs?: Breadcrumb[];
3434
contexts?: {
35-
[key: string]: object;
35+
[key: string]: Record<any, any>;
3636
};
3737
tags?: { [key: string]: string };
3838
extra?: { [key: string]: any };

packages/types/src/integration.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ import { Hub } from './hub';
33

44
/** Integration Class Interface */
55
export interface IntegrationClass<T> {
6-
new (...args: any[]): T;
76
/**
87
* Property that holds the integration name
98
*/
109
id: string;
10+
11+
new (...args: any[]): T;
1112
}
1213

1314
/** Integration interface */

packages/types/src/options.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,19 @@ export interface Options {
105105
*/
106106
normalizeDepth?: number;
107107

108+
/**
109+
* Controls how many milliseconds to wait before shutting down. The default is
110+
* SDK-specific but typically around 2 seconds. Setting this too low can cause
111+
* problems for sending events from command line applications. Setting it too
112+
* high can cause the application to block for users with network connectivity
113+
* problems.
114+
*/
115+
shutdownTimeout?: number;
116+
117+
_experiments?: {
118+
[key: string]: any;
119+
};
120+
108121
/**
109122
* A callback invoked during event submission, allowing to optionally modify
110123
* the event before it is sent to Sentry.
@@ -131,17 +144,4 @@ export interface Options {
131144
* @returns The breadcrumb that will be added | null.
132145
*/
133146
beforeBreadcrumb?(breadcrumb: Breadcrumb, hint?: BreadcrumbHint): Breadcrumb | null;
134-
135-
/**
136-
* Controls how many milliseconds to wait before shutting down. The default is
137-
* SDK-specific but typically around 2 seconds. Setting this too low can cause
138-
* problems for sending events from command line applications. Setting it too
139-
* high can cause the application to block for users with network connectivity
140-
* problems.
141-
*/
142-
shutdownTimeout?: number;
143-
144-
_experiments?: {
145-
[key: string]: any;
146-
};
147147
}

packages/types/src/severity.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ export enum Severity {
1515
/** JSDoc */
1616
Critical = 'critical',
1717
}
18-
// tslint:disable:completed-docs
19-
// tslint:disable:no-unnecessary-qualifier no-namespace
18+
19+
// eslint-disable-next-line @typescript-eslint/no-namespace
2020
export namespace Severity {
2121
/**
2222
* Converts a string-based level into a {@link Severity}.

packages/types/src/status.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ export enum Status {
1313
/** A server-side error ocurred during submission. */
1414
Failed = 'failed',
1515
}
16-
// tslint:disable:completed-docs
17-
// tslint:disable:no-unnecessary-qualifier no-namespace
16+
17+
// eslint-disable-next-line @typescript-eslint/no-namespace
1818
export namespace Status {
1919
/**
2020
* Converts a HTTP status code into a {@link Status}.

packages/types/tslint.json

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

0 commit comments

Comments
 (0)