Skip to content

Commit fcbb6cf

Browse files
committed
chore: enable noImplicitAny on init.js
1 parent 5b73827 commit fcbb6cf

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

lib/init.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* @import {Options, Template} from './types/options';
3+
* @import {Path} from './types/path';
4+
*/
5+
16
const path = require('node:path');
27
const fs = require('graceful-fs');
38
// TODO(@lishaduck) [engine:node@>=16.7.0]: Use native `cp`.
@@ -10,6 +15,10 @@ const RemoteTemplate = require('./remote-template');
1015
const {getElmBinary, getElmVersion} = require('./elm-binary');
1116
const TemplateDependencies = require('./template-dependencies');
1217

18+
/**
19+
* @param {Options} options
20+
* @returns {Promise<void>}
21+
*/
1322
async function promptAndCreate(options) {
1423
const directory = options.initPath();
1524

@@ -38,6 +47,11 @@ async function promptAndCreate(options) {
3847
logInit(options, directory);
3948
}
4049

50+
/**
51+
* @param {Options} options
52+
* @param {Template} template
53+
* @param {string} directory
54+
*/
4155
async function createFromTemplate(options, template, directory) {
4256
const configDirectory = path.join(directory, 'src');
4357

@@ -73,6 +87,10 @@ async function createFromTemplate(options, template, directory) {
7387
);
7488
}
7589

90+
/**
91+
* @param {Options} options
92+
* @param {Path} directory
93+
*/
7694
function logInit(options, directory) {
7795
const message = options.template
7896
? templateInitMessage(options, directory)
@@ -96,6 +114,10 @@ ${options.template ? templateRecommendation : ''}`
96114
);
97115
}
98116

117+
/**
118+
* @param {Options} options
119+
* @param {Path} directory
120+
*/
99121
function regularInitMessage(options, directory) {
100122
return `You can now define your review configuration by editing ${chalk.green(
101123
Anonymize.path(options, path.join(directory, 'src/ReviewConfig.elm'))
@@ -104,6 +126,10 @@ function regularInitMessage(options, directory) {
104126

105127
const orange = chalk.keyword('orange');
106128

129+
/**
130+
* @param {Options} options
131+
* @param {Path} directory
132+
*/
107133
function templateInitMessage(options, directory) {
108134
return `You chose to use someone's review configuration which can be great to get started
109135
but don't forget to review the configuration to make sure it fits your needs,
@@ -124,6 +150,11 @@ I recommend you use a mix of the following approaches:
124150
)}).
125151
`;
126152

153+
/**
154+
* @param {Options} options
155+
* @param {Path} directory
156+
* @param {string} template
157+
*/
127158
async function create(options, directory, template) {
128159
const configDirectory = path.join(directory, 'src');
129160

@@ -135,6 +166,10 @@ async function create(options, directory, template) {
135166
createReviewConfig(configDirectory, template);
136167
}
137168

169+
/**
170+
* @param {Options} options
171+
* @param {Path} directory
172+
*/
138173
async function createElmJson(options, directory) {
139174
const elmBinary = await getElmBinary(options);
140175
const elmVersion = getElmVersion(elmBinary);
@@ -149,6 +184,10 @@ async function createElmJson(options, directory) {
149184
);
150185
}
151186

187+
/**
188+
* @param {Path} directory
189+
* @param {string} template
190+
*/
152191
function createReviewConfig(directory, template) {
153192
fsExtra.copyFileSync(
154193
path.join(__dirname, '../init-templates/', template),

tsconfig.no-implicit-any.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@
1818
"lib/elm-binary.js",
1919
"lib/elm-communication.js",
2020
"lib/elm-files.js",
21-
"lib/extra-files.js",
2221
"lib/error-message.js",
22+
"lib/extra-files.js",
2323
"lib/flags.js",
2424
"lib/fs-wrapper.js",
2525
"lib/hash.js",
2626
"lib/help.js",
27+
"lib/init.js",
2728
"lib/load-compiled-app.js",
2829
"lib/min-version.js",
2930
"lib/new-rule.js",

0 commit comments

Comments
 (0)