Skip to content

Commit

Permalink
review: use imports for lib server & client
Browse files Browse the repository at this point in the history
  • Loading branch information
mklabs committed Aug 17, 2016
1 parent 5e3f12a commit 20a49a8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

"rules": {
"semi": ["error", "always"],
"no-multi-spaces": ["error", { "exceptions": { "VariableDeclarator": true } }],
"no-multi-spaces": ["error", { "exceptions": { "VariableDeclarator": true, "ImportDeclaration": true } }],
"promise/param-names": 0
}
}
7 changes: 4 additions & 3 deletions lib/client.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const events = require('events');
const WebSocket = require('faye-websocket');
const debug = require('debug')('tinylr:client');
import events from 'events';
import WebSocket from 'faye-websocket';

const debug = require('debug')('tinylr:client');

let idCounter = 0;

Expand Down
23 changes: 12 additions & 11 deletions lib/server.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
const fs = require('fs');
const http = require('http');
const https = require('https');
const events = require('events');
const parse = require('url').parse;
const debug = require('debug')('tinylr:server');
const Client = require('./client');
const config = require('../package.json');
const anybody = require('body/any');
const qs = require('qs');
import fs from 'fs';
import http from 'http';
import https from 'https';
import events from 'events';
import {parse} from 'url';
import Client from './client';
import config from '../package.json';
import anybody from 'body/any';
import qs from 'qs';

const debug = require('debug')('tinylr:server');

const CONTENT_TYPE = 'content-type';
const FORM_TYPE = 'application/x-www-form-urlencoded';
Expand Down Expand Up @@ -294,4 +295,4 @@ class Server extends events.EventEmitter {
}
}

module.exports = Server;
export default Server;

0 comments on commit 20a49a8

Please sign in to comment.