Skip to content

Commit 07dd310

Browse files
committed
Added ESLint rules.
1 parent 0f6db7f commit 07dd310

File tree

2 files changed

+55
-11
lines changed

2 files changed

+55
-11
lines changed

index.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ const querystring = require('querystring');
6868
* @return {function}
6969
* @api public
7070
*/
71-
7271
function ConManager(baseurl, token_name) {
7372
this._request = (method, endpoint, data) => {
7473
let headers = { 'Content-Type': 'application/json' };
@@ -207,7 +206,6 @@ function ConManager(baseurl, token_name) {
207206
* @return {Promise}
208207
* @api public
209208
*/
210-
211209
this.uploadStream = (rstream, cmpath, upload_type) => {
212210
let filename = path.basename(cmpath);
213211
let subfolder = path.dirname(cmpath);
@@ -333,7 +331,6 @@ function ConManager(baseurl, token_name) {
333331
* @return {Promise}
334332
* @api public
335333
*/
336-
337334
this.upload = (file, cmpath, upload_type) => {
338335
let f = fs.createReadStream(file);
339336

@@ -350,7 +347,6 @@ function ConManager(baseurl, token_name) {
350347
* @return {stream.Readable}
351348
* @api public
352349
*/
353-
354350
this.downloadStream = (cmpath) => {
355351
let headers = {};
356352
let urlpath = url.parse(url.resolve(this._rooturl, cmpath.startsWith('/') ? cmpath.slice(1): cmpath));
@@ -398,7 +394,6 @@ function ConManager(baseurl, token_name) {
398394
* @return {Promise}
399395
* @api public
400396
*/
401-
402397
this.download = (cmpath, file) => {
403398
return new Promise((resolve, reject) => {
404399
let f = fs.createWriteStream(file).on('error', reject);
@@ -421,7 +416,6 @@ function ConManager(baseurl, token_name) {
421416
* @return {Promise}
422417
* @api public
423418
*/
424-
425419
this.login = (username, password) => {
426420
let p = Promise.resolve(false);
427421

@@ -477,7 +471,6 @@ function ConManager(baseurl, token_name) {
477471
* @return {Promise}
478472
* @api public
479473
*/
480-
481474
this.get = this._request.bind(this, 'GET');
482475

483476
/**
@@ -488,7 +481,6 @@ function ConManager(baseurl, token_name) {
488481
* @return {Promise}
489482
* @api public
490483
*/
491-
492484
this.post = this._request.bind(this, 'POST');
493485

494486
/**
@@ -499,7 +491,6 @@ function ConManager(baseurl, token_name) {
499491
* @return {Promise}
500492
* @api public
501493
*/
502-
503494
this.put = this._request.bind(this, 'PUT');
504495

505496
/**
@@ -510,7 +501,6 @@ function ConManager(baseurl, token_name) {
510501
* @return {Promise}
511502
* @api public
512503
*/
513-
514504
this.delete = this._request.bind(this, 'DELETE');
515505

516506
this._rooturl = baseurl.endsWith('/') ? baseurl : `${baseurl}/`;
@@ -522,7 +512,6 @@ function ConManager(baseurl, token_name) {
522512
* Cached login response object.
523513
* @public
524514
*/
525-
526515
this.login_response = {};
527516
}
528517

package.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,60 @@
2323
},
2424
"dependencies": {
2525
"debug": "^2.2.0"
26+
},
27+
"devDependencies": {
28+
"eslint": "^3.17.1"
29+
},
30+
"scripts": {
31+
"lint": "eslint index.js"
32+
},
33+
"eslintConfig": {
34+
"env": {
35+
"es6": true,
36+
"node": true
37+
},
38+
"extends": "eslint:recommended",
39+
"rules": {
40+
"dot-notation": "error",
41+
"indent": [
42+
"error",
43+
4
44+
],
45+
"no-unused-vars": [
46+
"error",
47+
{
48+
"args": "none"
49+
}
50+
],
51+
"no-var": "error",
52+
"prefer-arrow-callback": "warn",
53+
"prefer-template": "warn",
54+
"quote-props": [
55+
"error",
56+
"always"
57+
],
58+
"require-jsdoc": [
59+
"warn",
60+
{
61+
"require": {
62+
"FunctionDeclaration": true,
63+
"MethodDefinition": true,
64+
"ClassDeclaration": true,
65+
"ArrowFunctionExpression": true
66+
}
67+
}
68+
],
69+
"semi": [
70+
"error",
71+
"always"
72+
],
73+
"valid-jsdoc": [
74+
"error",
75+
{
76+
"requireParamDescription": false,
77+
"requireReturnDescription": false
78+
}
79+
]
80+
}
2681
}
2782
}

0 commit comments

Comments
 (0)