Browse Source

tools: disallow mixed spaces and tabs for indents

Enable eslint rule disallowing mixing tabs and spaces for indentation.
Modify the one file that had been mixing tabs and spaces.

PR-URL: https://github.com/nodejs/node/pull/5135
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
v5.x
Rich Trott 9 years ago
committed by Rod Vagg
parent
commit
86f8477b56
  1. 2
      .eslintrc
  2. 14
      test/parallel/test-crypto-certificate.js

2
.eslintrc

@ -65,6 +65,8 @@ rules:
max-len: [2, 80, 2] max-len: [2, 80, 2]
## require parens for Constructor ## require parens for Constructor
new-parens: 2 new-parens: 2
## disallow mixed spaces and tabs for indentation
no-mixed-spaces-and-tabs: 2
## max 2 consecutive empty lines ## max 2 consecutive empty lines
no-multiple-empty-lines: [2, {max: 2}] no-multiple-empty-lines: [2, {max: 2}]
## no trailing spaces ## no trailing spaces

14
test/parallel/test-crypto-certificate.js

@ -22,14 +22,16 @@ var certificate = new crypto.Certificate();
assert.equal(certificate.verifySpkac(spkacValid), true); assert.equal(certificate.verifySpkac(spkacValid), true);
assert.equal(certificate.verifySpkac(spkacFail), false); assert.equal(certificate.verifySpkac(spkacFail), false);
assert.equal(stripLineEndings(certificate.exportPublicKey(spkacValid) assert.equal(
.toString('utf8')), stripLineEndings(certificate.exportPublicKey(spkacValid).toString('utf8')),
stripLineEndings(spkacPem.toString('utf8'))); stripLineEndings(spkacPem.toString('utf8'))
);
assert.equal(certificate.exportPublicKey(spkacFail), ''); assert.equal(certificate.exportPublicKey(spkacFail), '');
assert.equal(certificate.exportChallenge(spkacValid) assert.equal(
.toString('utf8'), certificate.exportChallenge(spkacValid).toString('utf8'),
'fb9ab814-6677-42a4-a60c-f905d1a6924d'); 'fb9ab814-6677-42a4-a60c-f905d1a6924d'
);
assert.equal(certificate.exportChallenge(spkacFail), ''); assert.equal(certificate.exportChallenge(spkacFail), '');
function stripLineEndings(obj) { function stripLineEndings(obj) {

Loading…
Cancel
Save