mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-20 00:23:03 +00:00
refactor: adjust to stricter eslint rules
This commit is contained in:
24
src/cli.ts
24
src/cli.ts
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user