Skip to content

Commit

Permalink
chore: update typescript to 3.9.5
Browse files Browse the repository at this point in the history
  • Loading branch information
B4nan committed Aug 9, 2020
1 parent eae2c53 commit beffd4c
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,6 @@
"semantic-release": "^17.0.8",
"ts-jest": "^26.1.0",
"ts-node": "^8.10.2",
"typescript": "3.9.3"
"typescript": "3.9.5"
}
}
2 changes: 2 additions & 0 deletions packages/cli/src/CLIHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ export class CLIHelper {
static getORMVersion(): string {
/* istanbul ignore next */
try {
// eslint-disable-next-line @typescript-eslint/no-var-requires
return require('../package.json').version;
} catch {
// eslint-disable-next-line @typescript-eslint/no-var-requires
return require('./package.json').version;
}
}
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env node

// eslint-disable-next-line @typescript-eslint/no-var-requires
require('yargonaut')
.style('blue')
.style('yellow', 'required')
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/MikroORM.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export class MikroORM<D extends IDatabaseDriver = IDatabaseDriver> {
* Gets the SchemaGenerator.
*/
getSchemaGenerator<T extends ISchemaGenerator = ISchemaGenerator>(): T {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const SchemaGenerator = require('@mikro-orm/knex').SchemaGenerator;
return new SchemaGenerator(this.em);
}
Expand All @@ -114,6 +115,7 @@ export class MikroORM<D extends IDatabaseDriver = IDatabaseDriver> {
* Gets the EntityGenerator.
*/
getEntityGenerator<T extends IEntityGenerator = IEntityGenerator>(): T {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const EntityGenerator = require('@mikro-orm/entity-generator').EntityGenerator;
return new EntityGenerator(this.em);
}
Expand All @@ -122,6 +124,7 @@ export class MikroORM<D extends IDatabaseDriver = IDatabaseDriver> {
* Gets the Migrator.
*/
getMigrator<T extends IMigrator = IMigrator>(): T {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const Migrator = require('@mikro-orm/migrations').Migrator;
return new Migrator(this.em);
}
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/utils/Configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ export class Configuration<D extends IDatabaseDriver = IDatabaseDriver> {
private initDriver(): D {
if (!this.options.driver) {
const driver = Configuration.PLATFORMS[this.options.type!];
// eslint-disable-next-line @typescript-eslint/no-var-requires
this.options.driver = require(driver[1])[driver[0]];
}

Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/utils/ConfigurationLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@ export class ConfigurationLoader {
}

static async registerTsNode(tsConfigPath = process.cwd() + '/tsconfig.json') {
require('ts-node').register({
project: tsConfigPath,
});
// eslint-disable-next-line @typescript-eslint/no-var-requires
require('ts-node').register({ project: tsConfigPath });

if (await pathExists(tsConfigPath)) {
// eslint-disable-next-line @typescript-eslint/no-var-requires
Expand All @@ -69,6 +68,7 @@ export class ConfigurationLoader {
const paths = tsConfig?.compilerOptions?.paths;

if (paths) {
// eslint-disable-next-line @typescript-eslint/no-var-requires
require('tsconfig-paths').register({
baseUrl: tsConfig.compilerOptions.baseUrl,
paths: tsConfig.compilerOptions.paths,
Expand Down
9 changes: 7 additions & 2 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit beffd4c

Please sign in to comment.