jscs-dev / node-jscs

:arrow_heading_up: JavaScript Code Style checker (unmaintained)
https://jscs-dev.github.io
MIT License
4.96k stars 510 forks source link

disallowNewlineBeforeBlockStatements dose not apply for class blocks #2004

Closed Bnaya closed 8 years ago

Bnaya commented 8 years ago

disallowNewlineBeforeBlockStatements is ignoring class declarations

class 
{
func() {
}
}

will pass lint with disallowNewlineBeforeBlockStatements: true

markelog commented 8 years ago

Would be cool to have, would you like to try to implement it?

Bnaya commented 8 years ago

I can try to, where i should start?

markelog commented 8 years ago

We have more or less extensive guide - https://github.com/jscs-dev/node-jscs/blob/master/CONTRIBUTING.md, but whole architecture of jscs is pretty simple.

Nevertheless, if you have any questions don't hesitate to ask

Bnaya commented 8 years ago

I'm looking for a straightforward way to debug node cli tools, i'm having trouble to do so with node-inspector

Also i don't see console.logs i put in the sourcecode of node-jscs

markelog commented 8 years ago

If your console statements are in some parts of the tests, they might be omitted, due to stubbing - https://github.com/jscs-dev/node-jscs/blob/365569a60bb6b908f27b151f55a9b0d9418fdfd8/test/specs/cli.js#L27-L28

But it is probably not your case. Hard to come up with the other hypothesis without seeing any code, as you might imagine. For most cases console output should be there.

node-inspector or iron-node might be useful, but usually not as much.

Bnaya commented 8 years ago

Eventually node-debug $(which jscs) file.js done the trick, its just takes long time to start

Bnaya commented 8 years ago

@markelog it was pretty simple to implement, tell me if its looks ok https://github.com/jscs-dev/node-jscs/compare/master...Bnaya:disallowNewlineBeforeBlockStatements-class?expand=1

We will need update the docs about the new block type My tests have parse error and i'm not sure why

 parseError: Unexpected token {
markelog commented 8 years ago

Send us a pull request and we will go from there

Bnaya commented 8 years ago

@markelog I'm not on the contributors list any idea why? (just wondering :)) https://github.com/jscs-dev/node-jscs/graphs/contributors

markelog commented 8 years ago

github has a limit for this page, which is hundred, we have more then a hundred contributors, so anyone else that has less then couple commits might not gonna appear there.

In other words, just send us another PR :-).