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

Enforce variable declaration coding style #4610

Merged
merged 1 commit into from
Aug 3, 2017

Conversation

simonbrunel
Copy link
Member

@simonbrunel simonbrunel commented Aug 3, 2017

Long time ago we agreed on multiple variable declarations for initialized variables, however we never made this style a rule. Some of the old code still uses the one variable declaration approach, same for a few submitted PR. So for consistency, let's enable the ESLint one-var rule to require multiple variable declarations for initialized variables per scope. Uninitialized variables can still be declared together (preferred) or separately.

I think this article describes pretty well the reasons of that move.

For consistency, enable ESLint `one-var` rule to require multiple variable declarations for initialized variables per scope. Uninitialized variables can still be declared together (preferred) or separately.

http://eslint.org/docs/rules/one-var
@benmccann
Copy link
Contributor

lgtm

@simonbrunel simonbrunel merged commit 9ef5cc7 into chartjs:master Aug 3, 2017
@simonbrunel simonbrunel deleted the eslint-one-var branch August 3, 2017 16:33
yofreke pushed a commit to yofreke/Chart.js that referenced this pull request Dec 30, 2017
For consistency, enable ESLint `one-var` rule to require multiple variable declarations for initialized variables per scope. Uninitialized variables can still be declared together (preferred) or separately.

http://eslint.org/docs/rules/one-var
exwm pushed a commit to exwm/Chart.js that referenced this pull request Apr 30, 2021
For consistency, enable ESLint `one-var` rule to require multiple variable declarations for initialized variables per scope. Uninitialized variables can still be declared together (preferred) or separately.

http://eslint.org/docs/rules/one-var
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants