Skip to content

Commit 04ffeb4

Browse files
clean up some ts-ignore comments
1 parent 7c535a9 commit 04ffeb4

File tree

3 files changed

+15
-21
lines changed

3 files changed

+15
-21
lines changed

src/cli/domain/handle-dependencies/index.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,9 @@ export default function handleDependencies(
126126
};
127127
const options = { dependencies, logger };
128128
if (useComponentDependencies) {
129-
// @ts-ignore
130-
options.componentPath = components[0];
131-
return linkMissingDependencies(options as any, err =>
132-
callback(err, result)
129+
return linkMissingDependencies(
130+
{ ...options, componentPath: components[0] },
131+
err => callback(err, result)
133132
);
134133
}
135134
installMissingDependencies(options, err => callback(err, result));

src/cli/domain/init-template/install-template.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,13 @@ export default function installTemplate(
3030
npm.installDependency(npmOptions, (err, result) => {
3131
const errorMessage = 'template type not valid';
3232
if (err) {
33-
// @ts-ignore
34-
return callback(errorMessage);
33+
return callback(errorMessage, undefined as any);
3534
}
3635

3736
const installedCompiler = tryRequire(result.dest);
3837

3938
if (!isTemplateValid(installedCompiler, { compiler: true })) {
40-
// @ts-ignore
41-
return callback(errorMessage);
39+
return callback(errorMessage, undefined as any);
4240
}
4341
const version = installedCompiler.getInfo().version;
4442
logger.log(

src/registry/routes/publish.ts

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,38 +18,35 @@ export default function publish(repository: Repository) {
1818
return;
1919
}
2020

21-
let validationResult = validator.validateOcCliVersion(
21+
const ocCliValidationResult = validator.validateOcCliVersion(
2222
req.headers['user-agent']
2323
);
24-
if (!validationResult.isValid) {
24+
if (!ocCliValidationResult.isValid) {
2525
res.errorDetails = strings.errors.registry.OC_CLI_VERSION_IS_NOT_VALID(
26-
validationResult.error.registryVersion,
27-
validationResult.error.cliVersion
26+
ocCliValidationResult.error.registryVersion,
27+
ocCliValidationResult.error.cliVersion
2828
);
2929
res.status(409).json({
3030
code: 'cli_version_not_valid',
3131
error: res.errorDetails,
32-
details: validationResult.error
32+
details: ocCliValidationResult.error
3333
});
3434
return;
3535
}
3636

37-
// @ts-ignore
38-
validationResult = validator.validateNodeVersion(
37+
const nodeValidationResult = validator.validateNodeVersion(
3938
req.headers['user-agent'],
4039
process.version
4140
);
42-
if (!validationResult.isValid) {
41+
if (!nodeValidationResult.isValid) {
4342
res.errorDetails = strings.errors.registry.NODE_CLI_VERSION_IS_NOT_VALID(
44-
// @ts-ignore
45-
validationResult.error.registryNodeVersion,
46-
// @ts-ignore
47-
validationResult.error.cliNodeVersion
43+
nodeValidationResult.error.registryNodeVersion,
44+
nodeValidationResult.error.cliNodeVersion
4845
);
4946
res.status(409).json({
5047
code: 'node_version_not_valid',
5148
error: res.errorDetails,
52-
details: validationResult.error
49+
details: nodeValidationResult.error
5350
});
5451
return;
5552
}

0 commit comments

Comments
 (0)