getify / eslint-plugin-proper-arrows

ESLint rules to ensure proper arrow function definitions
MIT License
308 stars 14 forks source link

Add ternary `? :` to the list forbidden of concise return expressions #13

Closed getify closed 5 years ago

getify commented 5 years ago
var f = x => x > 10 ? x < 100 ? x : x / 2 : x + 1;  // ugh

This rule will have a depth level for ternaries... default to 0 meaning "no ternaries allowed", but 1 would mean one level of ternary, 2 would mean two (nested), etc.