Skip to content

Commit

Permalink
add eqeq eslint rule
Browse files Browse the repository at this point in the history
  • Loading branch information
kepta authored and davidtheclark committed Jun 11, 2018
1 parent c926db0 commit 5f039f5
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
6 changes: 2 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"extends": "eslint:recommended",
"plugins": [
"node"
],
"plugins": ["node"],
"env": {
"commonjs": true,
"es6": false
Expand All @@ -15,7 +13,7 @@
},
"rules": {
"strict": ["error"],

"eqeqeq": ["error", "smart"],
"node/no-unsupported-features": ["error"],
"node/no-missing-require": "error"
},
Expand Down
5 changes: 3 additions & 2 deletions services/__tests__/matching.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ describe('getMatching', () => {
});
});

test(`it understands other coordinate properties`, () => {
test('it understands other coordinate properties', () => {
matching.getMatching({
matchPath: [
{
Expand Down Expand Up @@ -178,7 +178,8 @@ describe('getMatching', () => {
steps: true,
radiuses: ';;50;',
waypoint_names: ';;special;',
waypoints: '0;1;;3'
waypoints: '0;1;;3',
timestamps: ';;0;'
}
});
});
Expand Down
2 changes: 1 addition & 1 deletion services/directions.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Directions.getDirections = function(config) {
// avoid sending params which are all `;`
if (
directionsPath[prop].every(function(char) {
return char == '';
return char === '';
})
) {
delete directionsPath[prop];
Expand Down
6 changes: 3 additions & 3 deletions services/matching.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Matching.getMatching = function(config) {
// avoid sending params which are all `;`
if (
matchPath[prop].every(function(value) {
return value == '';
return value === '';
})
) {
delete matchPath[prop];
Expand All @@ -113,15 +113,15 @@ Matching.getMatching = function(config) {

if (
matchPath.isWaypoint.every(function(value) {
return value == true;
return value === true;
})
) {
delete matchPath.isWaypoint;
} else {
// the api requires the indexes to be sent
matchPath.isWaypoint = matchPath.isWaypoint
.map(function(val, i) {
return val == true ? i : '';
return val === true ? i : '';
})
.join(';');
}
Expand Down
2 changes: 1 addition & 1 deletion services/matrix.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Matrix.getMatrix = function(config) {

if (
matrixPath.approach.every(function(value) {
return value == '';
return value === '';
})
) {
delete matrixPath.approach;
Expand Down
2 changes: 1 addition & 1 deletion validation-lib/validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ function processMessage(message, options) {
var result = message[len - 1];
var path = message.slice(0, len - 1);

if (path.length == 0) {
if (path.length === 0) {
// Calling it value since there is no identifiable path
path = ['value'];
}
Expand Down

0 comments on commit 5f039f5

Please sign in to comment.