Skip to content
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

Linting: Force splitting variable declaration for initialized vars #211

Merged
merged 1 commit into from
Nov 20, 2017
Merged

Conversation

friday
Copy link
Contributor

@friday friday commented Nov 20, 2017

Eslint will now warn if declaring multiple variables in the same statement, except if all of them are uninitialized. For example, this is still valid:

var testContainer, para0, para1, para2;

(There are a lot of these in the test specs and splitting them up isn't necessarily better imo)

@LeaVerou LeaVerou merged commit 3c5daf9 into LeaVerou:gh-pages Nov 20, 2017
@LeaVerou
Copy link
Owner

I'm not so sure about this, but since very little of Bliss had to be changed to follow it, eh, merging.

Thanks!

@friday
Copy link
Contributor Author

friday commented Nov 20, 2017

I probably misinterpreted the conversation: #209 (comment). Anyway, don't be afraid to reject my PR's in cases like this.

@friday friday deleted the one-var branch November 20, 2017 04:35
@LeaVerou
Copy link
Owner

To clarify that comment, I meant that things like this should be valid:

var a = 5, b = 8, c;

but things like this should not be:

var a = 5,
    b = 8,
    c;

@friday
Copy link
Contributor Author

friday commented Nov 20, 2017

I see! Perhaps I'm thinking "inside the box" when it comes to eslint-rules.

The one-var rule doesn't support this distinction I'm afraid.

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

Successfully merging this pull request may close these issues.

2 participants