Skip to content

Commit 894e402

Browse files
committed
remove remaining tslint references
1 parent 7912989 commit 894e402

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+45
-239
lines changed

.eslintrc.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ module.exports = {
8787
'simple-import-sort/sort': 'error',
8888
'sort-imports': 'off',
8989
'import/order': 'off',
90+
91+
// Disallow delete operator. We should make this operation opt in (by disabling this rule).
92+
'@typescript-eslint/no-dynamic-delete': 'error',
93+
94+
// We should prevent against overloads unless necessary.
95+
'@typescript-eslint/unified-signatures': 'error',
9096
},
9197
},
9298
{
@@ -102,6 +108,9 @@ module.exports = {
102108
'error',
103109
{ require: { ClassDeclaration: true, MethodDefinition: true }, checkConstructors: false },
104110
],
111+
112+
// All imports should be accounted for
113+
'import/no-extraneous-dependencies': 'error',
105114
},
106115
},
107116
{
@@ -164,5 +173,8 @@ module.exports = {
164173

165174
// imports should be ordered.
166175
'import/order': ['error', { 'newlines-between': 'always' }],
176+
177+
// Make sure for in loops check for properties
178+
'guard-for-in': 'error',
167179
},
168180
};

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
// See http://go.microsoft.com/fwlink/?LinkId=827846
33
// for the documentation about the extensions.json format
4-
"recommendations": ["esbenp.prettier-vscode", "ms-vscode.vscode-typescript-tslint-plugin", "dbaeumer.vscode-eslint"]
4+
"recommendations": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"]
55
}

.vscode/settings.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"**/dist/": true
1414
},
1515
"typescript.tsdk": "./node_modules/typescript/lib",
16-
"tslint.autoFixOnSave": true,
1716
"[json]": {
1817
"editor.formatOnType": false,
1918
"editor.formatOnPaste": false,

package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
"@types/mocha": "^5.2.0",
4444
"@types/node": "^11.13.7",
4545
"@types/sinon": "^7.0.11",
46-
"@typescript-eslint/eslint-plugin": "^3.7.1",
47-
"@typescript-eslint/parser": "^3.7.1",
46+
"@typescript-eslint/eslint-plugin": "^3.9.0",
47+
"@typescript-eslint/parser": "^3.9.0",
4848
"chai": "^4.1.2",
4949
"codecov": "^3.6.5",
5050
"danger": "^7.1.3",
@@ -68,10 +68,8 @@
6868
"sinon": "^7.3.2",
6969
"size-limit": "^4.5.5",
7070
"ts-jest": "^24.0.2",
71-
"tslint": "5.16.0",
7271
"typedoc": "^0.14.2",
73-
"typescript": "3.4.5",
74-
"typescript-tslint-plugin": "^0.3.1"
72+
"typescript": "3.4.5"
7573
},
7674
"resolutions": {
7775
"**/agent-base": "5"

packages/angular/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
"prettier": "^1.17.0",
3131
"prettier-check": "^2.0.0",
3232
"rimraf": "^2.6.3",
33-
"tslint": "^5.16.0",
3433
"typescript": "^3.5.1"
3534
},
3635
"scripts": {

packages/angular/src/errorhandler.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ class SentryErrorHandler implements AngularErrorHandler {
7878
// Allow custom overrides of extracting function
7979
if (this._options.extractor) {
8080
const defaultExtractor = this._defaultExtractor.bind(this);
81-
// tslint:disable-next-line:no-unsafe-any
8281
return this._options.extractor(error, defaultExtractor);
8382
}
8483

packages/angular/src/tracing.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ export function TraceClassDecorator(): ClassDecorator {
148148

149149
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
150150
return target => {
151-
// tslint:disable-next-line:no-unsafe-any
152151
const originalOnInit = target.prototype.ngOnInit;
153152
// eslint-disable-next-line @typescript-eslint/no-explicit-any
154153
target.prototype.ngOnInit = function(...args: any[]): ReturnType<typeof originalOnInit> {
@@ -171,7 +170,6 @@ export function TraceClassDecorator(): ClassDecorator {
171170
tracingSpan.finish();
172171
}
173172
if (originalAfterViewInit) {
174-
// tslint:disable-next-line:no-unsafe-any
175173
return originalAfterViewInit.apply(this, args);
176174
}
177175
};
@@ -198,7 +196,6 @@ export function TraceMethodDecorator(): MethodDecorator {
198196
});
199197
}
200198
if (originalMethod) {
201-
// tslint:disable-next-line:no-unsafe-any
202199
return originalMethod.apply(this, args);
203200
}
204201
};

packages/apm/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
"rollup-plugin-node-resolve": "^4.2.3",
3737
"rollup-plugin-terser": "^4.0.4",
3838
"rollup-plugin-typescript2": "^0.21.0",
39-
"tslint": "5.16.0",
4039
"typescript": "3.4.5"
4140
},
4241
"scripts": {

packages/apm/src/index.bundle.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,10 @@ export { Span, TRACEPARENT_REGEXP } from './span';
6161
let windowIntegrations = {};
6262

6363
// This block is needed to add compatibility with the integrations packages when used with a CDN
64-
// tslint:disable: no-unsafe-any
6564
const _window = getGlobalObject<Window>();
6665
if (_window.Sentry && _window.Sentry.Integrations) {
6766
windowIntegrations = _window.Sentry.Integrations;
6867
}
69-
// tslint:enable: no-unsafe-any
7068

7169
const INTEGRATIONS = {
7270
...windowIntegrations,

packages/apm/src/integrations/tracing.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ export class Tracing implements Integration {
315315
}
316316
span.finish();
317317
}
318-
// tslint:disable-next-line: no-dynamic-delete
318+
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
319319
delete Tracing._activities[id];
320320
}
321321

