diff --git a/packages/eslint-config-airbnb/rules/best-practices.js b/packages/eslint-config-airbnb/rules/best-practices.js index eaf6ddbb..ea1b4366 100644 --- a/packages/eslint-config-airbnb/rules/best-practices.js +++ b/packages/eslint-config-airbnb/rules/best-practices.js @@ -37,6 +37,14 @@ module.exports = { 'no-div-regex': 0, // disallow else after a return in an if 'no-else-return': 2, + // disallow empty functions, except for standalone funcs/arrows + // http://eslint.org/docs/rules/no-empty-function + 'no-empty-function': [2, { + 'allow': [ + 'functions', + 'arrowFunctions', + ] + }], // disallow Unnecessary Labels // http://eslint.org/docs/rules/no-extra-label 'no-extra-label': 2, diff --git a/packages/eslint-config-airbnb/test/test-react-order.js b/packages/eslint-config-airbnb/test/test-react-order.js index 1e6dd660..e3e4cfbd 100644 --- a/packages/eslint-config-airbnb/test/test-react-order.js +++ b/packages/eslint-config-airbnb/test/test-react-order.js @@ -23,6 +23,7 @@ function wrapComponent(body) { return ` import React from 'react'; export default class MyComponent extends React.Component { +/* eslint no-empty-function: 0 */ ${body} } `;