jsstyle
jsstyle copied to clipboard
Regexes treated as comments?
Error: missing blank before close comment on:
server.all(/.*/, function (req, res, next) {
req.sdc = server.clients;
next();
});
and
server.get(/\/.*/, function (req, res) {
res.render('index');
});
The usual workaround is to add a /* JSSTYLED */ comment on the previous line (which is not to say this couldn't be improved).
This would be really nice to have fixed. This is kind of obnoxious to work around with if/else blocks of regex's. For example, each line below results in an error from jsstlye (and yes, you can use BEGIN - END, but still).
0 } else if (/^;; QUESTION SECTION:/.test(l)) {
51 section = 'question';
52 } else if (/^;; ANSWER SECTION:/.test(l)) {
53 section = 'answer';
54 } else if (/^;; ADDITIONAL SECTION:/.test(l)) {
55 section = 'additional';
56 } else if (/^;; AUTHORITY SECTION:/.test(l)) {
57 section = 'authority';
58 }
59
60 if (section === 'question') {
61 if (/^;([A-Za-z0-9])*\./.test(l)) {
62 results.question =
63 l.match(/([A-Za-z0-9_\-\.])+/)[0];
64 }
65 }
66
67 if (section === 'answer') {
68 if (/^([_A-Za-z0-9])+/.test(l)) {
69 var tokens = l.match(/(.*)/)[0].split(/\t/);