Improve CS: declare variables individually - #3213
Conversation
|
According to https://eslint.org/docs/latest/rules/one-var the default for "one-var" is 'always' (you removed the one-var declaration in eslintrc) and "always" means to not declare each variable by a separate var/let/const .... |
|
You are right, I corrected the 1st commit title to mention "never". AirBnB/Unicorn default is newly used and the reasons why explained in the PR description. |
857e2df to
0238ddc
Compare
|
PR is done. I fixes the semicolon placements using regex manually, as |
|
Again, please rebase / resolve conflicts, as i just merged your other PR #3215 🙂 |
regex: (\n *(let|const|var))\n *
regex: ((?<=\n) *(let|const|var)) /
regex: (\n *(let|const|var)((?!//).)*)\n *(;\n)
regex: (\n((?!/).)*)\n *(;\n\n)
regex: \n *(;\n\n)
regex: ((?:\n|^) *(let|const|var))\n *
regex: (?<=\n)( +(?! )).*(?<!{)\n(?!\1(?! )) *(/\*|//)
|
Let's please merge this PR before anything else to prevent conflicts. I did a verification by replacing |


This is default and prefered style beause:
varis used historically, my plan is to land this PR, and then detect not-redeclared variables and declare then usinglet/const