From 12c9fbae9b7fc89a31792b60229f13016832b59f Mon Sep 17 00:00:00 2001 From: Kononnable Date: Sat, 12 Oct 2019 12:30:42 +0200 Subject: [PATCH] code linting --- .eslintrc.js | 11 +--- .travis.yml | 4 +- package.json | 2 +- src/Engine.ts | 2 +- src/Utils.ts | 8 ++- src/drivers/MssqlDriver.ts | 2 +- src/drivers/MysqlDriver.ts | 12 ++--- src/drivers/OracleDriver.ts | 22 ++++---- src/drivers/PostgresDriver.ts | 4 +- src/drivers/SqliteDriver.ts | 66 ++++++++--------------- src/index.ts | 54 +++++++++---------- src/models/Column.ts | 2 +- test/drivers/MssqlDriver.test.ts | 2 +- test/integration/runTestsFromPath.test.ts | 28 ++++------ test/mocha.opts | 3 ++ test/utils/EntityFileToJson.ts | 23 +++----- test/utils/GeneralTestUtils.ts | 6 +-- 17 files changed, 102 insertions(+), 149 deletions(-) create mode 100644 test/mocha.opts diff --git a/.eslintrc.js b/.eslintrc.js index b2ae4ed..587e3f8 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -40,14 +40,5 @@ module.exports = { extensions: [".js", ".jsx", ".ts", ".tsx"] } } - }, - overrides: [ - { - files: ["**/*.test.ts"], - rules: { - "no-unused-expressions": "off", - "func-names": "off" - } - } - ] + } }; diff --git a/.travis.yml b/.travis.yml index 7cad05a..2331e31 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,8 +41,8 @@ before_script: - if [ -n "$DOCKER_USERNAME" ]; then mkdir /opt/oracle; npm i oracledb --no-save; docker cp typeorm-mg-oracle-client:/usr/lib/oracle/12.2/client64/lib /opt/oracle/instantclient_12_2; fi - export LD_LIBRARY_PATH=/opt/oracle/instantclient_12_2:$LD_LIBRARY_PATH script: -- sleep 60 -- travis_retry sh -c 'sleep 60 && npm t -- --colors' +- docker ps +- travis_retry sh -c 'sleep 60 && docker ps && npm t -- --colors' after_success: - codecov dd: diff --git a/package.json b/package.json index f4af5e7..40e1ba1 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "build": "npm run clean && tsc && ncp src/entity.mst dist/src/entity.mst", "prepare": "npm run build", "pretest": "tsc --noEmit", - "test": "nyc --reporter=lcov ts-node ./node_modules/mocha/bin/_mocha test/**/*.test.ts -- -R spec --bail", + "test": "nyc --reporter=lcov ts-node ./node_modules/mocha/bin/_mocha test/**/*.test.ts -- --bail", "posttest": "eslint ./**/*.ts ./src/**/*.ts ./test/**/*.ts", "clean": "rimraf coverage output dist", "prettier": "prettier --write ./src/*.ts ./src/**/*.ts" diff --git a/src/Engine.ts b/src/Engine.ts index c6e4577..2ef0e90 100644 --- a/src/Engine.ts +++ b/src/Engine.ts @@ -162,7 +162,7 @@ function removeColumnDefaultProperties( } dbModel.forEach(entity => { entity.columns.forEach(column => { - const defVal = defaultValues[column.tscType as any]; + const defVal = defaultValues[column.tscType]; if (defVal) { if ( column.options.length && diff --git a/src/Utils.ts b/src/Utils.ts index 38fdb98..bd10f3b 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -4,16 +4,14 @@ import { Entity } from "./models/Entity"; export function LogError( errText: string, isABug: boolean = true, - passedError?: any + passedError?: string | ErrorConstructor ) { let errObject = passedError; console.error(errText); console.error(`Error occured in typeorm-model-generator.`); console.error(`${packageVersion()} node@${process.version}`); console.error( - `If you think this is a bug please open an issue including this log on ${ - (packagejson as any).bugs.url - }` + `If you think this is a bug please open an issue including this log on ${packagejson.bugs.url}` ); if (isABug && !passedError) { errObject = new Error().stack; @@ -23,7 +21,7 @@ export function LogError( } } export function packageVersion() { - return `${(packagejson as any).name}@${(packagejson as any).version}`; + return `${packagejson.name}@${packagejson.version}`; } export function findNameForNewField( _fieldName: string, diff --git a/src/drivers/MssqlDriver.ts b/src/drivers/MssqlDriver.ts index 40ab741..4b639fa 100644 --- a/src/drivers/MssqlDriver.ts +++ b/src/drivers/MssqlDriver.ts @@ -89,7 +89,7 @@ WHERE TABLE_TYPE='BASE TABLE' and TABLE_SCHEMA in (${schema}) AND TABLE_CATALOG const defaultValue = MssqlDriver.ReturnDefaultValueFunction( resp.COLUMN_DEFAULT ); - const columnType = resp.DATA_TYPE as any; + const columnType = resp.DATA_TYPE; let tscType = ""; switch (resp.DATA_TYPE) { case "bigint": diff --git a/src/drivers/MysqlDriver.ts b/src/drivers/MysqlDriver.ts index 0038e23..75aab4a 100644 --- a/src/drivers/MysqlDriver.ts +++ b/src/drivers/MysqlDriver.ts @@ -456,21 +456,19 @@ export default class MysqlDriver extends AbstractDriver { } public async CreateDB(dbName: string) { - await this.ExecQuery(`CREATE DATABASE ${dbName}; `); + await this.ExecQuery(`CREATE DATABASE ${dbName}; `); } public async UseDB(dbName: string) { - await this.ExecQuery(`USE ${dbName}; `); + await this.ExecQuery(`USE ${dbName}; `); } public async DropDB(dbName: string) { - await this.ExecQuery(`DROP DATABASE ${dbName}; `); + await this.ExecQuery(`DROP DATABASE ${dbName}; `); } public async CheckIfDBExists(dbName: string): Promise { - const resp = await this.ExecQuery( - `SHOW DATABASES LIKE '${dbName}' ` - ); + const resp = await this.ExecQuery(`SHOW DATABASES LIKE '${dbName}' `); return resp.length > 0; } @@ -480,7 +478,7 @@ export default class MysqlDriver extends AbstractDriver { const stream = query.stream({}); const promise = new Promise((resolve, reject) => { stream.on("data", chunk => { - ret.push((chunk as any) as T); + ret.push((chunk as unknown) as T); }); stream.on("error", err => reject(err)); stream.on("end", () => resolve(true)); diff --git a/src/drivers/OracleDriver.ts b/src/drivers/OracleDriver.ts index 618cc8c..88f99e9 100644 --- a/src/drivers/OracleDriver.ts +++ b/src/drivers/OracleDriver.ts @@ -86,7 +86,7 @@ export default class OracleDriver extends AbstractDriver { resp.DATA_DEFAULT ); const DATA_TYPE = resp.DATA_TYPE.replace(/\([0-9]+\)/g, ""); - const columnType = DATA_TYPE.toLowerCase() as any; + const columnType = DATA_TYPE.toLowerCase(); let tscType = ""; switch (DATA_TYPE.toLowerCase()) { case "char": @@ -332,22 +332,22 @@ export default class OracleDriver extends AbstractDriver { } } - public async ConnectToServer(connectionOptons: IConnectionOptions) { + public async ConnectToServer(connectionOptions: IConnectionOptions) { let config: any; - if (connectionOptons.user === String(process.env.ORACLE_UsernameSys)) { + if (connectionOptions.user === String(process.env.ORACLE_UsernameSys)) { config /* Oracle.IConnectionAttributes */ = { - connectString: `${connectionOptons.host}:${connectionOptons.port}/${connectionOptons.databaseName}`, - externalAuth: connectionOptons.ssl, - password: connectionOptons.password, + connectString: `${connectionOptions.host}:${connectionOptions.port}/${connectionOptions.databaseName}`, + externalAuth: connectionOptions.ssl, + password: connectionOptions.password, privilege: this.Oracle.SYSDBA, - user: connectionOptons.user + user: connectionOptions.user }; } else { config /* Oracle.IConnectionAttributes */ = { - connectString: `${connectionOptons.host}:${connectionOptons.port}/${connectionOptons.databaseName}`, - externalAuth: connectionOptons.ssl, - password: connectionOptons.password, - user: connectionOptons.user + connectString: `${connectionOptions.host}:${connectionOptions.port}/${connectionOptions.databaseName}`, + externalAuth: connectionOptions.ssl, + password: connectionOptions.password, + user: connectionOptions.user }; } const that = this; diff --git a/src/drivers/PostgresDriver.ts b/src/drivers/PostgresDriver.ts index 4ad3e96..c34402f 100644 --- a/src/drivers/PostgresDriver.ts +++ b/src/drivers/PostgresDriver.ts @@ -114,7 +114,7 @@ export default class PostgresDriver extends AbstractDriver { } return; } - const columnType = columnTypes.sqlType as any; + const columnType = columnTypes.sqlType; let tscType = columnTypes.tsType; if (columnTypes.isArray) options.array = true; if (columnTypes.enumValues.length > 0) @@ -123,7 +123,7 @@ export default class PostgresDriver extends AbstractDriver { tscType = tscType .split("|") .map(x => `${x.replace("|", "").trim()}[]`) - .join(" | ") as any; + .join(" | "); } if ( diff --git a/src/drivers/SqliteDriver.ts b/src/drivers/SqliteDriver.ts index 028542f..64ce684 100644 --- a/src/drivers/SqliteDriver.ts +++ b/src/drivers/SqliteDriver.ts @@ -24,7 +24,7 @@ export default class SqliteDriver extends AbstractDriver { public sqlite = sqliteLib.verbose(); - public db: any; + public db: sqliteLib.Database; public tablesWithGeneratedPrimaryKey: string[] = new Array(); @@ -176,12 +176,18 @@ export default class SqliteDriver extends AbstractDriver { ) && sqlOptions ) { - options.precision = sqlOptions[0] - .substring(1, sqlOptions[0].length - 1) - .split(",")[0] as any; - options.scale = sqlOptions[0] - .substring(1, sqlOptions[0].length - 1) - .split(",")[1] as any; + options.precision = Number.parseInt( + sqlOptions[0] + .substring(1, sqlOptions[0].length - 1) + .split(",")[0], + 10 + ); + options.scale = Number.parseInt( + sqlOptions[0] + .substring(1, sqlOptions[0].length - 1) + .split(",")[1], + 10 + ); } if ( this.ColumnTypesWithLength.some( @@ -203,10 +209,13 @@ export default class SqliteDriver extends AbstractDriver { ) && sqlOptions ) { - options.width = sqlOptions[0].substring( - 1, - sqlOptions[0].length - 1 - ) as any; + options.width = Number.parseInt( + sqlOptions[0].substring( + 1, + sqlOptions[0].length - 1 + ), + 10 + ); } if (columnType) { @@ -267,39 +276,6 @@ export default class SqliteDriver extends AbstractDriver { }); } ent.indices.push(indexInfo); - - // indexColumnsResponse.forEach(element => { - // const indexColumnInfo: IndexColumnInfo = {} as IndexColumnInfo; - // if ( - // ent.indices.filter(filterVal => { - // return filterVal.name === resp.name; - // }).length > 0 - // ) { - // indexInfo = ent.indices.find( - // filterVal => filterVal.name === resp.name - // )!; - // } else { - // indexInfo.columns = [] as IndexColumnInfo[]; - // indexInfo.name = resp.name; - // indexInfo.isUnique = resp.unique === 1; - // ent.indices.push(indexInfo); - // } - // indexColumnInfo.name = element.name; - // if ( - // indexColumnsResponse.length === 1 && - // indexInfo.isUnique - // ) { - // ent.columns - // .filter( - // v => v.tscName === indexColumnInfo.name - // ) - // .forEach(v => { - // // eslint-disable-next-line no-param-reassign - // v.options.unique = true; - // }); - // } - // indexInfo.columns.push(indexColumnInfo); - // }); }) ); }) @@ -425,7 +401,7 @@ export default class SqliteDriver extends AbstractDriver { } public async ExecQuery(sql: string): Promise { - let ret: any; + let ret: T[] = []; const promise = new Promise((resolve, reject) => { this.db.serialize(() => { this.db.all(sql, [], (err, row) => { diff --git a/src/index.ts b/src/index.ts index 4e9df15..c3a37aa 100644 --- a/src/index.ts +++ b/src/index.ts @@ -216,7 +216,7 @@ async function GetUtilParametersByInquirer() { const connectionOptions: IConnectionOptions = new IConnectionOptions(); const generationOptions: IGenerationOptions = new IGenerationOptions(); - connectionOptions.databaseType = ((await inquirer.prompt([ + connectionOptions.databaseType = (await inquirer.prompt([ { choices: [ "mssql", @@ -230,10 +230,10 @@ async function GetUtilParametersByInquirer() { name: "engine", type: "list" } - ])) as any).engine; + ])).engine; const driver = createDriver(connectionOptions.databaseType); if (connectionOptions.databaseType !== "sqlite") { - const answ: any = await inquirer.prompt([ + const answ = await inquirer.prompt([ { default: "localhost", message: "Database address:", @@ -283,7 +283,7 @@ async function GetUtilParametersByInquirer() { connectionOptions.databaseType === "mssql" || connectionOptions.databaseType === "postgres" ) { - connectionOptions.schemaName = ((await inquirer.prompt([ + connectionOptions.schemaName = (await inquirer.prompt([ { default: driver.standardSchema, message: @@ -291,7 +291,7 @@ async function GetUtilParametersByInquirer() { name: "schema", type: "input" } - ])) as any).schema; + ])).schema; } connectionOptions.port = answ.port; connectionOptions.host = answ.host; @@ -300,38 +300,38 @@ async function GetUtilParametersByInquirer() { connectionOptions.databaseName = answ.dbName; connectionOptions.ssl = answ.ssl; } else { - connectionOptions.databaseName = ((await inquirer.prompt([ + connectionOptions.databaseName = (await inquirer.prompt([ { default: "", message: "Path to database file:", name: "dbName", type: "input" } - ])) as any).dbName; + ])).dbName; } - generationOptions.resultsPath = ((await inquirer.prompt([ + generationOptions.resultsPath = (await inquirer.prompt([ { default: path.resolve(process.cwd(), "output"), message: "Path where generated models should be stored:", name: "output", type: "input" } - ])) as any).output; + ])).output; if ( connectionOptions.databaseType === "mssql" || connectionOptions.databaseType === "postgres" ) { - const { changeRequestTimeout } = (await inquirer.prompt([ + const { changeRequestTimeout } = await inquirer.prompt([ { default: false, message: "Do you want to change default sql query timeout?", name: "changeRequestTimeout", type: "confirm" } - ])) as any; + ]); if (changeRequestTimeout) { - const { timeout } = (await inquirer.prompt({ + const { timeout } = await inquirer.prompt({ message: "Query timeout(ms):", name: "timeout", type: "input", @@ -339,20 +339,20 @@ async function GetUtilParametersByInquirer() { const valid = !Number.isNaN(parseInt(value, 10)); return valid || "Please enter a valid number"; } - })) as any; + }); connectionOptions.timeout = timeout; } } - const { customizeGeneration } = (await inquirer.prompt([ + const { customizeGeneration } = await inquirer.prompt([ { default: false, message: "Do you want to customize generated model?", name: "customizeGeneration", type: "confirm" } - ])) as any; + ]); if (customizeGeneration) { - const customizations: string[] = ((await inquirer.prompt([ + const customizations: string[] = (await inquirer.prompt([ { choices: [ { @@ -394,9 +394,9 @@ async function GetUtilParametersByInquirer() { name: "selected", type: "checkbox" } - ])) as any).selected; + ])).selected; - generationOptions.propertyVisibility = ((await inquirer.prompt([ + generationOptions.propertyVisibility = (await inquirer.prompt([ { choices: ["public", "protected", "private", "none"], message: @@ -405,9 +405,9 @@ async function GetUtilParametersByInquirer() { default: "none", type: "list" } - ])) as any).propertyVisibility; + ])).propertyVisibility; - const { strictModeRaw } = (await inquirer.prompt([ + const { strictModeRaw } = await inquirer.prompt([ { choices: ["none", "?", "!"], message: "Mark fields as optional(?) or non-null(!)", @@ -415,7 +415,7 @@ async function GetUtilParametersByInquirer() { default: "none", type: "list" } - ])) as any; + ]); generationOptions.strictMode = strictModeRaw === "none" ? false : strictModeRaw; @@ -431,7 +431,7 @@ async function GetUtilParametersByInquirer() { ); if (customizations.includes("namingStrategy")) { - const namingStrategyPath = ((await inquirer.prompt([ + const namingStrategyPath = (await inquirer.prompt([ { default: path.resolve(process.cwd()), message: "Path to custom naming strategy file:", @@ -445,7 +445,7 @@ async function GetUtilParametersByInquirer() { ); } } - ])) as any).namingStrategy; + ])).namingStrategy; if (namingStrategyPath && namingStrategyPath !== "") { generationOptions.customNamingStrategyPath = namingStrategyPath; @@ -454,7 +454,7 @@ async function GetUtilParametersByInquirer() { } } if (customizations.includes("namingConvention")) { - const namingConventions = (await inquirer.prompt([ + const namingConventions = await inquirer.prompt([ { choices: ["pascal", "param", "camel", "none"], default: "pascal", @@ -476,21 +476,21 @@ async function GetUtilParametersByInquirer() { name: "propertyCase", type: "list" } - ])) as any; + ]); generationOptions.convertCaseFile = namingConventions.fileCase; generationOptions.convertCaseProperty = namingConventions.propertyCase; generationOptions.convertCaseEntity = namingConventions.entityCase; } } - const { saveConfig } = (await inquirer.prompt([ + const { saveConfig } = await inquirer.prompt([ { default: false, message: "Save configuration to config file?", name: "saveConfig", type: "confirm" } - ])) as any; + ]); if (saveConfig) { await fs.writeJson( path.resolve(process.cwd(), ".tomg-config"), diff --git a/src/models/Column.ts b/src/models/Column.ts index f62b867..bde92ce 100644 --- a/src/models/Column.ts +++ b/src/models/Column.ts @@ -1,7 +1,7 @@ import { ColumnType } from "typeorm"; export type Column = { - tscType: any; + tscType: string; tscName: string; type: ColumnType | string; // todo: remove ? diff --git a/test/drivers/MssqlDriver.test.ts b/test/drivers/MssqlDriver.test.ts index b3a6380..bfa577f 100644 --- a/test/drivers/MssqlDriver.test.ts +++ b/test/drivers/MssqlDriver.test.ts @@ -23,7 +23,7 @@ class FakeRecordset extends Array implements MSSQL.IRecordSet { } } -describe("MssqlDriver", function() { +describe("MssqlDriver", () => { let driver: MssqlDriver; const sandbox = Sinon.sandbox.create(); diff --git a/test/integration/runTestsFromPath.test.ts b/test/integration/runTestsFromPath.test.ts index c957d2b..240844d 100644 --- a/test/integration/runTestsFromPath.test.ts +++ b/test/integration/runTestsFromPath.test.ts @@ -22,27 +22,19 @@ require("dotenv").config(); chai.use(chaiSubset); -it("Column default values", async function() { +it("Column default values", async () => { const testPartialPath = "test/integration/defaultValues"; - this.timeout(60000); - this.slow(10000); // compiling created models takes time await runTestsFromPath(testPartialPath, true); -}); -it("Platform specyfic types", async function() { - this.timeout(60000); - this.slow(10000); // compiling created models takes time +}).timeout(); +it("Platform specyfic types", async () => { const testPartialPath = "test/integration/entityTypes"; await runTestsFromPath(testPartialPath, true); }); -describe("GitHub issues", async function() { - this.timeout(60000); - this.slow(10000); // compiling created models takes time +describe("GitHub issues", async () => { const testPartialPath = "test/integration/github-issues"; await runTestsFromPath(testPartialPath, false); }); -describe("TypeOrm examples", async function() { - this.timeout(60000); - this.slow(10000); // compiling created models takes time +describe("TypeOrm examples", async () => { const testPartialPath = "test/integration/examples"; await runTestsFromPath(testPartialPath, false); }); @@ -77,7 +69,7 @@ function runTestForMultipleDrivers( dbDrivers: string[], testPartialPath: string ) { - it(testName, async function() { + it(testName, async () => { const driversToRun = selectDriversForSpecyficTest(); const modelGenerationPromises = driversToRun.map(async dbDriver => { const { @@ -228,7 +220,7 @@ function compileGeneratedModel(filesGenPath: string, drivers: string[]) { ); } }); - const compileErrors = GTU.compileTsFiles(currentDirectoryFiles, { + const compiledWithoutErrors = GTU.compileTsFiles(currentDirectoryFiles, { experimentalDecorators: true, sourceMap: false, emitDecoratorMetadata: true, @@ -236,8 +228,10 @@ function compileGeneratedModel(filesGenPath: string, drivers: string[]) { moduleResolution: ts.ModuleResolutionKind.NodeJs, module: ts.ModuleKind.CommonJS }); - expect(compileErrors, "Errors detected while compiling generated model").to - .be.false; + expect( + compiledWithoutErrors, + "Errors detected while compiling generated model" + ).to.equal(true); } async function prepareTestRuns( diff --git a/test/mocha.opts b/test/mocha.opts new file mode 100644 index 0000000..05132a0 --- /dev/null +++ b/test/mocha.opts @@ -0,0 +1,3 @@ +--timeout 60000 +--slow 20000 +-R spec \ No newline at end of file diff --git a/test/utils/EntityFileToJson.ts b/test/utils/EntityFileToJson.ts index d091b89..ba6823b 100644 --- a/test/utils/EntityFileToJson.ts +++ b/test/utils/EntityFileToJson.ts @@ -6,7 +6,7 @@ class EntityJson { public columns: EntityColumn[] = [] as EntityColumn[]; - public indicies: EntityIndex[] = [] as EntityIndex[]; + public indices: EntityIndex[] = [] as EntityIndex[]; } class EntityColumn { public columnName: string; @@ -15,12 +15,7 @@ class EntityColumn { public columnOptions: any = {}; - public relationType: - | "OneToOne" - | "OneToMany" - | "ManyToOne" - | "ManyToMany" - | "None" = "None"; + public relationType: "OneToOne" | "OneToMany" | "ManyToOne" | "ManyToMany"; public isOwnerOfRelation: boolean = false; } @@ -283,7 +278,7 @@ export default class EntityFileToJson { isMultilineStatement = false; const ind = new EntityIndex(); EntityFileToJson.getIndexOptions(trimmedLine, ind); - retVal.indicies.push(ind); + retVal.indices.push(ind); } return; } @@ -424,7 +419,7 @@ export default class EntityFileToJson { isMultilineStatement = false; const ind = new EntityIndex(); EntityFileToJson.getIndexOptions(trimmedLine, ind); - retVal.indicies.push(ind); + retVal.indices.push(ind); } return; } @@ -472,13 +467,11 @@ export default class EntityFileToJson { ); } if ( - retVal.indicies.length > 0 && - retVal.indicies[retVal.indicies.length - 1].columnNames + retVal.indices.length > 0 && + retVal.indices[retVal.indices.length - 1].columnNames .length === 0 ) { - retVal.indicies[ - retVal.indicies.length - 1 - ].columnNames.push( + retVal.indices[retVal.indices.length - 1].columnNames.push( retVal.columns[retVal.columns.length - 1].columnName ); } @@ -494,7 +487,7 @@ export default class EntityFileToJson { console.log(`${trimmedLine}`); }); - retVal.indicies = retVal.indicies.map(ind => { + retVal.indices = retVal.indices.map(ind => { ind.columnNames = ind.columnNames.map(colName => { if (colName.endsWith("Id")) { colName = colName.substr(0, colName.length - 2); diff --git a/test/utils/GeneralTestUtils.ts b/test/utils/GeneralTestUtils.ts index acccab7..d3d2d1d 100644 --- a/test/utils/GeneralTestUtils.ts +++ b/test/utils/GeneralTestUtils.ts @@ -301,7 +301,7 @@ export function compileTsFiles( ): boolean { const program = ts.createProgram(fileNames, options); const emitResult = program.emit(); - let compileErrors = false; + let compiledWithoutErrors = true; const preDiagnostics = ts.getPreEmitDiagnostics(program); const allDiagnostics = [...preDiagnostics, ...emitResult.diagnostics]; @@ -318,10 +318,10 @@ export function compileTsFiles( `${diagnostic.file!.fileName} (${lineAndCharacter.line + 1},${lineAndCharacter.character + 1}): ${message}` ); - compileErrors = true; + compiledWithoutErrors = false; }); - return compileErrors; + return compiledWithoutErrors; } export function getEnabledDbDrivers() {