@@ -698,7 +698,6 @@ export class Tracing implements Integration {
698698
}
699699

700700
Tracing._performanceCursor = Math.max(performance.getEntries().length - 1, 0);
701-
// tslint:enable: no-unsafe-any
702701
}
703702

704703
/**
@@ -792,7 +791,6 @@ export class Tracing implements Integration {
792791
}
793792
debugData['Date.now()'] = Date.now();
794793
span.setData('sentry_debug', debugData);
795-
// tslint:enable: no-unsafe-any
796794
}
797795

798796
/**
@@ -945,12 +943,10 @@ function xhrCallback(handlerData: { [key: string]: any }): void {
945943
return;
946944
}
947945

948-
// tslint:disable-next-line: no-unsafe-any
949946
if (!handlerData || !handlerData.xhr || !handlerData.xhr.__sentry_xhr__) {
950947
return;
951948
}
952949

953-
// tslint:disable: no-unsafe-any
954950
const xhr = handlerData.xhr.__sentry_xhr__;
955951

956952
if (!Tracing.options.shouldCreateSpanForRequest(xhr.url)) {
@@ -988,15 +984,13 @@ function xhrCallback(handlerData: { [key: string]: any }): void {
988984
}
989985
}
990986
}
991-
// tslint:enable: no-unsafe-any
992987
}
993988

994989
/**
995990
* Creates breadcrumbs from fetch API calls
996991
*/
997992
// eslint-disable-next-line @typescript-eslint/no-explicit-any
998993
function fetchCallback(handlerData: { [key: string]: any }): void {
999-
// tslint:disable: no-unsafe-any
1000994
if (!Tracing.options.traceFetch) {
1001995
return;
1002996
}
@@ -1043,7 +1037,6 @@ function fetchCallback(handlerData: { [key: string]: any }): void {
10431037
}
10441038
}
10451039
}
1046-
// tslint:enable: no-unsafe-any
10471040
}
10481041

