Skip to content

Commit 07deca4

Browse files
committed
Merge remote-tracking branch 'remotes/origin/main' into default-value-inline-content
2 parents d77ce2a + 0355420 commit 07deca4

14 files changed

+99
-40
lines changed

common/changes/@microsoft/tsdoc-config/octogonz-missing-changelog_2024-07-25-03-42.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

common/changes/@microsoft/tsdoc/octogonz-missing-changelog_2024-07-25-03-42.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

common/changes/eslint-plugin-tsdoc/octogonz-missing-changelog_2024-07-25-03-42.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

eslint-plugin/CHANGELOG.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,31 @@
11
{
22
"name": "eslint-plugin-tsdoc",
33
"entries": [
4+
{
5+
"version": "0.4.0",
6+
"tag": "eslint-plugin-tsdoc_v0.4.0",
7+
"date": "Sat, 23 Nov 2024 00:23:35 GMT",
8+
"comments": {
9+
"patch": [
10+
{
11+
"comment": "Include CHANGELOG.md in published releases again"
12+
}
13+
],
14+
"minor": [
15+
{
16+
"comment": "Leverage `parserOptions.tsConfigRootDir` to reduce file system probing. This field is commonly used when eslint is configured with `@typescript-eslint/parser`."
17+
}
18+
],
19+
"dependency": [
20+
{
21+
"comment": "Updating dependency \"@microsoft/tsdoc\" to `0.15.1`"
22+
},
23+
{
24+
"comment": "Updating dependency \"@microsoft/tsdoc-config\" to `0.17.1`"
25+
}
26+
]
27+
}
28+
},
429
{
530
"version": "0.3.0",
631
"tag": "eslint-plugin-tsdoc_v0.3.0",

eslint-plugin/CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
# Change Log - eslint-plugin-tsdoc
22

3-
This log was last generated on Tue, 28 May 2024 21:34:19 GMT and should not be manually modified.
3+
This log was last generated on Sat, 23 Nov 2024 00:23:35 GMT and should not be manually modified.
4+
5+
## 0.4.0
6+
Sat, 23 Nov 2024 00:23:35 GMT
7+
8+
### Minor changes
9+
10+
- Leverage `parserOptions.tsConfigRootDir` to reduce file system probing. This field is commonly used when eslint is configured with `@typescript-eslint/parser`.
11+
12+
### Patches
13+
14+
- Include CHANGELOG.md in published releases again
415

516
## 0.3.0
617
Tue, 28 May 2024 21:34:19 GMT

eslint-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-plugin-tsdoc",
3-
"version": "0.3.0",
3+
"version": "0.4.0",
44
"description": "An ESLint plugin that validates TypeScript doc comments",
55
"keywords": [
66
"TypeScript",

eslint-plugin/src/ConfigCache.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const CACHE_MAX_SIZE: number = 100;
2626
export class ConfigCache {
2727
// findConfigPathForFolder() result --> loaded tsdoc.json configuration
2828
private static _cachedConfigs: Map<string, ICachedConfig> = new Map<string, ICachedConfig>();
29+
private static _cachedPaths: Map<string, string> = new Map();
2930

3031
/**
3132
* Node.js equivalent of performance.now().
@@ -35,11 +36,17 @@ export class ConfigCache {
3536
return seconds * 1000 + nanoseconds / 1000000;
3637
}
3738

38-
public static getForSourceFile(sourceFilePath: string): TSDocConfigFile {
39+
public static getForSourceFile(
40+
sourceFilePath: string,
41+
tsConfigRootDir?: string | undefined
42+
): TSDocConfigFile {
3943
const sourceFileFolder: string = path.dirname(path.resolve(sourceFilePath));
4044

4145
// First, determine the file to be loaded. If not found, the configFilePath will be an empty string.
42-
const configFilePath: string = TSDocConfigFile.findConfigPathForFolder(sourceFileFolder);
46+
// If the eslint config has specified where the tsconfig file is, use that path directly without probing the filesystem.
47+
const configFilePath: string = tsConfigRootDir
48+
? path.join(tsConfigRootDir, TSDocConfigFile.FILENAME)
49+
: TSDocConfigFile.findConfigPathForFolder(sourceFileFolder);
4350

4451
// If configFilePath is an empty string, then we'll use the folder of sourceFilePath as our cache key
4552
// (instead of an empty string)

eslint-plugin/src/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,16 @@ const plugin: IPlugin = {
4141
}
4242
},
4343
create: (context: eslint.Rule.RuleContext) => {
44-
const sourceFilePath: string = context.getFilename();
44+
const sourceFilePath: string = context.filename;
45+
// If eslint is configured with @typescript-eslint/parser, there is a parser option
46+
// to explicitly specify where the tsconfig file is. Use that if available.
47+
const tsConfigDir: string | undefined = context.parserOptions.tsconfigRootDir;
4548
Debug.log(`Linting: "${sourceFilePath}"`);
4649

4750
const tsdocConfiguration: TSDocConfiguration = new TSDocConfiguration();
4851

4952
try {
50-
const tsdocConfigFile: TSDocConfigFile = ConfigCache.getForSourceFile(sourceFilePath);
53+
const tsdocConfigFile: TSDocConfigFile = ConfigCache.getForSourceFile(sourceFilePath, tsConfigDir);
5154
if (!tsdocConfigFile.fileNotFound) {
5255
if (tsdocConfigFile.hasErrors) {
5356
context.report({

tsdoc-config/CHANGELOG.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
{
22
"name": "@microsoft/tsdoc-config",
33
"entries": [
4+
{
5+
"version": "0.17.1",
6+
"tag": "@microsoft/tsdoc-config_v0.17.1",
7+
"date": "Sat, 23 Nov 2024 00:23:35 GMT",
8+
"comments": {
9+
"patch": [
10+
{
11+
"comment": "Include CHANGELOG.md in published releases again"
12+
}
13+
],
14+
"dependency": [
15+
{
16+
"comment": "Updating dependency \"@microsoft/tsdoc\" to `0.15.1`"
17+
}
18+
]
19+
}
20+
},
421
{
522
"version": "0.17.0",
623
"tag": "@microsoft/tsdoc-config_v0.17.0",

tsdoc-config/CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# Change Log - @microsoft/tsdoc-config
22

3-
This log was last generated on Tue, 28 May 2024 21:34:19 GMT and should not be manually modified.
3+
This log was last generated on Sat, 23 Nov 2024 00:23:35 GMT and should not be manually modified.
4+
5+
## 0.17.1
6+
Sat, 23 Nov 2024 00:23:35 GMT
7+
8+
### Patches
9+
10+
- Include CHANGELOG.md in published releases again
411

512
## 0.17.0
613
Tue, 28 May 2024 21:34:19 GMT

tsdoc-config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@microsoft/tsdoc-config",
3-
"version": "0.17.0",
3+
"version": "0.17.1",
44
"description": "A loader for the tsdoc.json file",
55
"keywords": [
66
"TypeScript",

tsdoc/CHANGELOG.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
{
22
"name": "@microsoft/tsdoc",
33
"entries": [
4+
{
5+
"version": "0.15.1",
6+
"tag": "@microsoft/tsdoc_v0.15.1",
7+
"date": "Sat, 23 Nov 2024 00:23:35 GMT",
8+
"comments": {
9+
"patch": [
10+
{
11+
"comment": "Include CHANGELOG.md in published releases again"
12+
}
13+
]
14+
}
15+
},
416
{
517
"version": "0.15.0",
618
"tag": "@microsoft/tsdoc_v0.15.0",

tsdoc/CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# Change Log - @microsoft/tsdoc
22

3-
This log was last generated on Tue, 28 May 2024 21:34:19 GMT and should not be manually modified.
3+
This log was last generated on Sat, 23 Nov 2024 00:23:35 GMT and should not be manually modified.
4+
5+
## 0.15.1
6+
Sat, 23 Nov 2024 00:23:35 GMT
7+
8+
### Patches
9+
10+
- Include CHANGELOG.md in published releases again
411

512
## 0.15.0
613
Tue, 28 May 2024 21:34:19 GMT

tsdoc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@microsoft/tsdoc",
3-
"version": "0.15.0",
3+
"version": "0.15.1",
44
"description": "A parser for the TypeScript doc comment syntax",
55
"keywords": [
66
"TypeScript",

0 commit comments

Comments
 (0)