It is not worth duplicating a description of the vast number of constraints that this configuration imposes. Our advice is to configure your editor to provide instant linting feedback as you codea, and you will learn the constraints quite quickly 😜
To summarize in general the constraints that the AirBnb ESLint configuration imposes:
- ES2015/ES6 given preference over ES5 (so
- lots of general code quality/bug prevention constraints like no unused variables, no mutating arguments to functions, etc.
- React components that don't need a (substantive) constructor, any of the lifecycle methods, or component-internal state should be pure functional components instead of classes
- all React components should type-check the props used via PropTypes
We have also added an additional plug-in for enforcing a preference for lodash utility methods over their native implementations (e.g., lodash
Also see the documentation on directory structure for our conventions around file naming, placement, and in particular our semantic division between "containers" and "components."
a. And you don't even have to Google! Here's where to get started for Sublime Text and Atom. ↩