Repository navigation
Кодгайд Академии по JS - #11
Merged
Merged
Conversation
…е практики в коде
zeckson
self-requested a review
April 4, 2017 19:55
zeckson
suggested changes
Apr 4, 2017
|
|
||
| ### Объявление функций | ||
| 'no-func-assign': 'error', | ||
| - Функции объявляются как функциональные выражения, а не определения функций. |
There was a problem hiding this comment.
Это правило про то, что если у тебя есть вот такая функция:
function myFunc() {};и ты присваиваешь переменно myFunc что-то другое, то это скорее всего ошибка:
myFunc = {name: 'Вот такое вот говно'};| #### Блоки кода отделяются двумя пробелами | ||
| Код внутри блока отбивается двумя пробелами относительно начала блока. | ||
| Правило работает даже внутри кода с другим отступом. | ||
| ```diff |
| ``` | ||
|
|
||
| ```diff | ||
| + document.querySelectorAll('button'). |
| пробелов сделает отступ неотличимым при быстром чтении кода от отступа | ||
| у вложенного блока. | ||
|
|
||
| ```diff |
|
|
||
| Такой же перенос можно использовать в проверке условий (`if`, `while`). | ||
|
|
||
| ```diff |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Формализация правил из ESLint'a академии в виде внятных объяснений, почему используется то или иное правило.