Skip to content

Commit

Permalink
Added ESLint rules.
Browse files Browse the repository at this point in the history
  • Loading branch information
CISC committed Mar 15, 2017
1 parent 0f6db7f commit 07dd310
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 11 deletions.
11 changes: 0 additions & 11 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ const querystring = require('querystring');
* @return {function}
* @api public
*/

function ConManager(baseurl, token_name) {
this._request = (method, endpoint, data) => {
let headers = { 'Content-Type': 'application/json' };
Expand Down Expand Up @@ -207,7 +206,6 @@ function ConManager(baseurl, token_name) {
* @return {Promise}
* @api public
*/

this.uploadStream = (rstream, cmpath, upload_type) => {
let filename = path.basename(cmpath);
let subfolder = path.dirname(cmpath);
Expand Down Expand Up @@ -333,7 +331,6 @@ function ConManager(baseurl, token_name) {
* @return {Promise}
* @api public
*/

this.upload = (file, cmpath, upload_type) => {
let f = fs.createReadStream(file);

Expand All @@ -350,7 +347,6 @@ function ConManager(baseurl, token_name) {
* @return {stream.Readable}
* @api public
*/

this.downloadStream = (cmpath) => {
let headers = {};
let urlpath = url.parse(url.resolve(this._rooturl, cmpath.startsWith('/') ? cmpath.slice(1): cmpath));
Expand Down Expand Up @@ -398,7 +394,6 @@ function ConManager(baseurl, token_name) {
* @return {Promise}
* @api public
*/

this.download = (cmpath, file) => {
return new Promise((resolve, reject) => {
let f = fs.createWriteStream(file).on('error', reject);
Expand All @@ -421,7 +416,6 @@ function ConManager(baseurl, token_name) {
* @return {Promise}
* @api public
*/

this.login = (username, password) => {
let p = Promise.resolve(false);

Expand Down Expand Up @@ -477,7 +471,6 @@ function ConManager(baseurl, token_name) {
* @return {Promise}
* @api public
*/

this.get = this._request.bind(this, 'GET');

/**
Expand All @@ -488,7 +481,6 @@ function ConManager(baseurl, token_name) {
* @return {Promise}
* @api public
*/

this.post = this._request.bind(this, 'POST');

/**
Expand All @@ -499,7 +491,6 @@ function ConManager(baseurl, token_name) {
* @return {Promise}
* @api public
*/

this.put = this._request.bind(this, 'PUT');

/**
Expand All @@ -510,7 +501,6 @@ function ConManager(baseurl, token_name) {
* @return {Promise}
* @api public
*/

this.delete = this._request.bind(this, 'DELETE');

this._rooturl = baseurl.endsWith('/') ? baseurl : `${baseurl}/`;
Expand All @@ -522,7 +512,6 @@ function ConManager(baseurl, token_name) {
* Cached login response object.
* @public
*/

this.login_response = {};
}

Expand Down
55 changes: 55 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,60 @@
},
"dependencies": {
"debug": "^2.2.0"
},
"devDependencies": {
"eslint": "^3.17.1"
},
"scripts": {
"lint": "eslint index.js"
},
"eslintConfig": {
"env": {
"es6": true,
"node": true
},
"extends": "eslint:recommended",
"rules": {
"dot-notation": "error",
"indent": [
"error",
4
],
"no-unused-vars": [
"error",
{
"args": "none"
}
],
"no-var": "error",
"prefer-arrow-callback": "warn",
"prefer-template": "warn",
"quote-props": [
"error",
"always"
],
"require-jsdoc": [
"warn",
{
"require": {
"FunctionDeclaration": true,
"MethodDefinition": true,
"ClassDeclaration": true,
"ArrowFunctionExpression": true
}
}
],
"semi": [
"error",
"always"
],
"valid-jsdoc": [
"error",
{
"requireParamDescription": false,
"requireReturnDescription": false
}
]
}
}
}

0 comments on commit 07dd310

Please sign in to comment.