Skip to content

Commit a06b3c7

Browse files
committed
chore: enable noImplicitAny on project-dependencies.js
1 parent ad4f70a commit a06b3c7

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

lib/project-dependencies.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1+
/**
2+
* @import {ElmJson} from './types/content';
3+
* @import {Options} from './types/options';
4+
* @import {VersionString} from './types/version';
5+
*/
6+
17
const ProjectJsonFiles = require('./project-json-files');
28

9+
/**
10+
* @param {Options} options
11+
* @param {ElmJson} elmJson
12+
* @param {VersionString} elmVersion
13+
*/
314
async function collect(options, elmJson, elmVersion) {
415
const dependenciesEntries =
516
elmJson.type === 'application'
@@ -19,7 +30,9 @@ async function collect(options, elmJson, elmVersion) {
1930

2031
const projectDepsPromises = Object.entries(dependenciesEntries).map(
2132
async ([name, constraint]) => {
22-
const packageVersion = constraint.split(' ')[0];
33+
const packageVersion = /** @type {VersionString} */ (
34+
constraint.split(' ')[0]
35+
);
2336

2437
const [docsJson, dependencyElmJson] = await Promise.all([
2538
ProjectJsonFiles.getDocsJson(
@@ -66,6 +79,10 @@ I will try to review the project anyway, but you might get unexpected results…
6679
return projectDeps;
6780
}
6881

82+
/**
83+
* @param {string} name
84+
* @param {VersionString} packageVersion
85+
*/
6986
function defaultElmJson(name, packageVersion) {
7087
return {
7188
type: 'package',

lib/project-json-files.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ function getPackagePathInElmHome(elmVersion, name) {
118118
* @param {Options} options
119119
* @param {VersionString} elmVersion
120120
* @param {string} name
121-
* @param {string} packageVersion
121+
* @param {VersionString} packageVersion
122122
* @returns {Promise<unknown>}
123123
*/
124124
async function getDocsJson(options, elmVersion, name, packageVersion) {

tsconfig.no-implicit-any.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"lib/parse-elm.js",
3030
"lib/parse-elm-worker.js",
3131
"lib/path-helpers.js",
32+
"lib/project-dependencies.js",
3233
"lib/project-json-files.js",
3334
"lib/promisify-port.js",
3435
"lib/report.js",

0 commit comments

Comments
 (0)