diff --git a/README.md b/README.md index ab8b9b28ae..8f24a95fc1 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ Other Style Guides 1. [Accessors](#accessors) 1. [Events](#events) 1. [jQuery](#jquery) + 1. [Line length](#line-length) 1. [ECMAScript 5 Compatibility](#ecmascript-5-compatibility) 1. [ECMAScript 6 Styles](#ecmascript-6-styles) 1. [Testing](#testing) @@ -1986,16 +1987,35 @@ Other Style Guides **[⬆ back to top](#table-of-contents)** +## Line length + + - [26.1](#26.1) Avoid very long lines of code longer than 100 characters. + + > Why? This ensures readability and maintainability. + + ```javascript + // bad + var foo = { bar: "This is a bar.", baz: { "qux": "This is a qux" }, difficult: "to read" }; + + // good + var foo = { + bar: "This is a bar.", + baz: { + qux: "This is a qux" + }, + difficult: "to read" + }; + ``` ## ECMAScript 5 Compatibility - - [26.1](#26.1) Refer to [Kangax](https://twitter.com/kangax/)'s ES5 [compatibility table](http://kangax.github.com/es5-compat-table/). + - [27.1](#27.1) Refer to [Kangax](https://twitter.com/kangax/)'s ES5 [compatibility table](http://kangax.github.com/es5-compat-table/). **[⬆ back to top](#table-of-contents)** ## ECMAScript 6 Styles - - [27.1](#27.1) This is a collection of links to the various es6 features. + - [28.1](#28.1) This is a collection of links to the various es6 features. 1. [Arrow Functions](#arrow-functions) 1. [Classes](#constructors) @@ -2015,7 +2035,7 @@ Other Style Guides ## Testing - - [28.1](#28.1) **Yup.** + - [29.1](#29.1) **Yup.** ```javascript function() { diff --git a/packages/eslint-config-airbnb/base/index.js b/packages/eslint-config-airbnb/base/index.js index ee578638f0..83fa0989ff 100644 --- a/packages/eslint-config-airbnb/base/index.js +++ b/packages/eslint-config-airbnb/base/index.js @@ -83,6 +83,7 @@ module.exports = { }], 'eqeqeq': 2, // http://eslint.org/docs/rules/eqeqeq 'guard-for-in': 2, // http://eslint.org/docs/rules/guard-for-in + 'max-len': [2, 100, 4] // http://eslint.org/docs/rules/max-len 'no-caller': 2, // http://eslint.org/docs/rules/no-caller 'no-else-return': 2, // http://eslint.org/docs/rules/no-else-return 'no-eq-null': 2, // http://eslint.org/docs/rules/no-eq-null