Skip to content

Commit

Permalink
import, don't require
Browse files Browse the repository at this point in the history
  • Loading branch information
kamlekar committed May 2, 2023
1 parent 3bc8c55 commit 42d415f
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/common/constants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const path = require('path');
import * as path from 'path';

// @NOTE: If modifying these scopes, delete token.json.
export const SCOPES = [
Expand Down
10 changes: 5 additions & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { NestExpressApplication } from '@nestjs/platform-express';
import { join } from 'path';
import { AppModule } from './app.module';

const dotenv = require('dotenv');
const fs = require('fs');
const os = require('os');
const fileUpload = require('express-fileupload');
const nunjucks = require('nunjucks');
import * as dotenv from 'dotenv';
import * as fs from 'fs';
import * as os from 'os';
import * as fileUpload from 'express-fileupload';
import * as nunjucks from 'nunjucks';

dotenv.config();

Expand Down
8 changes: 4 additions & 4 deletions src/modules/authentication/services/googleAuth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import { deleteFile } from '../../../services/utils/files.service';
import { Request, Response } from 'express';
import { CREDENTIALS_PATH, SCOPES } from '../../../common/constants';

const fs = require('fs');
const url = require('url');
const os = require('os');
const path = require('path');
import * as fs from 'fs';
import * as url from 'url';
import * as os from 'os';
import * as path from 'path';

@Injectable()
export class GoogleAuthService {
Expand Down
2 changes: 1 addition & 1 deletion src/modules/calendar/services/events.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { Injectable } from '@nestjs/common';
import { calendar_v3, google } from 'googleapis';

const moment = require('moment');
import * as moment from 'moment';

@Injectable()
export class EventsService {
Expand Down
4 changes: 2 additions & 2 deletions src/modules/drive/services/upload.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { Injectable } from '@nestjs/common';
import { google } from 'googleapis';
import { commaSeparatedValues } from '../../../services/utils/strings.service';

const fs = require('fs');
const moment = require('moment');
import * as fs from 'fs';
import * as moment from 'moment';

@Injectable()
export class UploadService {
Expand Down
2 changes: 1 addition & 1 deletion test/app.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Test, TestingModule } from '@nestjs/testing';
import { INestApplication } from '@nestjs/common';
import { AppModule } from './../src/app.module';

const request = require('supertest');
import * as request from 'supertest';

describe('AppController (e2e)', () => {
let app: INestApplication;
Expand Down

0 comments on commit 42d415f

Please sign in to comment.