Add lint rule for as any and bulk ignore all existing breaks

For #269213

This adds a new eslint rule for `as any` and `<any>({... })`. We'd like to remove almost all of these, however right now the first goal is to prevent them in new code. That's why with this first PR I simply add `eslint-disable` comments for all breaks

Trying to get this change in soon after branching off for release to hopefully minimize disruption during debt week work
This commit is contained in:
Matt Bierner
2025-10-02 23:38:33 -07:00
parent 96aa43fe7a
commit 360c9fd134
465 changed files with 1188 additions and 0 deletions

View File

@@ -8,6 +8,7 @@ import cdSpec from '../../completions/cd';
import { testPaths, type ISuiteSpec } from '../helpers';
const expectedCompletions = ['-'];
// eslint-disable-next-line local/code-no-any-casts
const cdExpectedCompletions = [{ label: 'cd', description: (cdSpec as any).description }];
export const cdTestSuiteSpec: ISuiteSpec = {
name: 'cd',

View File

@@ -77,6 +77,7 @@ export function createCodeTestSpecs(executable: string): ITestSpec[] {
const typingTests: ITestSpec[] = [];
for (let i = 1; i < executable.length; i++) {
// eslint-disable-next-line local/code-no-any-casts
const expectedCompletions = [{ label: executable, description: executable === codeCompletionSpec.name ? (codeCompletionSpec as any).description : (codeInsidersCompletionSpec as any).description }];
const input = `${executable.slice(0, i)}|`;
typingTests.push({ input, expectedCompletions, expectedResourceRequests: input.endsWith(' ') ? undefined : { type: 'both', cwd: testPaths.cwd } });
@@ -265,6 +266,7 @@ export function createCodeTunnelTestSpecs(executable: string): ITestSpec[] {
const typingTests: ITestSpec[] = [];
for (let i = 1; i < executable.length; i++) {
// eslint-disable-next-line local/code-no-any-casts
const expectedCompletions = [{ label: executable, description: executable === codeCompletionSpec.name || executable === codeTunnelCompletionSpec.name ? (codeCompletionSpec as any).description : (codeInsidersCompletionSpec as any).description }];
const input = `${executable.slice(0, i)}|`;
typingTests.push({ input, expectedCompletions, expectedResourceRequests: input.endsWith(' ') ? undefined : { type: 'both', cwd: testPaths.cwd } });

View File

@@ -12,6 +12,7 @@ const allOptions = [
'-e',
'-n',
];
// eslint-disable-next-line local/code-no-any-casts
const echoExpectedCompletions = [{ label: 'echo', description: (echoSpec as any).description }];
export const echoTestSuiteSpec: ISuiteSpec = {
name: 'echo',

View File

@@ -11,6 +11,7 @@ import gitSpec from '../../../completions/git';
// const gitCommitArgs = ['--', '--all', '--allow-empty', '--allow-empty-message', '--amend', '--author', '--branch', '--cleanup', '--date', '--dry-run', '--edit', '--file', '--fixup', '--gpg-sign', '--include', '--long', '--message', '--no-edit', '--no-gpg-sign', '--no-post-rewrite', '--no-signoff', '--no-status', '--no-verify', '--null', '--only', '--patch', '--pathspec-file-nul', '--pathspec-from-file', '--porcelain', '--quiet', '--reedit-message', '--reset-author', '--reuse-message', '--short', '--signoff', '--squash', '--status', '--template', '--untracked-files', '--verbose', '-C', '-F', '-S', '-a', '-am', '-c', '-e', '-i', '-m', '-n', '-o', '-p', '-q', '-s', '-t', '-u', '-v', '-z'];
// const gitMergeArgs = ['-', '--abort', '--allow-unrelated-histories', '--autostash', '--cleanup', '--commit', '--continue', '--edit', '--ff', '--ff-only', '--file', '--gpg-sign', '--log', '--no-autostash', '--no-commit', '--no-edit', '--no-ff', '--no-gpg-sign', '--no-log', '--no-overwrite-ignore', '--no-progress', '--no-rerere-autoupdate', '--no-signoff', '--no-squash', '--no-stat', '--no-summary', '--no-verify', '--no-verify-signatures', '--overwrite-ignore', '--progress', '--quiet', '--quit', '--rerere-autoupdate', '--signoff', '--squash', '--stat', '--strategy', '--strategy-option', '--summary', '--verbose', '--verify-signatures', '-F', '-S', '-X', '-e', '-m', '-n', '-q', '-s'];
// const gitAddArgs = ['--', '--all', '--chmod', '--dry-run', '--edit', '--force', '--ignore-errors', '--ignore-missing', '--ignore-removal', '--intent-to-add', '--interactive', '--no-all', '--no-ignore-removal', '--no-warn-embedded-repo', '--patch', '--pathspec-file-nul', '--pathspec-from-file', '--refresh', '--renormalize', '--update', '--verbose', '-A', '-N', '-e', '-f', '-i', '-n', '-p', '-u', '-v'];
// eslint-disable-next-line local/code-no-any-casts
const expectedCompletions = [{ label: 'git', description: (gitSpec as any).description }];
export const gitTestSuiteSpec: ISuiteSpec = {

View File

@@ -51,6 +51,7 @@ const allOptions = [
'-w',
'-x',
];
// eslint-disable-next-line local/code-no-any-casts
const expectedCompletions = [{ label: 'ls', description: (lsSpec as any).description }];
export const lsTestSuiteSpec: ISuiteSpec = {
name: 'ls',

View File

@@ -19,6 +19,7 @@ const allOptions = [
'-p',
'-v',
];
// eslint-disable-next-line local/code-no-any-casts
const expectedCompletions = [{ label: 'mkdir', description: (mkdirSpec as any).description }];
export const mkdirTestSuiteSpec: ISuiteSpec = {
name: 'mkdir',

View File

@@ -16,6 +16,7 @@ const allOptions = [
'-r',
'-v',
];
// eslint-disable-next-line local/code-no-any-casts
const expectedCompletions = [{ label: 'rm', description: (rmSpec as any).description }];
export const rmTestSuiteSpec: ISuiteSpec = {
name: 'rm',

View File

@@ -10,6 +10,7 @@ import rmdirSpec from '../../../completions/upstream/rmdir';
const allOptions = [
'-p',
];
// eslint-disable-next-line local/code-no-any-casts
const expectedCompletions = [{ label: 'rmdir', description: (rmdirSpec as any).description }];
export const rmdirTestSuiteSpec: ISuiteSpec = {

View File

@@ -17,6 +17,7 @@ const allOptions = [
'-r <file>',
'-t <timestamp>',
];
// eslint-disable-next-line local/code-no-any-casts
const expectedCompletions = [{ label: 'touch', description: (touchSpec as any).description }];
export const touchTestSuiteSpec: ISuiteSpec = {