10491042
/**

packages/apm/src/integrations/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export interface Location {
9999
*/
100100
reload(): void;
101101
/** @deprecated */
102-
// tslint:disable-next-line: unified-signatures completed-docs
102+
// eslint-disable-next-line @typescript-eslint/unified-signatures
103103
reload(forcedReload: boolean): void;
104104
/**
105105
* Removes the current page from the session history and navigates to the given URL.

packages/apm/src/transaction.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// tslint:disable:max-classes-per-file
21
import { getCurrentHub, Hub } from '@sentry/hub';
32
import { TransactionContext } from '@sentry/types';
43
import { isInstanceOf, logger } from '@sentry/utils';

packages/core/test/lib/base.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ describe('BaseClient', () => {
594594
spanId: '9e15bf99fbe4bc80',
595595
startTimestamp: 1591603196.637835,
596596
traceId: '86f39e84263a4de99c326acab3bfe3bd',
597-
} as any) as Span, // `as any` to bypass linter https://palantir.github.io/tslint/rules/no-object-literal-type-assertion/
597+
} as unknown) as Span,
598598
({
599599
description: 'first-contentful-paint',
600600
endTimestamp: 1591603196.637835,

packages/core/test/tslint.json

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

packages/gatsby/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
"prettier": "^1.17.0",
3939
"prettier-check": "^2.0.0",
4040
"rimraf": "^2.6.3",
41-
"tslint": "5.16.0",
4241
"typescript": "3.4.5"
4342
},
4443
"scripts": {

packages/integrations/src/angular.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,13 @@ export class Angular implements Integration {
5656

5757
this._getCurrentHub = getCurrentHub;
5858

59-
// tslint:disable: no-unsafe-any
6059
this._angular.module(Angular.moduleName, []).config([
6160
'$provide',
6261
// eslint-disable-next-line @typescript-eslint/no-explicit-any
6362
($provide: any): void => {
6463
$provide.decorator('$exceptionHandler', ['$delegate', this._$exceptionHandlerDecorator.bind(this)]);
6564
},
6665
]);
67-
// tslint:enable: no-unsafe-any
6866
}
6967

7068
/**
@@ -106,7 +104,6 @@ export class Angular implements Integration {
106104
hub.captureException(exception);
107105
});
108106
}
109-
// tslint:disable-next-line: no-unsafe-any
110107
$delegate(exception, cause);
111108
};
112109
}

packages/integrations/src/extraerrordata.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ export class ExtraErrorData implements Integration {
8888
if (isError(value)) {
8989
value = (value as Error).toString();
9090
}
91-
// tslint:disable:no-unsafe-any
9291
extraErrorInfo[key] = value;
9392
}
9493
result = extraErrorInfo;

packages/integrations/src/reportingobserver.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ export class ReportingObserver implements Integration {
8383
* @inheritDoc
8484
*/
8585
public setupOnce(_: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {
86-
// tslint:disable:no-unsafe-any
87-
8886
if (!supportsReportingObserver()) {
8987
return;
9088
}
@@ -120,7 +118,7 @@ export class ReportingObserver implements Integration {
120118
[key: string]: any;
121119
} = {};
122120

123-
// tslint:disable-next-line:forin
121+
// eslint-disable-next-line guard-for-in
124122
for (const prop in report.body) {
125123
plainBody[prop] = report.body[prop];
126124
}

packages/integrations/src/vue.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,9 @@ interface ViewModel {
4343
__file?: string;
4444
$_sentryPerfHook?: boolean;
4545
};
46-
$once(hook: string, cb: () => void): void; // tslint:disable-line:completed-docs
46+
$once(hook: string, cb: () => void): void;
4747
}
4848

49-
// tslint:enable:completed-docs
50-
5149
/** Vue Integration configuration */
5250
interface IntegrationOptions {
5351
/** Vue instance to be used inside the integration */
@@ -155,7 +153,7 @@ export class Vue implements Integration {
155153
*/
156154
public constructor(options: Partial<IntegrationOptions>) {
157155
this._options = {
158-
Vue: getGlobalObject<any>().Vue, // tslint:disable-line:no-unsafe-any
156+
Vue: getGlobalObject<any>().Vue,
159157
attachProps: true,
160158
logErrors: false,
161159
tracing: false,
@@ -353,7 +351,6 @@ export class Vue implements Integration {
353351
// eslint-disable-next-line deprecation/deprecation
354352
const tracingIntegration = getCurrentHub().getIntegration(TRACING_GETTER);
355353
if (tracingIntegration) {
356-
// tslint:disable-next-line:no-unsafe-any
357354
(tracingIntegration as any).constructor.popActivity(this._tracingActivity);
358355
}
359356
}
@@ -431,9 +428,7 @@ export class Vue implements Integration {
431428
}
432429
}
433430

434-
// tslint:disable-next-line: completed-docs
435431
interface HubType extends Hub {
436-
// tslint:disable-next-line: completed-docs
437432
getScope?(): Scope | undefined;
438433
}
439434

packages/integrations/test/tslint.json

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

packages/node/src/integrations/modules.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ export class Modules implements Integration {
8686
/** Fetches the list of modules and the versions loaded by the entry file for your node.js app. */
8787
private _getModules(): { [key: string]: string } {
8888
if (!moduleCache) {
89-
// tslint:disable-next-line:no-unsafe-any
9089
moduleCache = collectModules();
9190
}
9291
return moduleCache;

packages/node/src/parsers.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { LRUMap } from 'lru_map';
66
import { NodeOptions } from './backend';
77
import * as stacktrace from './stacktrace';
88

9-
// tslint:disable-next-line:no-unsafe-any
109
const DEFAULT_LINES_OF_CONTEXT: number = 7;
1110
const FILE_CONTENT_CACHE = new LRUMap<string, string | null>(100);
1211

packages/node/src/transports/http.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class HTTPTransport extends BaseTransport {
1212
const proxy = options.httpProxy || process.env.http_proxy;
1313
this.module = http;
1414
this.client = proxy
15-
? (new (require('https-proxy-agent'))(proxy) as http.Agent) // tslint:disable-line:no-unsafe-any
15+
? (new (require('https-proxy-agent'))(proxy) as http.Agent)
1616
: new http.Agent({ keepAlive: false, maxSockets: 30, timeout: 2000 });
1717
}
1818

packages/node/src/transports/https.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class HTTPSTransport extends BaseTransport {
1212
const proxy = options.httpsProxy || options.httpProxy || process.env.https_proxy || process.env.http_proxy;
1313
this.module = https;
1414
this.client = proxy
15-
? (new (require('https-proxy-agent'))(proxy) as https.Agent) // tslint:disable-line:no-unsafe-any
15+
? (new (require('https-proxy-agent'))(proxy) as https.Agent)
1616
: new https.Agent({ keepAlive: false, maxSockets: 30, timeout: 2000 });
1717
}
1818

packages/node/test/stacktrace.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212

1313
import * as stacktrace from '../src/stacktrace';
1414

15-
// tslint:disable:typedef
16-
// tslint:disable:prefer-template
17-
1815
function testBasic() {
1916
return new Error('something went wrong');
2017
}

packages/react/src/errorboundary.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ export type ErrorBoundaryProps = {
1919
* No-op if {@link showDialog} is false.
2020
*/
2121
dialogOptions?: ReportDialogOptions;
22-
// tslint:disable no-null-undefined-union
2322
/**
2423
* A fallback component that gets rendered when the error boundary encounters an error.
2524
*
@@ -29,7 +28,6 @@ export type ErrorBoundaryProps = {
2928
*
3029
*/
3130
fallback?: React.ReactNode | FallbackRender;
32-
// tslint:enable no-null-undefined-union
3331
/** Called with the error boundary encounters an error */
3432
onError?(error: Error, componentStack: string, eventId: string): void;
3533
/** Called on componentDidMount() */

0 commit comments

Comments
 (0)