From 9179d03c9b17ddae4d3e8d5d884a7a90a786be7f Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Tue, 2 Dec 2025 22:27:23 -0500 Subject: [PATCH] test: remove several unused eslint disable directives Several unused eslint directives have been removed from source code files. This is only an initial set with more that could be removed in the future. --- .../build_angular/src/tools/babel/webpack-loader.ts | 1 - .../angular_devkit/core/src/virtual-fs/host/record_spec.ts | 1 - packages/angular_devkit/schematics/src/rules/base_spec.ts | 1 - packages/angular_devkit/schematics/src/rules/call_spec.ts | 1 - packages/angular_devkit/schematics_cli/bin/schematics.ts | 1 - .../ngtools/webpack/src/transformers/replace_resources_spec.ts | 1 - .../jasmine-vitest/test-file-transformer.integration_spec.ts | 2 -- .../refactor/jasmine-vitest/transformers/jasmine-misc_spec.ts | 1 - .../refactor/jasmine-vitest/transformers/jasmine-spy_spec.ts | 3 --- packages/schematics/angular/utility/standalone/rules_spec.ts | 3 --- 10 files changed, 15 deletions(-) diff --git a/packages/angular_devkit/build_angular/src/tools/babel/webpack-loader.ts b/packages/angular_devkit/build_angular/src/tools/babel/webpack-loader.ts index 5be925d2c6b6..8cee4edf4d90 100644 --- a/packages/angular_devkit/build_angular/src/tools/babel/webpack-loader.ts +++ b/packages/angular_devkit/build_angular/src/tools/babel/webpack-loader.ts @@ -36,7 +36,6 @@ let linkerPluginCreator: */ let i18nPluginCreators: I18nPluginCreators | undefined; -// eslint-disable-next-line max-lines-per-function export default custom(() => { const baseOptions = Object.freeze({ babelrc: false, diff --git a/packages/angular_devkit/core/src/virtual-fs/host/record_spec.ts b/packages/angular_devkit/core/src/virtual-fs/host/record_spec.ts index 12debf5d94e4..3927e2a872a1 100644 --- a/packages/angular_devkit/core/src/virtual-fs/host/record_spec.ts +++ b/packages/angular_devkit/core/src/virtual-fs/host/record_spec.ts @@ -6,7 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -/* eslint-disable @typescript-eslint/no-explicit-any */ import { path } from '../path'; import { stringToFileBuffer } from './buffer'; import { CordHost } from './record'; diff --git a/packages/angular_devkit/schematics/src/rules/base_spec.ts b/packages/angular_devkit/schematics/src/rules/base_spec.ts index 09963fd48b1f..9470a55fcdb1 100644 --- a/packages/angular_devkit/schematics/src/rules/base_spec.ts +++ b/packages/angular_devkit/schematics/src/rules/base_spec.ts @@ -6,7 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -/* eslint-disable @typescript-eslint/no-non-null-assertion */ import { Path, virtualFs } from '@angular-devkit/core'; import { lastValueFrom, of as observableOf } from 'rxjs'; import { Rule, SchematicContext, Source } from '../engine/interface'; diff --git a/packages/angular_devkit/schematics/src/rules/call_spec.ts b/packages/angular_devkit/schematics/src/rules/call_spec.ts index ef71747fb2df..f088f03a60b1 100644 --- a/packages/angular_devkit/schematics/src/rules/call_spec.ts +++ b/packages/angular_devkit/schematics/src/rules/call_spec.ts @@ -6,7 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -/* eslint-disable @typescript-eslint/no-non-null-assertion */ /* eslint-disable @typescript-eslint/no-explicit-any */ import { of as observableOf } from 'rxjs'; import { Rule, SchematicContext, Source } from '../engine/interface'; diff --git a/packages/angular_devkit/schematics_cli/bin/schematics.ts b/packages/angular_devkit/schematics_cli/bin/schematics.ts index 8e9779728a77..0905f347d4cc 100644 --- a/packages/angular_devkit/schematics_cli/bin/schematics.ts +++ b/packages/angular_devkit/schematics_cli/bin/schematics.ts @@ -216,7 +216,6 @@ function getPackageManagerName() { return 'npm'; } -// eslint-disable-next-line max-lines-per-function export async function main({ args, stdout = process.stdout, diff --git a/packages/ngtools/webpack/src/transformers/replace_resources_spec.ts b/packages/ngtools/webpack/src/transformers/replace_resources_spec.ts index 102d6e1e0879..8b15f5d55b09 100644 --- a/packages/ngtools/webpack/src/transformers/replace_resources_spec.ts +++ b/packages/ngtools/webpack/src/transformers/replace_resources_spec.ts @@ -28,7 +28,6 @@ function transform( } describe('@ngtools/webpack transformers', () => { - /* eslint-disable max-len */ describe('find_resources', () => { it('should replace resources', () => { const input = tags.stripIndent` diff --git a/packages/schematics/angular/refactor/jasmine-vitest/test-file-transformer.integration_spec.ts b/packages/schematics/angular/refactor/jasmine-vitest/test-file-transformer.integration_spec.ts index 079718212d84..d037ed5c7f08 100644 --- a/packages/schematics/angular/refactor/jasmine-vitest/test-file-transformer.integration_spec.ts +++ b/packages/schematics/angular/refactor/jasmine-vitest/test-file-transformer.integration_spec.ts @@ -464,7 +464,6 @@ describe('Jasmine to Vitest Transformer - Integration Tests', () => { }); `; - /* eslint-disable max-len */ const vitestCode = ` describe('Unsupported Features', () => { beforeAll(() => { @@ -496,7 +495,6 @@ describe('Jasmine to Vitest Transformer - Integration Tests', () => { }); }); `; - /* eslint-enable max-len */ await expectTransformation(jasmineCode, vitestCode); }); diff --git a/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-misc_spec.ts b/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-misc_spec.ts index 4684f7f69d2d..0ce25ccacfd5 100644 --- a/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-misc_spec.ts +++ b/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-misc_spec.ts @@ -132,7 +132,6 @@ describe('Jasmine to Vitest Transformer', () => { return a.toString() === b.toString(); }); `, - // eslint-disable-next-line max-len expected: `// TODO: vitest-migration: jasmine.addCustomEqualityTester is not supported. Please manually migrate to expect.addEqualityTesters(). See: https://vitest.dev/api/expect.html#expect-addequalitytesters jasmine.addCustomEqualityTester((a, b) => { return a.toString() === b.toString(); diff --git a/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-spy_spec.ts b/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-spy_spec.ts index 06e26e606b5c..6c11f776bd3b 100644 --- a/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-spy_spec.ts +++ b/packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-spy_spec.ts @@ -59,7 +59,6 @@ describe('Jasmine to Vitest Transformer', () => { { description: 'should add a TODO for jasmine.spyOnAllFunctions(object)', input: `jasmine.spyOnAllFunctions(myObject);`, - // eslint-disable-next-line max-len expected: `// TODO: vitest-migration: Vitest does not have a direct equivalent for jasmine.spyOnAllFunctions(). Please spy on individual methods manually using vi.spyOn(). See: https://vitest.dev/api/vi.html#vi-spyon jasmine.spyOnAllFunctions(myObject); `, @@ -99,7 +98,6 @@ describe('Jasmine to Vitest Transformer', () => { { description: 'should add a TODO for an unsupported spy strategy', input: `spyOn(service, 'myMethod').and.unknownStrategy();`, - // eslint-disable-next-line max-len expected: `// TODO: vitest-migration: Unsupported spy strategy ".and.unknownStrategy()" found. Please migrate this manually. See: https://vitest.dev/api/mocked.html#mock vi.spyOn(service, 'myMethod').and.unknownStrategy();`, }, @@ -269,7 +267,6 @@ vi.spyOn(service, 'myMethod').and.unknownStrategy();`, { description: 'should add a TODO for spy.calls.mostRecent() without .args', input: `const mostRecent = mySpy.calls.mostRecent();`, - // eslint-disable-next-line max-len expected: `// TODO: vitest-migration: Direct usage of mostRecent() is not supported. Please refactor to access .args directly or use vi.mocked(spy).mock.lastCall. See: https://vitest.dev/api/mocked.html#mock-lastcall const mostRecent = mySpy.calls.mostRecent();`, }, diff --git a/packages/schematics/angular/utility/standalone/rules_spec.ts b/packages/schematics/angular/utility/standalone/rules_spec.ts index da11e0527c11..3208ed0d6f04 100644 --- a/packages/schematics/angular/utility/standalone/rules_spec.ts +++ b/packages/schematics/angular/utility/standalone/rules_spec.ts @@ -354,7 +354,6 @@ describe('standalone utilities', () => { host, ); - // eslint-disable-next-line @typescript-eslint/no-floating-promises await expectAsync(promise).toBeRejectedWithError( `Cannot add provider to invalid bootstrapApplication call in ${mainPath}`, ); @@ -384,7 +383,6 @@ describe('standalone utilities', () => { host, ); - // eslint-disable-next-line @typescript-eslint/no-floating-promises await expectAsync(promise).toBeRejectedWithError( `Cannot statically analyze bootstrapApplication call in ${mainPath}`, ); @@ -402,7 +400,6 @@ describe('standalone utilities', () => { host, ); - // eslint-disable-next-line @typescript-eslint/no-floating-promises await expectAsync(promise).toBeRejectedWithError('Bootstrap call not found'); }); });