1.1.1 • Published 10 years ago
eslint-config-brainspace v1.1.1
eslint-config-brainspace
This ESLint config extends Airbnb's config.
Differences from Airbnb
Variables
no-unused-vars- reset back to the ESLint default, no optionsno-use-before-define- changed to a warning, added the "nofunc" option
Best Practices
dot-location- require the dot to be on the same line as the propertyno-unused-expressions- allow the use of expressions in statement position
Style
camelcase- always require camelcase for propertiesindent- enable the SwitchCase option to indent case statementsno-unexpected-multiline- prevent problems when not using semicolonspadded-blocks- disable this rulesemi- this is the big one - never use semicolons!
React
react/jsx-boolean-value- require values for boolean JSX attributesreact/jsx-quotes- require double quotes for JSX attributesreact/jsx-sort-prop-types- require propTypes to be sorted alphabeticallyreact/jsx-sort-props- require props to be sorted alphabetically
Usage
We export two ESLint configurations for your usage.
eslint-config-brainspace
Our default export contains all of our ESLint rules, including EcmaScript 6+
and React. It requires eslint, babel-eslint, and eslint-plugin-react.
npm install --save-dev eslint-config-brainspace babel-eslint eslint-plugin-react eslint- add
"extends": "brainspace"to your .eslintrc
eslint-config-brainspace/base
Lints ES6+ but does not lint React. Requires eslint and babel-eslint.
npm install --save-dev eslint-config-brainspace babel-eslint eslint- add
"extends": "brainspace/base"to your .eslintrc