You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: app/templates/partials/js/js-rules.hbs
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -247,12 +247,18 @@ if (myValue === 1) {} // Хорошо
247
247
248
248
## Объявление переменных и функций
249
249
'no-var': 'error',
250
+
- При объявлении переменных предпочтение отдается ключевым словам let и const. Переменные объявляются через var только при наличии проблем с поддержкой кода.
251
+
250
252
'no-redeclare': 'error', //default
253
+
- Запрещено переопределять с помощью ключевого слова ранее созданные переменные
254
+
251
255
'one-var': ['error', {
252
256
var: 'never',
253
257
let: 'never',
254
258
const: 'never'
255
259
}],
260
+
- Запрещено использовать множественное объявление через одно ключевое слово. Для каждой переменной используется отдельный `var`, `let` или `const`.
0 commit comments