Skip to content

Linters, anyone? #706

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dead-claudia opened this issue Jul 7, 2015 · 8 comments
Closed

Linters, anyone? #706

dead-claudia opened this issue Jul 7, 2015 · 8 comments

Comments

@dead-claudia
Copy link
Member

I think it would be fantastic if Mithril was actually covered by a linter. I have no religious objection to any linter, as long as it parses JavaScript, but things like #662 are easily preventable with a linter.

Other things I've noticed:

// In
if (foo) {
  var bar = doA();
} else if (baz) {
  var bar = doB(baz);
} else {
  var bar = doC();
}

// Out
var bar=foo?doA():baz?doB(baz):doC();
@dead-claudia dead-claudia changed the title Linter ideas Linters, anyone? Jul 7, 2015
@kaukas
Copy link

kaukas commented Jul 9, 2015

+1.

Actually +10! Automatic JSHint and JSCS checking helps clean up code and simplifies contributions. And please add CodeClimate to that.

I do not think suggestions by these tools should be followed religiously. But having some agreed conventions for a widely used library is way better than having none.

Is help needed to set these up?

@dead-claudia
Copy link
Member Author

And another complete WTF: a ternary using logical operators instead of a ternary operator. I'm at a loss for words on this one...

@dead-claudia
Copy link
Member Author

@kaukas It would result in a long series of commits + quite a few PRs running into merge conflicts for the short term, and it's not a small operation. I'll ping @lhorie here.

@dead-claudia
Copy link
Member Author

And these two tests fail if a triple-equals is used.

@elektronik2k5
Copy link

+1

@dead-claudia
Copy link
Member Author

@lhorie said in the gitter room that he was planning on hooking up his rewrite (which will feature multiple breaking API changes) with JSHint.

@maranomynet
Copy link
Contributor

+1 for linting!

@dead-claudia
Copy link
Member Author

Fixed with #822, #828.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants