A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://typescript-eslint.io/packages/project-service below:

@typescript-eslint/project-service | typescript-eslint

@typescript-eslint/project-service

Standalone TypeScript project service wrapper for linting ✨

The typescript-eslint Project Service is a wrapper around TypeScript's "project service" APIs. These APIs are what editors such as VS Code use to programmatically "open" files and generate TypeScript programs for type information.

import { createProjectService } from '@typescript-eslint/project-service';

const filePathAbsolute = '/path/to/your/project/index.ts';
const { service } = createProjectService();

service.openClientFile(filePathAbsolute);

const scriptInfo = service.getScriptInfo(filePathAbsolute)!;
const program = service
.getDefaultProjectForFile(scriptInfo.fileName, true)!
.getLanguageService(true)
.getProgram()!;

The following documentation is auto-generated from source code.

Functions createProjectService()
function createProjectService(settings): ProjectServiceAndMetadata;

Defined in: createProjectService.ts:93

Creates a new Project Service instance, as well as metadata on its creation.

Parameters Returns

ProjectServiceAndMetadata

A new Project Service instance, as well as metadata on its creation.

Example
import { createProjectService } from '@typescript-eslint/project-service';

const { service } = createProjectService();

service.openClientFile('index.ts');
Interfaces CreateProjectServiceSettings

Defined in: createProjectService.ts:63

Settings to create a new Project Service instance with createProjectService.

Properties ProjectServiceAndMetadata

Defined in: createProjectService.ts:38

A created Project Service instance, as well as metadata on its creation.

Properties Property Type Description Defined in allowDefaultProject undefined | string[] Files allowed to be loaded from the default project, if any were specified. createProjectService.ts:42 lastReloadTimestamp number The performance.now() timestamp of the last reload of the project service. createProjectService.ts:47 maximumDefaultProjectFileMatchCount number The maximum number of files that can be matched by the default project. createProjectService.ts:52 service ProjectService The created TypeScript Project Service instance. createProjectService.ts:57 Type Aliases TypeScriptProjectService
type TypeScriptProjectService = ts.server.ProjectService;

Defined in: createProjectService.ts:33

Shortcut type to refer to TypeScript's server ProjectService.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4