Closed jamesdixon closed 8 years ago
Do you have code example?
Yes, I ran JSCS against this file:
'use strict';
// Load modules
const Boom = require('boom');
const Code = require('code');
const Hapi = require('hapi');
const Hoek = require('hoek');
const Lab = require('lab');
// Test shortcuts
const lab = exports.lab = Lab.script();
const before = lab.before;
const describe = lab.describe;
const it = lab.it;
const expect = Code.expect;
describe('appointments', () => {
let server;
before((done) => {
require('../server')((err, srv) => {
if (err) throw err;
server = srv;
done();
});
});
describe('GET /appointments/{id}', () => {
const url = '/appointments/1';
describe('with no/invalid credentials', () => {
const payload = {
method: 'GET',
url: url,
};
it('CANNOT retrieve an appointment', (done) => {
server.inject(payload, (res) => {
expect(res.statusCode).to.equal(401);
done();
});
});
});
});
});
Running JSCS 2.11.0.
it seems requireNewlineBeforeSingleStatementsInIf
rule doesn't work with single if
branches, i added a guard for it, but it seems it should also warn for that case too -
if (err) throw err;
/cc @schempy
Hi,
I'm getting the following error when running
--fix
on one of my files:My
.jscsrc
file is pretty simple:Thanks in advance!