silverstripe-framework/.eslintrc
Ingo Schommer 7bc6f3ee9f Enforce JS var declaration with value (#5993)
This caught us out recently where code did a strict type check for `myVar === undefined`.
The var was defined as `let myVar;`, without a value - so the check returned false (it's `null`).
To avoid this situation, we've decided to enforce declarations with values.
Note that preference should be given to single, immutable assignments via const where possible.

See http://eslint.org/docs/rules/init-declarations
2016-09-13 11:02:15 +12:00

10 lines
107 B
Plaintext

{
"extends": "airbnb",
"env": {
"jasmine": true
},
"rules": {
"init-declarations": 1
}
}