refactor: adjust to stricter eslint rules

This commit is contained in:
Rainer Killinger
2023-01-30 11:53:21 +01:00
parent c6f4660b3a
commit 0995e7500c
8 changed files with 30 additions and 31 deletions

View File

@@ -187,16 +187,16 @@ commander
unexpected = unexpected || errorsPerFile[file].some(error => !error.expected);
}
if (typeof relativeReportPath !== 'undefined') {
if (relativeReportPath !== undefined) {
const reportPath = path.resolve(relativeReportPath);
await writeReport(reportPath, errorsPerFile);
}
if (!unexpected) {
Logger.ok('Successfully finished validation.');
} else {
if (unexpected) {
await Logger.error('Unexpected errors occurred during validation');
process.exit(1);
} else {
Logger.ok('Successfully finished validation.');
}
});
@@ -219,17 +219,17 @@ commander
.option('--outputFileName <fileName>', 'Defines the filename of the output')
.action(async (relativeSourcePath, plantumlServer, options) => {
const plantUmlConfig: UMLConfig = {
definitions: typeof options.definitions !== 'undefined' ? options.definitions : [],
showAssociations: typeof options.showAssociations !== 'undefined' ? options.showAssociations : false,
showEnumValues: typeof options.showEnumValues !== 'undefined' ? options.showEnumValues : false,
showInheritance: typeof options.showInheritance !== 'undefined' ? options.showInheritance : false,
definitions: options.definitions === undefined ? [] : options.definitions,
showAssociations: options.showAssociations === undefined ? false : options.showAssociations,
showEnumValues: options.showEnumValues === undefined ? false : options.showEnumValues,
showInheritance: options.showInheritance === undefined ? false : options.showInheritance,
showInheritedProperties:
typeof options.showInheritedProperties !== 'undefined' ? options.showInheritedProperties : false,
options.showInheritedProperties === undefined ? false : options.showInheritedProperties,
showOptionalProperties:
typeof options.showOptionalProperties !== 'undefined' ? options.showOptionalProperties : false,
showProperties: typeof options.showProperties !== 'undefined' ? options.showProperties : false,
options.showOptionalProperties === undefined ? false : options.showOptionalProperties,
showProperties: options.showProperties === undefined ? false : options.showProperties,
};
if (typeof options.outputFileName !== 'undefined') {
if (options.outputFileName !== undefined) {
plantUmlConfig.outputFileName = options.outputFileName;
}