eslint-config-brainspace

1.1.1 • Public • Published

eslint-config-brainspace

This ESLint config extends Airbnb's config.

Differences from Airbnb

Variables

  • no-unused-vars - reset back to the ESLint default, no options
  • no-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 property
  • no-unused-expressions - allow the use of expressions in statement position

Style

  • camelcase - always require camelcase for properties
  • indent - enable the SwitchCase option to indent case statements
  • no-unexpected-multiline - prevent problems when not using semicolons
  • padded-blocks - disable this rule
  • semi - this is the big one - never use semicolons!

React

  • react/jsx-boolean-value - require values for boolean JSX attributes
  • react/jsx-quotes - require double quotes for JSX attributes
  • react/jsx-sort-prop-types - require propTypes to be sorted alphabetically
  • react/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.

  1. npm install --save-dev eslint-config-brainspace babel-eslint eslint-plugin-react eslint
  2. add "extends": "brainspace" to your .eslintrc

eslint-config-brainspace/base

Lints ES6+ but does not lint React. Requires eslint and babel-eslint.

  1. npm install --save-dev eslint-config-brainspace babel-eslint eslint
  2. add "extends": "brainspace/base" to your .eslintrc

Package Sidebar

Install

npm i eslint-config-brainspace

Weekly Downloads

1

Version

1.1.1

License

MIT

Last publish

Collaborators

  • bkonkle