Skip to content

Commit 59e5f9b

Browse files
authored
included eslint and checkstlyle change (#20)
1 parent fdb7b02 commit 59e5f9b

File tree

6 files changed

+53
-12
lines changed

6 files changed

+53
-12
lines changed

.eslintrc

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"node": true,
5+
"es6": true
6+
},
7+
"globals": {
8+
"Buffer": true,
9+
"escape": true
10+
},
11+
"rules": {
12+
"strict": 0,
13+
"curly": 0,
14+
"no-empty": 0,
15+
"no-underscore-dangle": 0,
16+
"new-cap": 0,
17+
"dot-notation": 0,
18+
"no-trailing-spaces": 2,
19+
"space-unary-ops": 0,
20+
"no-unused-expressions": "off",
21+
"no-new": "off",
22+
"no-console": "off",
23+
"no-shadow": "off",
24+
"quotes": "off",
25+
"no-undef": "off",
26+
"no-use-before-define": [
27+
"error",
28+
{
29+
"functions": false
30+
}
31+
],
32+
"no-var": "error",
33+
"no-template-curly-in-string": "error"
34+
}
35+
}

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"main": "./src/index.js",
66
"homepage": "https://github.com/ajay2507/ebay-node-api",
77
"scripts": {
8-
"test": "mocha",
8+
"lint": "./node_modules/.bin/eslint src/*.js",
9+
"test": "mocha && npm run lint",
910
"prepublish": "npm run test"
1011
},
1112
"author": "Ajaykumar prathap",
@@ -22,6 +23,7 @@
2223
},
2324
"devDependencies": {
2425
"chai": "^4.1.2",
26+
"eslint": "^5.8.0",
2527
"mocha": "^5.0.1",
2628
"nock": "^9.2.3",
2729
"sinon": "^4.4.5"

src/buildURL.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* This method is used to build the url based on
2+
* This method is used to build the url based on
33
* the type of request.
44
*/
55

src/index.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ Ebay.prototype = {
3333
return result["findItemsByKeywordsResponse"];
3434

3535
}, console.error
36-
)},
36+
)
37+
},
3738

3839
findItemsByCategory: function (categoryID) {
3940
if (!categoryID) throw new Error("Category ID is null or invalid");
@@ -47,7 +48,8 @@ Ebay.prototype = {
4748

4849
}, console.error
4950

50-
)},
51+
)
52+
},
5153

5254
getAllCategories: function (categoryID) {
5355
this.options.name = categoryID ? categoryID : -1;
@@ -58,7 +60,8 @@ Ebay.prototype = {
5860
let result = JSON.parse(data);
5961
return result;
6062
}, console.error
61-
)},
63+
)
64+
},
6265

6366
getVersion: function () {
6467
this.options.operationName = "getVersion";
@@ -67,7 +70,8 @@ Ebay.prototype = {
6770
let result = JSON.parse(data);
6871
return result["getVersionResponse"][0];
6972
}, console.error
70-
)},
73+
)
74+
},
7175

7276
getUserDetails: function (userID) {
7377
if (!userID) throw new Error("User ID is null or invalid");
@@ -80,8 +84,9 @@ Ebay.prototype = {
8084
let result = JSON.parse(data);
8185
return result;
8286
}, console.error
83-
)},
84-
87+
)
88+
},
89+
8590
setAccessToken: function (token) {
8691

8792
this.options.access_token = token;

src/request.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ let getRequest = function getRequest(url) {
1212
});
1313
res.on("end", () => {
1414
resolve(body);
15-
1615
});
1716
});
1817
})
@@ -33,7 +32,7 @@ let makeRequest = function postRequest(hostName, endpoint, methodName, data, tok
3332
}
3433
};
3534
return new Promise(function (resolve, reject) {
36-
var req = httpRequest.request(options, res => {
35+
const req = httpRequest.request(options, res => {
3736
res.setEncoding("utf8");
3837
let body = "";
3938
res.on("data", data => {

src/taxonomy-api.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const getCategorySubtree = function (categoryTreeId, categoryId) {
5050
/**
5151
* @method getCategorySuggestions {Function}
5252
* @param {String} categoryTreeId = identifier of the category at the top of the subtree.
53-
* @param {String} keyword = input string to get CategorySuggestions.
53+
* @param {String} keyword = input string to get CategorySuggestions.
5454
*/
5555

5656
const getCategorySuggestions = function (categoryTreeId, keyword) {
@@ -66,7 +66,7 @@ const getCategorySuggestions = function (categoryTreeId, keyword) {
6666
/**
6767
* @method getItemAspectsForCategory {Function}
6868
* @param {String} categoryId = identifier of the category at the top of the subtree.
69-
* @param {String} keyword = input string to get CategorySuggestions.
69+
* @param {String} keyword = input string to get CategorySuggestions.
7070
*/
7171
const getItemAspectsForCategory = function (categoryTreeId, categoryId) {
7272
if (!categoryTreeId) categoryTreeId = 0;

0 commit comments

Comments
 (0)