# eslint-config

ESLint [shareable config](http://eslint.org/docs/developer-guide/shareable-configs.html) for all Brickblock JavaScript projects


## Prerequisites
You will need the env variable `BRICKBLOCK_NPM_TOKEN` to be able to use the packages from our private npm registry. Easiest option would be to add it to your local shell (e.g. via `.bashrc`, `.bash_profile`, `.zshrc` etc.)

You can find the token in our 1password vault "dev-shared" in the npm entry.

```sh
# .bashrc
 export BRICKBLOCK_NPM_TOKEN=<our-dev-npm-token>
```

## How to use this package?

1. **Install Package**

    ```sh
    yarn add --dev @brickblock/eslint-config
    ```

1. **Install Peer Dependencies**

    ```sh
    export PKG=@brickblock/eslint-config;
    npm info "$PKG@latest" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs yarn add --dev "$PKG@latest"
    ```

1. **Use Package**

Once `@brickblock/eslint-config` is installed, you can use it by adding it to the [`extends`](http://eslint.org/docs/user-guide/configuring#extending-configuration-files) section of your [ESLint configuration](http://eslint.org/docs/user-guide/configuring).

```js
/* .eslintrc.js */

module.exports = {
  extends: '@brickblock/eslint-config'
}
```