Skip to content

Commit 027c0da

Browse files
committed
fix: update the rest of packageJSON variable typings to IPackageJson
1 parent 87ef56d commit 027c0da

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/configuration.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import * as vscode from "vscode";
55
import * as fs from "node:fs";
66
import * as path from "path";
77
import isWsl from "is-wsl";
8+
import {IPackageJson} from "package-json-type";
89

910
import {Rules} from "./rules";
1011
import {Logger} from "./logger";
@@ -319,7 +320,7 @@ export class Configuration {
319320

320321
// Loop through all installed extensions, including built-in extensions
321322
for (let extension of extensions) {
322-
const packageJSON = extension.packageJSON;
323+
const packageJSON: IPackageJson = extension.packageJSON;
323324

324325
// If an extension package.json has "contributes" key,
325326
// AND the contributes object has "languages" key...
@@ -415,11 +416,11 @@ export class Configuration {
415416
*
416417
* @param {string} extensionsPath The path where extensions are stored.
417418
*
418-
* @returns {Array<{ id: string; extensionPath: string; packageJSON: any }>}
419+
* @returns {Array<{ id: string; extensionPath: string; packageJSON: IPackageJson }>}
419420
*/
420-
private readExtensionsFromDirectory(extensionsPath: string): Array<{id: string; extensionPath: string; packageJSON: any}> {
421+
private readExtensionsFromDirectory(extensionsPath: string): Array<{id: string; extensionPath: string; packageJSON: IPackageJson}> {
421422
// Create an array to hold the found extensions.
422-
const foundExtensions: Array<{id: string; extensionPath: string; packageJSON: any}> = [];
423+
const foundExtensions: Array<{id: string; extensionPath: string; packageJSON: IPackageJson}> = [];
423424

424425
fs.readdirSync(extensionsPath).forEach((extensionName) => {
425426
const extensionPath = path.join(extensionsPath, extensionName);
@@ -436,7 +437,7 @@ export class Configuration {
436437

437438
// If the package.json file exists...
438439
if (fs.existsSync(packageJSONPath)) {
439-
const packageJSON = utils.readJsonFile(packageJSONPath);
440+
const packageJSON: IPackageJson = utils.readJsonFile(packageJSONPath);
440441

441442
const id = `${packageJSON.publisher}.${packageJSON.name}`;
442443

0 commit comments

Comments
 (0)