Skip to content

Commit 0993c01

Browse files
authored
Fix JSDoc eslint rule for properties and methods (microsoft#51462)
1 parent d237468 commit 0993c01

File tree

5 files changed

+65
-31
lines changed

5 files changed

+65
-31
lines changed

scripts/eslint/rules/jsdoc-format.cjs

+2
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@ module.exports = createRule({
172172
TSIndexSignature: checkDeclaration,
173173
TSMethodSignature: checkDeclaration,
174174
TSParameterProperty: checkDeclaration,
175+
PropertyDefinition: checkDeclaration,
176+
MethodDefinition: checkDeclaration,
175177
};
176178
},
177179
});

src/server/editorServices.ts

+28-13
Original file line numberDiff line numberDiff line change
@@ -718,8 +718,9 @@ export class ProjectService {
718718

719719
/**
720720
* Container of all known scripts
721+
*
722+
* @internal
721723
*/
722-
/** @internal */
723724
readonly filenameToScriptInfo = new Map<string, ScriptInfo>();
724725
private readonly nodeModulesWatchers = new Map<string, NodeModulesWatcher>();
725726
/**
@@ -733,8 +734,9 @@ export class ProjectService {
733734

734735
/**
735736
* Map to the real path of the infos
737+
*
738+
* @internal
736739
*/
737-
/** @internal */
738740
readonly realpathToScriptInfos: MultiMap<Path, ScriptInfo> | undefined;
739741
/**
740742
* maps external project file name to list of config files that were the part of this project
@@ -786,8 +788,11 @@ export class ProjectService {
786788
* In this case the exists could be true/false based on config file is present or not
787789
* - Or it is present if we have configured project open with config file at that location
788790
* In this case the exists property is always true
791+
*
792+
*
793+
* @internal
789794
*/
790-
/** @internal */ readonly configFileExistenceInfoCache = new Map<NormalizedPath, ConfigFileExistenceInfo>();
795+
readonly configFileExistenceInfoCache = new Map<NormalizedPath, ConfigFileExistenceInfo>();
791796
/** @internal */ readonly throttledOperations: ThrottledOperations;
792797

793798
private readonly hostConfiguration: HostConfiguration;
@@ -1344,8 +1349,9 @@ export class ProjectService {
13441349

13451350
/**
13461351
* This is to watch whenever files are added or removed to the wildcard directories
1352+
*
1353+
* @internal
13471354
*/
1348-
/** @internal */
13491355
private watchWildcardDirectory(directory: Path, flags: WatchDirectoryFlags, configFileName: NormalizedPath, config: ParsedConfig) {
13501356
return this.watchFactory.watchDirectory(
13511357
directory,
@@ -1774,8 +1780,9 @@ export class ProjectService {
17741780
/**
17751781
* Close the config file watcher in the cached ConfigFileExistenceInfo
17761782
* if there arent any open files that are root of inferred project and there is no parsed config held by any project
1783+
*
1784+
* @internal
17771785
*/
1778-
/** @internal */
17791786
private closeConfigFileWatcherOnReleaseOfOpenFile(configFileExistenceInfo: ConfigFileExistenceInfo) {
17801787
// Close the config file watcher if there are no more open files that are root of inferred project
17811788
// or if there are no projects that need to watch this config file existence info
@@ -1822,8 +1829,9 @@ export class ProjectService {
18221829

18231830
/**
18241831
* This is called by inferred project whenever script info is added as a root
1832+
*
1833+
* @internal
18251834
*/
1826-
/** @internal */
18271835
startWatchingConfigFilesForInferredProjectRoot(info: ScriptInfo) {
18281836
Debug.assert(info.isScriptOpen());
18291837
this.forEachConfigFileLocation(info, (canonicalConfigFilePath, configFileName) => {
@@ -1852,8 +1860,9 @@ export class ProjectService {
18521860

18531861
/**
18541862
* This is called by inferred project whenever root script info is removed from it
1863+
*
1864+
* @internal
18551865
*/
1856-
/** @internal */
18571866
stopWatchingConfigFilesForInferredProjectRoot(info: ScriptInfo) {
18581867
this.forEachConfigFileLocation(info, canonicalConfigFilePath => {
18591868
const configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath);
@@ -2168,8 +2177,9 @@ export class ProjectService {
21682177

21692178
/**
21702179
* Read the config file of the project, and update the project root file names.
2180+
*
2181+
* @internal
21712182
*/
2172-
/** @internal */
21732183
private loadConfiguredProject(project: ConfiguredProject, reason: string) {
21742184
tracing?.push(tracing.Phase.Session, "loadConfiguredProject", { configFilePath: project.canonicalConfigFilePath });
21752185
this.sendProjectLoadingStartEvent(project, reason);
@@ -2434,8 +2444,9 @@ export class ProjectService {
24342444

24352445
/**
24362446
* Reload the file names from config file specs and update the project graph
2447+
*
2448+
* @internal
24372449
*/
2438-
/** @internal */
24392450
reloadFileNamesOfConfiguredProject(project: ConfiguredProject) {
24402451
const fileNames = this.reloadFileNamesOfParsedConfig(project.getConfigFilePath(), this.configFileExistenceInfoCache.get(project.canonicalConfigFilePath)!.config!);
24412452
project.updateErrorOnNoInputFiles(fileNames);
@@ -2466,8 +2477,9 @@ export class ProjectService {
24662477

24672478
/**
24682479
* Read the config file of the project again by clearing the cache and update the project graph
2480+
*
2481+
* @internal
24692482
*/
2470-
/** @internal */
24712483
reloadConfiguredProject(project: ConfiguredProject, reason: string, isInitialLoad: boolean, clearSemanticCache: boolean) {
24722484
// At this point, there is no reason to not have configFile in the host
24732485
const host = project.getCachedDirectoryStructureHost();
@@ -2632,8 +2644,9 @@ export class ProjectService {
26322644
/**
26332645
* Returns the projects that contain script info through SymLink
26342646
* Note that this does not return projects in info.containingProjects
2647+
*
2648+
* @internal
26352649
*/
2636-
/** @internal */
26372650
getSymlinkedProjects(info: ScriptInfo): MultiMap<Path, Project> | undefined {
26382651
let projects: MultiMap<Path, Project> | undefined;
26392652
if (this.realpathToScriptInfos) {
@@ -4149,8 +4162,9 @@ export class ProjectService {
41494162

41504163
/**
41514164
* Waits for any ongoing plugin enablement requests to complete.
4165+
*
4166+
* @internal
41524167
*/
4153-
/** @internal */
41544168
async waitForPendingPlugins() {
41554169
while (this.currentPluginEnablementPromise) {
41564170
await this.currentPluginEnablementPromise;
@@ -4159,8 +4173,9 @@ export class ProjectService {
41594173

41604174
/**
41614175
* Starts enabling any requested plugins without waiting for the result.
4176+
*
4177+
* @internal
41624178
*/
4163-
/** @internal */
41644179
enableRequestedPlugins() {
41654180
if (this.pendingPluginEnablements) {
41664181
void this.enableRequestedPluginsAsync();

src/server/project.ts

+30-14
Original file line numberDiff line numberDiff line change
@@ -175,14 +175,15 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo
175175
private missingFilesMap: ESMap<Path, FileWatcher> | undefined;
176176
private generatedFilesMap: GeneratedFileWatcherMap | undefined;
177177

178-
/*@internal*/
178+
/** @internal */
179179
protected readonly plugins: PluginModuleWithName[] = [];
180180

181-
/** @internal */
182181
/**
183182
* This is map from files to unresolved imports in it
184183
* Maop does not contain entries for files that do not have unresolved imports
185184
* This helps in containing the set of files to invalidate
185+
*
186+
* @internal
186187
*/
187188
cachedUnresolvedImportsPerFile = new Map<Path, readonly string[]>();
188189

@@ -1642,7 +1643,7 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo
16421643
return !!this.program && this.program.isSourceOfProjectReferenceRedirect(fileName);
16431644
}
16441645

1645-
/*@internal*/
1646+
/** @internal */
16461647
protected getGlobalPluginSearchPaths() {
16471648
// Search any globally-specified probe paths, then our peer node_modules
16481649
return [
@@ -1679,8 +1680,9 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo
16791680

16801681
/**
16811682
* Performs the initial steps of enabling a plugin by finding and instantiating the module for a plugin synchronously using 'require'.
1683+
*
1684+
* @internal
16821685
*/
1683-
/** @internal */
16841686
beginEnablePluginSync(pluginConfigEntry: PluginImport, searchPaths: string[], pluginConfigOverrides: Map<any> | undefined): BeginEnablePluginResult {
16851687
Debug.assertIsDefined(this.projectService.host.require);
16861688

@@ -1696,8 +1698,9 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo
16961698

16971699
/**
16981700
* Performs the initial steps of enabling a plugin by finding and instantiating the module for a plugin asynchronously using dynamic `import`.
1701+
*
1702+
* @internal
16991703
*/
1700-
/** @internal */
17011704
async beginEnablePluginAsync(pluginConfigEntry: PluginImport, searchPaths: string[], pluginConfigOverrides: Map<any> | undefined): Promise<BeginEnablePluginResult> {
17021705
Debug.assertIsDefined(this.projectService.host.importPlugin);
17031706

@@ -1719,8 +1722,9 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo
17191722

17201723
/**
17211724
* Performs the remaining steps of enabling a plugin after its module has been instantiated.
1725+
*
1726+
* @internal
17221727
*/
1723-
/** @internal */
17241728
endEnablePlugin({ pluginConfigEntry, pluginConfigOverrides, resolvedModule, errorLogs }: BeginEnablePluginResult) {
17251729
if (resolvedModule) {
17261730
const configurationOverride = pluginConfigOverrides && pluginConfigOverrides.get(pluginConfigEntry.name);
@@ -2015,8 +2019,11 @@ export class InferredProject extends Project {
20152019
/** this is canonical project root path */
20162020
readonly projectRootPath: string | undefined;
20172021

2018-
/** @internal */
2019-
/** stored only if their is no projectRootPath and this isnt single inferred project */
2022+
/**
2023+
* stored only if their is no projectRootPath and this isnt single inferred project
2024+
*
2025+
* @internal
2026+
*/
20202027
readonly canonicalCurrentDirectory: string | undefined;
20212028

20222029
/** @internal */
@@ -2412,8 +2419,11 @@ export class ConfiguredProject extends Project {
24122419

24132420
private projectReferences: readonly ProjectReference[] | undefined;
24142421

2415-
/** Potential project references before the project is actually loaded (read config file) */
2416-
/** @internal */
2422+
/**
2423+
* Potential project references before the project is actually loaded (read config file)
2424+
*
2425+
* @internal
2426+
*/
24172427
potentialProjectReferences: Set<string> | undefined;
24182428

24192429
/** @internal */
@@ -2630,8 +2640,11 @@ export class ConfiguredProject extends Project {
26302640
!this.canConfigFileJsonReportNoInputFiles;
26312641
}
26322642

2633-
/** @internal */
2634-
/** Find the configured project from the project references in project which contains the info directly */
2643+
/**
2644+
* Find the configured project from the project references in project which contains the info directly
2645+
*
2646+
* @internal
2647+
*/
26352648
getDefaultChildProjectFromProjectWithReferences(info: ScriptInfo) {
26362649
return forEachResolvedProjectReferenceProject(
26372650
this,
@@ -2643,8 +2656,11 @@ export class ConfiguredProject extends Project {
26432656
);
26442657
}
26452658

2646-
/** Returns true if the project is needed by any of the open script info/external project */
2647-
/** @internal */
2659+
/**
2660+
* Returns true if the project is needed by any of the open script info/external project
2661+
*
2662+
* @internal
2663+
*/
26482664
hasOpenRef() {
26492665
if (!!this.externalProjectRefCount) {
26502666
return true;

src/server/scriptInfo.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,11 @@ export class ScriptInfo {
317317
/** @internal */
318318
readonly isDynamic: boolean;
319319

320-
/** @internal */
321-
/** Set to real path if path is different from info.path */
320+
/**
321+
* Set to real path if path is different from info.path
322+
*
323+
* @internal
324+
*/
322325
private realpath: Path | undefined;
323326

324327
/** @internal */

tests/baselines/reference/api/tsserverlibrary.d.ts

-2
Original file line numberDiff line numberDiff line change
@@ -3127,7 +3127,6 @@ declare namespace ts {
31273127
private externalFiles;
31283128
private missingFilesMap;
31293129
private generatedFilesMap;
3130-
protected readonly plugins: PluginModuleWithName[];
31313130
protected languageService: LanguageService;
31323131
languageServiceEnabled: boolean;
31333132
readonly trace?: (s: string) => void;
@@ -3252,7 +3251,6 @@ declare namespace ts {
32523251
setTypeAcquisition(newTypeAcquisition: TypeAcquisition | undefined): void;
32533252
getTypeAcquisition(): ts.TypeAcquisition;
32543253
protected removeRoot(info: ScriptInfo): void;
3255-
protected getGlobalPluginSearchPaths(): string[];
32563254
protected enableGlobalPlugins(options: CompilerOptions, pluginConfigOverrides: Map<any> | undefined): void;
32573255
protected enablePlugin(pluginConfigEntry: PluginImport, searchPaths: string[], pluginConfigOverrides: Map<any> | undefined): void;
32583256
private enableProxy;

0 commit comments

Comments
 (0)