javascript - Prevent old style function declaration -


i want forbid old style function declarations , non-binding method declarations:

function f1() { ... } const f2 = function() { ... } class c {   f3() { ... } } 

instead arrow-style constants , fields must used:

const f1 = () => { ... }; class c {   f3 = () => { ... }; } 

is possible eslint or plugin?

check this out, there prefer-arrow-callback rule.


Comments

Popular posts from this blog

sql - Time in datatime field -

javascript - How to split the success output from an Ajax post? -

java - sharing object across different classes -