mirror of
https://github.com/airbnb/javascript.git
synced 2026-01-14 07:47:54 -05:00
[guide] Add ESlint rules to 'always use const' and 'decriptive variable names' topics
This commit is contained in:
@@ -1299,7 +1299,7 @@ Other Style Guides
|
||||
## Variables
|
||||
|
||||
<a name="variables--const"></a><a name="13.1"></a>
|
||||
- [13.1](#variables--const) Always use `const` to declare variables. Not doing so will result in global variables. We want to avoid polluting the global namespace. Captain Planet warned us of that.
|
||||
- [13.1](#variables--const) Always use `const` to declare variables. Not doing so will result in global variables. We want to avoid polluting the global namespace. Captain Planet warned us of that. eslint: [`no-undef`](http://eslint.org/docs/rules/no-undef) [`prefer-const`](http://eslint.org/docs/rules/prefer-const)
|
||||
|
||||
```javascript
|
||||
// bad
|
||||
@@ -2327,7 +2327,7 @@ Other Style Guides
|
||||
## Naming Conventions
|
||||
|
||||
<a name="naming--descriptive"></a><a name="22.1"></a>
|
||||
- [22.1](#naming--descriptive) Avoid single letter names. Be descriptive with your naming.
|
||||
- [22.1](#naming--descriptive) Avoid single letter names. Be descriptive with your naming. eslint: [`id-length`](http://eslint.org/docs/rules/id-length)
|
||||
|
||||
```javascript
|
||||
// bad
|
||||
|
||||
Reference in New Issue
Block a user