Skip to content

Commit f3bc92b

Browse files
johnsoncodehkthePunderWoman
authored andcommitted
refactor: remove unnecessary TSLint rule flags (#59365)
There are many TSLint rule flags in the source code that have no effect, and they can be safely removed to keep the code clean. PR Close #59365
1 parent 6d00efd commit f3bc92b

File tree

37 files changed

+3
-84
lines changed

37 files changed

+3
-84
lines changed

adev/shared-docs/components/viewers/docs-viewer/docs-viewer.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ export class DocViewer implements OnChanges {
7979
private readonly injector = inject(Injector);
8080
private readonly appRef = inject(ApplicationRef);
8181

82-
// tslint:disable-next-line:no-unused-variable
8382
private animateContent = false;
8483
private readonly pendingTasks = inject(PendingTasks);
8584

adev/src/app/editor/code-editor/code-mirror-editor.service.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ export class CodeMirrorEditor {
220220
if (!this.currentFile().filename.endsWith('.ts')) return;
221221

222222
this.tsVfsWorker.postMessage(request);
223-
// tslint:disable-next-line:semicolon
224223
};
225224

226225
private getVfsEnvFileSystemMap(): Map<string, string> {

adev/src/app/features/home/services/home-animation.service.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,7 @@ export class HomeAnimation {
491491

492492
this.canvas.update(time, deltaTime, frame, this.progress);
493493
// TODO: add support for class fields arrow function
494-
// Using disable-next-line to avoid tslint errors - An arrow function is required for binding to the listener
495-
// tslint:disable-next-line:semicolon
494+
// An arrow function is required for binding to the listener
496495
};
497496

498497
/**

devtools/projects/demo-standalone/src/app/devtools-app/devtools-app.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import {FrameManager} from '../../../../../projects/ng-devtools/src/lib/frame_ma
2424
new IFrameMessageBus(
2525
'angular-devtools',
2626
'angular-devtools-backend',
27-
// tslint:disable-next-line: no-non-null-assertion
2827
() => (document.querySelector('#sample-app') as HTMLIFrameElement).contentWindow!,
2928
),
3029
);

devtools/projects/ng-devtools-backend/src/lib/component-tree.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,6 @@ const getRootLViewsHelper = (element: Element, rootLViews = new Set<any>()): Set
490490
rootLViews.add(lView);
491491
return rootLViews;
492492
}
493-
// tslint:disable-next-line: prefer-for-of
494493
for (let i = 0; i < element.children.length; i++) {
495494
getRootLViewsHelper(element.children[i], rootLViews);
496495
}

devtools/projects/ng-devtools/src/lib/devtools-tabs/diffing/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
* found in the LICENSE file at https://angular.dev/license
77
*/
88

9-
// tslint:disable-next-line:deprecation
109
import {DefaultIterableDiffer} from '@angular/core';
1110

1211
export interface MovedRecord {
@@ -56,7 +55,6 @@ export const diff = <T>(
5655
(a[record.currentIndex] as any)[prop] = (b[record.currentIndex] as any)[prop];
5756
});
5857
if (!alreadySet[record.previousIndex]) {
59-
// tslint:disable-next-line: no-non-null-assertion
6058
a[record.previousIndex] = null!;
6159
}
6260
alreadySet[record.currentIndex] = true;
@@ -79,7 +77,6 @@ export const diff = <T>(
7977
return;
8078
}
8179
if (record.currentIndex === null && !alreadySet[record.previousIndex]) {
82-
// tslint:disable-next-line: no-non-null-assertion
8380
a[record.previousIndex] = null!;
8481
}
8582
removedItems.push(record.item);

devtools/projects/ng-devtools/src/lib/devtools-tabs/directive-explorer/property-resolver/element-property-resolver.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ describe('ElementPropertyResolver', () => {
110110
});
111111
const fooController = resolver.getDirectiveController('FooCmp');
112112
expect(fooController).toBeTruthy();
113-
// tslint:disable-next-line: no-non-null-assertion
114113
const fooProps = fooController!.getExpandedProperties();
115114
expect(fooProps).toEqual([
116115
{
@@ -130,7 +129,6 @@ describe('ElementPropertyResolver', () => {
130129

131130
const barController = resolver.getDirectiveController('BarDir');
132131
expect(barController).toBeTruthy();
133-
// tslint:disable-next-line: no-non-null-assertion
134132
const barProps = barController!.getExpandedProperties();
135133
expect(barProps).toEqual([
136134
{

devtools/projects/protocol/src/lib/priority-aware-message-bus.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ export class PriorityAwareMessageBus extends MessageBus<Events> {
8383
if (blockedBy) {
8484
// The source code here is safe.
8585
// TypeScript type inference ignores the null check here.
86-
// tslint:disable-next-line: no-non-null-assertion
8786
for (const blocker of blockedBy!) {
8887
if (this._inProgress[blocker]) {
8988
return false;

devtools/src/app/devtools-app/devtools-app.routes.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ export const DEVTOOL_ROUTES: Routes = [
2626
new IFrameMessageBus(
2727
'angular-devtools',
2828
'angular-devtools-backend',
29-
// tslint:disable-next-line: no-non-null-assertion
3029
() => (document.querySelector('#sample-app') as HTMLIFrameElement).contentWindow!,
3130
),
3231
);

modules/benchmarks/src/util.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
* found in the LICENSE file at https://angular.dev/license
77
*/
88

9-
/* tslint:disable:no-console */
109
urlParamsToForm();
1110

1211
export function getIntParameter(name: string) {

0 commit comments

Comments
 (0)