diff --git a/README.md b/README.md index 09aeee4d34..662ce0465f 100644 --- a/README.md +++ b/README.md @@ -1587,6 +1587,16 @@ Other Style Guides console.log(foo[0]); ``` + - [18.11](#18.11) Add spaces inside curly braces. + + ```javascript + // bad + const foo = {clark: 'kent'}; + + // good + const foo = { clark: 'kent' }; + ``` + **[⬆ back to top](#table-of-contents)** ## Commas diff --git a/packages/eslint-config-airbnb/rules/style.js b/packages/eslint-config-airbnb/rules/style.js index 0b6fad09c4..90e5aae3b9 100644 --- a/packages/eslint-config-airbnb/rules/style.js +++ b/packages/eslint-config-airbnb/rules/style.js @@ -66,8 +66,8 @@ module.exports = { 'no-underscore-dangle': 0, // disallow the use of Boolean literals in conditional expressions 'no-unneeded-ternary': 0, - // require or disallow padding inside curly braces - 'object-curly-spacing': 0, + // require padding inside curly braces + 'object-curly-spacing': [2, 'always'], // allow just one var statement per function 'one-var': [2, 'never'], // require assignment operator shorthand where possible or prohibit it entirely