Skip to content

Commit 3c07d85

Browse files
authored
Merge pull request #443 from stripe/ob-eslint-indent
Enable indent linting rule
2 parents a4f4dbf + 835e5ed commit 3c07d85

File tree

7 files changed

+27
-27
lines changed

7 files changed

+27
-27
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ module.exports = {
6868
"id-blacklist": "error",
6969
"id-length": "off",
7070
"id-match": "error",
71-
"indent": "off",
71+
"indent": ["error", 2],
7272
"init-declarations": "off",
7373
"jsx-quotes": "error",
7474
"key-spacing": "error",

lib/Error.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ var StripeError = _Error.StripeError = _Error.extend({
5151
*/
5252
StripeError.generate = function(rawStripeError) {
5353
switch (rawStripeError.type) {
54-
case 'card_error':
55-
return new _Error.StripeCardError(rawStripeError);
56-
case 'invalid_request_error':
57-
return new _Error.StripeInvalidRequestError(rawStripeError);
58-
case 'api_error':
59-
return new _Error.StripeAPIError(rawStripeError);
60-
case 'idempotency_error':
61-
return new _Error.StripeIdempotencyError(rawStripeError);
54+
case 'card_error':
55+
return new _Error.StripeCardError(rawStripeError);
56+
case 'invalid_request_error':
57+
return new _Error.StripeInvalidRequestError(rawStripeError);
58+
case 'api_error':
59+
return new _Error.StripeAPIError(rawStripeError);
60+
case 'idempotency_error':
61+
return new _Error.StripeIdempotencyError(rawStripeError);
6262
}
6363
return new _Error('Generic', 'Unknown Error');
6464
};

lib/StripeMethod.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var OPTIONAL_REGEX = /^optional!/;
1818
*/
1919
function stripeMethod(spec) {
2020
var commandPath = typeof spec.path == 'function' ? spec.path
21-
: utils.makeURLInterpolator(spec.path || '');
21+
: utils.makeURLInterpolator(spec.path || '');
2222
var requestMethod = (spec.method || 'GET').toUpperCase();
2323
var urlParams = spec.urlParams || [];
2424
var encode = spec.encode || function(data) {return data;};

test/Webhook.spec.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,14 @@ describe('Webhooks', function() {
9898

9999
it('should return true when the header contains a valid signature and ' +
100100
'the timestamp is within the tolerance',
101-
function() {
102-
var header = generateHeaderString({
103-
timestamp: (Date.now() / 1000),
104-
});
105-
106-
expect(stripe.webhooks.signature.verifyHeader(EVENT_PAYLOAD_STRING, header, SECRET, 10)).to.equal(true);
101+
function() {
102+
var header = generateHeaderString({
103+
timestamp: (Date.now() / 1000),
107104
});
108105

106+
expect(stripe.webhooks.signature.verifyHeader(EVENT_PAYLOAD_STRING, header, SECRET, 10)).to.equal(true);
107+
});
108+
109109
it('should return true when the header contains at least one valid signature', function() {
110110
var header = generateHeaderString({
111111
timestamp: (Date.now() / 1000),
@@ -118,13 +118,13 @@ describe('Webhooks', function() {
118118

119119
it('should return true when the header contains a valid signature ' +
120120
'and the timestamp is off but no tolerance is provided',
121-
function() {
122-
var header = generateHeaderString({
123-
timestamp: 12345,
124-
});
125-
126-
expect(stripe.webhooks.signature.verifyHeader(EVENT_PAYLOAD_STRING, header, SECRET)).to.equal(true);
121+
function() {
122+
var header = generateHeaderString({
123+
timestamp: 12345,
127124
});
125+
126+
expect(stripe.webhooks.signature.verifyHeader(EVENT_PAYLOAD_STRING, header, SECRET)).to.equal(true);
127+
});
128128
});
129129
});
130130

test/flows.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ describe('Flows', function() {
367367
cleanup.deleteCustomer(cust.id);
368368
return cust;
369369
})
370-
// Confirm it's expanded by checking that some prop (e.g. exp_year) exists:
370+
// Confirm it's expanded by checking that some prop (e.g. exp_year) exists:
371371
).to.eventually.have.nested.property('default_source.exp_year');
372372
});
373373
});

test/resources/ApplicationFeeRefunds.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ var REFUND_TEST_ID = 'refundIdTest999';
99

1010
// Create new CustomerCard instance with pre-filled customerId:
1111
var appFeeRefund = new resources.ApplicationFeeRefunds(
12-
stripe,
13-
{feeId: APPFEE_TEST_ID}
12+
stripe,
13+
{feeId: APPFEE_TEST_ID}
1414
);
1515

1616
// Use spy from existing resource:

test/resources/CustomerSubscriptions.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ var CUSTOMER_TEST_ID = 'customerIdTest999';
88

99
// Create new CustomerSubscription instance with pre-filled customerId:
1010
var customerSubscription = new resources.CustomerSubscriptions(
11-
stripe,
12-
{customerId: CUSTOMER_TEST_ID}
11+
stripe,
12+
{customerId: CUSTOMER_TEST_ID}
1313
);
1414

1515
// Use spy from existing resource:

0 commit comments

Comments
 (0)