-
Notifications
You must be signed in to change notification settings - Fork 26.8k
Description
My quest for less clutter continues (#695)
meteor/javascript has a clever solution for rule linking, they inline the eslint logo and link to the rule.
I propose we adopt a similar style but with links at the end.
Current
-
2.1 Use
constfor all of your references; avoid usingvar. eslint:prefer-const,no-const-assignWhy? This ensures that you can't reassign your references, which can lead to bugs and difficult to comprehend code.
// bad var a = 1; var b = 2; // good const a = 1; const b = 2;
-
2.2 If you must reassign references, use
letinstead ofvar. eslint:no-varjscs:disallowVarWhy?
letis block-scoped rather than function-scoped likevar.
Proposal
-
2.1 Use
constfor all of your references; avoid usingvar.Why? This ensures that you can't reassign your references, which can lead to bugs and difficult to comprehend code.
// bad var a = 1; var b = 2; // good const a = 1; const b = 2;
-
2.2 If you must reassign references, use
letinstead ofvar.Why?
letis block-scoped rather than function-scoped likevar.