HubSpot's ESLint configurations
// npm
$ npm install --save-dev eslint eslint-config-hubspot eslint-plugin-react
// yarn
$ yarn add eslint eslint-config-hubspot eslint-plugin-react --dev
For the esnext
version or if you are using newer syntax, you'll also need Babel's ESLint parser:
//npm
$ npm install --save-dev babel-eslint
// yarn
$ yarn add babel-eslint --dev
This will let you use ES2016 features like async
/await
and decorators. For a full list of features see Babel's experimental features and their Learn ES2015.
Add ESLint configurations to your package.json
:
{
"eslintConfig": {
"extends": "hubspot" // or "hubspot/esnext"
}
}
Or .eslintrc*
:
{
"extends": "hubspot" // or "hubspot/esnext"
}
MIT © HubSpot