Skip to content

Кодгайд Академии по JS - #11

Merged
juwain merged 20 commits into
feature/total-destructurationfrom
feature/js-codeguide
Jul 7, 2017
Merged

juwain merged 20 commits into
feature/total-destructurationfrom
feature/js-codeguide

Conversation

@o0

@o0 o0 commented Feb 22, 2017

Copy link
Copy Markdown
Contributor

Формализация правил из ESLint'a академии в виде внятных объяснений, почему используется то или иное правило.

Comment thread app/templates/partials/js/js-rules.hbs Outdated

### Объявление функций
'no-func-assign': 'error',
- Функции объявляются как функциональные выражения, а не определения функций.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это правило про то, что если у тебя есть вот такая функция:

function myFunc() {};

и ты присваиваешь переменно myFunc что-то другое, то это скорее всего ошибка:

myFunc  = {name: 'Вот такое вот говно'};

Comment thread syntax.md
#### Блоки кода отделяются двумя пробелами
Код внутри блока отбивается двумя пробелами относительно начала блока.
Правило работает даже внутри кода с другим отступом.
```diff

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Кажется здесь diff не уместен

Comment thread syntax.md
```

```diff
+ document.querySelectorAll('button').

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Кажется здесь diff не уместен

Comment thread syntax.md
пробелов сделает отступ неотличимым при быстром чтении кода от отступа
у вложенного блока.

```diff

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Кажется здесь diff не уместен

Comment thread syntax.md

Такой же перенос можно использовать в проверке условий (`if`, `while`).

```diff

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Кажется здесь diff не уместен

@zeckson zeckson left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Кажется ```diff не очень уместен

@juwain
juwain changed the base branch from master to feature/total-destructuration July 7, 2017 13:28
@juwain
juwain merged commit 4f525b6 into feature/total-destructuration Jul 7, 2017
@juwain
juwain deleted the feature/js-codeguide branch July 7, 2017 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants