JSCS modifications to one-var
See original GitHub issueStarting to migrate from JSCS/JSHint and I was looking for the equivalent of requireMultipleVarDecl
Unfortunately one-var
doesn’t cover this, as it prevents multiple variable declarations in a single scope. I’m looking for allowing multiple variables throughout the scope, but preventing consecutive var declarations.
Invalid:
var a = 0
var b = 1
var c = 2
console.log('hello')
var d
var e
Valid:
var a = 0
, b = 1
, c = 2
console.log('hello')
var d, e
<bountysource-plugin>
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource. </bountysource-plugin>
Issue Analytics
- State:
- Created 8 years ago
- Comments:33 (28 by maintainers)
Top Results From Across the Web
Changelog - JSCS
There are a lot of internal changes but we like to keep this changelog short ... rule: fix more weird onevar constructs and...
Read more >How to add JSCS to your pre-commit hook - NextRoll
Here's how we added JSCS, a JavaScript style checker, to our git ... if you're OK with declaring multiple variables with one var...
Read more >Switched from JSCS to ESLint - horizon - OpenDev
This patch switches horizon from using JSCS to using ESlint. It adds the john papa style guides as an eslint plugin, and deactivates...
Read more >jscs - npm
jscs is a code style linter for programmatically enforcing your style guide. You can configure jscs for your project in detail using over...
Read more >require or disallow newlines around variable declarations ...
require or disallow newlines around variable declarations (one-var-declaration-per-line). Some developers declare multiple var statements on the same line:.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Now, I have a question.
I feel it’s the responsibility of
vars-on-top
rule.Maybe
consecutive
instead ofneighbor
?