diff --git a/gulpfile.ts b/gulpfile.ts index 9afbd5796c..1c5516801a 100644 --- a/gulpfile.ts +++ b/gulpfile.ts @@ -14,15 +14,15 @@ import * as browserify from 'browserify'; import * as source from 'vinyl-source-stream'; import * as buffer from 'vinyl-buffer'; import * as es from 'event-stream'; -const stylus = require('gulp-stylus'); -const cssnano = require('gulp-cssnano'); +import stylus = require('gulp-stylus'); +import cssnano = require('gulp-cssnano'); import * as uglify from 'gulp-uglify'; -const ls = require('browserify-livescript'); -const aliasify = require('aliasify'); -const riotify = require('riotify'); -const transformify = require('syuilo-transformify'); -const pug = require('gulp-pug'); -const git = require('git-last-commit'); +import ls = require('browserify-livescript'); +import aliasify = require('aliasify'); +import riotify = require('riotify'); +import transformify = require('syuilo-transformify'); +import pug = require('gulp-pug'); +import git = require('git-last-commit'); import * as rimraf from 'rimraf'; import * as escapeHtml from 'escape-html'; diff --git a/src/api/common/add-file-to-drive.ts b/src/api/common/add-file-to-drive.ts index 0bd9f34825..4102d64250 100644 --- a/src/api/common/add-file-to-drive.ts +++ b/src/api/common/add-file-to-drive.ts @@ -1,8 +1,8 @@ import * as mongodb from 'mongodb'; import * as crypto from 'crypto'; import * as gm from 'gm'; -const fileType = require('file-type'); -const prominence = require('prominence'); +import fileType = require('file-type'); +import prominence = require('prominence'); import DriveFile from '../models/drive-file'; import DriveFolder from '../models/drive-folder'; import serialize from '../serializers/drive-file'; diff --git a/src/api/private/signup.ts b/src/api/private/signup.ts index d008554141..c50b070052 100644 --- a/src/api/private/signup.ts +++ b/src/api/private/signup.ts @@ -1,7 +1,7 @@ import * as express from 'express'; import * as bcrypt from 'bcrypt'; import rndstr from 'rndstr'; -const recaptcha = require('recaptcha-promise'); +import recaptcha = require('recaptcha-promise'); import User from '../models/user'; import { validateUsername } from '../models/user'; import serialize from '../serializers/user'; diff --git a/src/api/serializers/app.ts b/src/api/serializers/app.ts index 23a12c977d..1c4b244a36 100644 --- a/src/api/serializers/app.ts +++ b/src/api/serializers/app.ts @@ -4,7 +4,7 @@ * Module dependencies */ import * as mongo from 'mongodb'; -const deepcopy = require('deepcopy'); +import deepcopy = require('deepcopy'); import App from '../models/app'; import User from '../models/user'; import Userkey from '../models/userkey'; diff --git a/src/api/serializers/auth-session.ts b/src/api/serializers/auth-session.ts index 786684b4e0..b2dc93d3ff 100644 --- a/src/api/serializers/auth-session.ts +++ b/src/api/serializers/auth-session.ts @@ -4,7 +4,7 @@ * Module dependencies */ import * as mongo from 'mongodb'; -const deepcopy = require('deepcopy'); +import deepcopy = require('deepcopy'); import serializeApp from './app'; /** diff --git a/src/api/serializers/drive-file.ts b/src/api/serializers/drive-file.ts index 635cf13867..76d66ce6f1 100644 --- a/src/api/serializers/drive-file.ts +++ b/src/api/serializers/drive-file.ts @@ -6,7 +6,7 @@ import * as mongo from 'mongodb'; import DriveFile from '../models/drive-file'; import serializeDriveTag from './drive-tag'; -const deepcopy = require('deepcopy'); +import deepcopy = require('deepcopy'); /** * Serialize a drive file diff --git a/src/api/serializers/drive-folder.ts b/src/api/serializers/drive-folder.ts index ee5a973e14..102c8aeff6 100644 --- a/src/api/serializers/drive-folder.ts +++ b/src/api/serializers/drive-folder.ts @@ -5,7 +5,7 @@ */ import * as mongo from 'mongodb'; import DriveFolder from '../models/drive-folder'; -const deepcopy = require('deepcopy'); +import deepcopy = require('deepcopy'); /** * Serialize a drive folder diff --git a/src/api/serializers/drive-tag.ts b/src/api/serializers/drive-tag.ts index 182e9a66d4..603b1d7d3e 100644 --- a/src/api/serializers/drive-tag.ts +++ b/src/api/serializers/drive-tag.ts @@ -5,7 +5,7 @@ */ import * as mongo from 'mongodb'; import DriveTag from '../models/drive-tag'; -const deepcopy = require('deepcopy'); +import deepcopy = require('deepcopy'); /** * Serialize a drive tag diff --git a/src/api/serializers/messaging-message.ts b/src/api/serializers/messaging-message.ts index 0855b25d16..c25b9968a6 100644 --- a/src/api/serializers/messaging-message.ts +++ b/src/api/serializers/messaging-message.ts @@ -7,7 +7,7 @@ import * as mongo from 'mongodb'; import Message from '../models/messaging-message'; import serializeUser from './user'; import serializeDriveFile from './drive-file'; -const deepcopy = require('deepcopy'); +import deepcopy = require('deepcopy'); /** * Serialize a message diff --git a/src/api/serializers/notification.ts b/src/api/serializers/notification.ts index 56769f50d0..076fef5fe2 100644 --- a/src/api/serializers/notification.ts +++ b/src/api/serializers/notification.ts @@ -7,7 +7,7 @@ import * as mongo from 'mongodb'; import Notification from '../models/notification'; import serializeUser from './user'; import serializePost from './post'; -const deepcopy = require('deepcopy'); +import deepcopy = require('deepcopy'); /** * Serialize a notification diff --git a/src/api/serializers/post.ts b/src/api/serializers/post.ts index a17aa9035b..3023837890 100644 --- a/src/api/serializers/post.ts +++ b/src/api/serializers/post.ts @@ -8,7 +8,7 @@ import Post from '../models/post'; import Like from '../models/like'; import serializeUser from './user'; import serializeDriveFile from './drive-file'; -const deepcopy = require('deepcopy'); +import deepcopy = require('deepcopy'); /** * Serialize a post diff --git a/src/api/serializers/signin.ts b/src/api/serializers/signin.ts index d6d7a39471..828a165383 100644 --- a/src/api/serializers/signin.ts +++ b/src/api/serializers/signin.ts @@ -3,7 +3,7 @@ /** * Module dependencies */ -const deepcopy = require('deepcopy'); +import deepcopy = require('deepcopy'); /** * Serialize a signin record diff --git a/src/api/serializers/user.ts b/src/api/serializers/user.ts index 0585863950..9eca8bbb7c 100644 --- a/src/api/serializers/user.ts +++ b/src/api/serializers/user.ts @@ -4,7 +4,7 @@ * Module dependencies */ import * as mongo from 'mongodb'; -const deepcopy = require('deepcopy'); +import deepcopy = require('deepcopy'); import User from '../models/user'; import Following from '../models/following'; import getFriends from '../common/get-friends'; diff --git a/src/index.ts b/src/index.ts index df96e6b637..84be38b014 100644 --- a/src/index.ts +++ b/src/index.ts @@ -12,7 +12,7 @@ import * as os from 'os'; import * as cluster from 'cluster'; import Logger from './utils/logger'; import * as chalk from 'chalk'; -const portUsed = require('tcp-port-used'); +import portUsed = require('tcp-port-used'); import isRoot = require('is-root'); import ProgressBar from './utils/cli/progressbar'; import initdb from './db/mongodb'; diff --git a/src/server.ts b/src/server.ts index a327504b26..e9bc07a7f8 100644 --- a/src/server.ts +++ b/src/server.ts @@ -5,9 +5,8 @@ import * as fs from 'fs'; import * as http from 'http'; import * as https from 'https'; - import * as express from 'express'; -const vhost = require('vhost'); +import vhost = require('vhost'); /** * Init app diff --git a/src/utils/lastCommitInfo.ts b/src/utils/lastCommitInfo.ts index ac62f22be6..9682365dad 100644 --- a/src/utils/lastCommitInfo.ts +++ b/src/utils/lastCommitInfo.ts @@ -1,7 +1,7 @@ import Logger from './logger'; import * as chalk from 'chalk'; -const prominence = require('prominence'); -const git = require('git-last-commit'); +import prominence = require('prominence'); +import git = require('git-last-commit'); export default class { static async show(): Promise { diff --git a/src/web/meta.ts b/src/web/meta.ts index 8f04f65926..41bba8c0bd 100644 --- a/src/web/meta.ts +++ b/src/web/meta.ts @@ -1,5 +1,5 @@ import * as express from 'express'; -const git = require('git-last-commit'); +import git = require('git-last-commit'); module.exports = async (req: express.Request, res: express.Response) => { // Get commit info diff --git a/src/web/serve-app.ts b/src/web/serve-app.ts index 3292cfde37..a298d593aa 100644 --- a/src/web/serve-app.ts +++ b/src/web/serve-app.ts @@ -1,6 +1,6 @@ import * as path from 'path'; import * as express from 'express'; -import * as ms from 'ms'; +import ms = require('ms'); export default (name: string) => (req: express.Request, res: express.Response) => { res.sendFile(path.resolve(`${__dirname}/app/${name}/view.html`), { diff --git a/src/web/server.ts b/src/web/server.ts index 31c00bc4af..29041e12f5 100644 --- a/src/web/server.ts +++ b/src/web/server.ts @@ -2,7 +2,7 @@ * Web Server */ -import * as ms from 'ms'; +import ms = require('ms'); // express modules import * as express from 'express'; diff --git a/src/web/service/rss-proxy.ts b/src/web/service/rss-proxy.ts index 8cc3711e70..b2862bdd53 100644 --- a/src/web/service/rss-proxy.ts +++ b/src/web/service/rss-proxy.ts @@ -1,6 +1,6 @@ import * as express from 'express'; import * as request from 'request'; -const xml2json = require('xml2json'); +import xml2json = require('xml2json'); module.exports = (req: express.Request, res: express.Response) => { const url: string = req.body.url;