Skip to content

⬅️ Back to Table of Contents

📄 withoutProjectParserOptions

📊 Analysis Summary

Metric Count
🔧 Functions 1

📚 Table of Contents

🛠️ File Location:

📂 packages/typescript-estree/src/withoutProjectParserOptions.ts

Functions

withoutProjectParserOptions(opts: Options): Omit< Options, 'EXPERIMENTAL_useProjectService' | 'project'…

Removes options that prompt the parser to parse the project with type information. In other words, you can use this if you are invoking the parser directly, to ensure that one file will be parsed in isolation, which is much, much faster.

See: https://github.com/typescript-eslint/typescript-eslint/issues/8428

Raw JSDoc
/**
 * Removes options that prompt the parser to parse the project with type
 * information. In other words, you can use this if you are invoking the parser
 * directly, to ensure that one file will be parsed in isolation, which is much,
 * much faster.
 *
 * @see https://github.com/typescript-eslint/typescript-eslint/issues/8428
 */

Internal Comments:

// eslint-disable-next-line @typescript-eslint/no-unused-vars -- The variables are meant to be omitted (x2)

Code
export function withoutProjectParserOptions<Options extends object>(
  opts: Options,
): Omit<
  Options,
  'EXPERIMENTAL_useProjectService' | 'project' | 'projectService'
> {
  // eslint-disable-next-line @typescript-eslint/no-unused-vars -- The variables are meant to be omitted
  const { EXPERIMENTAL_useProjectService, project, projectService, ...rest } =
    opts as Record<string, unknown>;

  return rest as unknown as Options;
}

Generated by Syntax Scribe