# setup-airbnb-config

> Bootstraps your VSCode project with Airbnb's eslint configuration together with Prettier through a CLI.

Latest version **1.1.0** (published 2022-01-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install setup-airbnb-config
pnpm add setup-airbnb-config
yarn add setup-airbnb-config
bun add setup-airbnb-config
```

Provides the command `setup-airbnb-config`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2022-01-26 |
| First published | 2021-06-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 14.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Christopher Af Bjur |
| Maintainers | christopherafbjur |
| Keywords | cli, setup-airbnb-config, prettier, eslint, airbnb |

## Links

- npm: https://www.npmjs.com/package/setup-airbnb-config
- Repository: https://github.com/christopherafbjur/setup-airbnb-config
- Homepage: https://github.com/christopherafbjur/setup-airbnb-config#readme
- Issues: https://github.com/christopherafbjur/setup-airbnb-config/issues
- npm.io page: https://npm.io/package/setup-airbnb-config

## Dependencies (8)

- [arg](https://npm.io/package/arg.md) ^5.0.0
- [esm](https://npm.io/package/esm.md) ^3.2.25
- [ncp](https://npm.io/package/ncp.md) ^2.0.0
- [chalk](https://npm.io/package/chalk.md) ^4.1.1
- [execa](https://npm.io/package/execa.md) ^5.0.0
- [listr](https://npm.io/package/listr.md) ^0.14.3
- [inquirer](https://npm.io/package/inquirer.md) ^8.1.0
- [path-parse](https://npm.io/package/path-parse.md) ^1.0.7

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@pandacss/eslint-plugin](https://npm.io/package/@pandacss/eslint-plugin.md) — 18.7K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2022-01-26
- 1.0.5 — 2021-06-03
- 1.0.4 — 2021-06-03
- 1.0.3 — 2021-06-03
- 1.0.2 — 2021-06-03
- 1.0.1 — 2021-06-03

## README

# setup-airbnb-config

Bootstraps your [VSCode](https://code.visualstudio.com/) project with [Airbnb's eslint configuration](https://www.npmjs.com/package/eslint-config-airbnb) together with [Prettier](https://prettier.io/) through a CLI.

This CLI will will try to automatically detect wether you're using `yarn` or `npm` in your project before installing the dependencies and Airbnb peer dependencies. It will also create a `.vscode/settings.json` file and enable `formatOnSave` which is useful for overriding your global settings for this local project. If this file already exist in your project, the setting will be added to it.

## Installation

1. Install [Eslint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) and [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) extensions in VSCode.
2. Now simply run the CLI followed by the project path to bootstrap:

```bash
  npx setup-airbnb-config .
```

3. Select the desired project type (Javascript or React).

## Usage

```bash
npx setup-airbnb-config <path> [--options]
```

### Options

| Flag               | Description                                           |
| :----------------- | :---------------------------------------------------- |
| `-j, --javascript` | Generates a JS configuration.                         |
| `-r, --react`      | Generates a React configuration.                      |
| `--npm`            | Enforce npm to be used when installing dependencies.  |
| `--yarn`           | Enforce yarn to be used when installing dependencies. |

### Examples

```bash
npx setup-airbnb-config ./myProject -r --yarn
```

Creates a react configuration and enforce yarn to be used when installing dependencies.

```bash
npx setup-airbnb-config . --javascript --npm
```

Creates a vanilla JS configuration and enforce npm to be used when installing dependencies.

```
npx setup-airbnb-config ~/myProject
```

Runs the CLI and asks you the required questions such as project type and preferred package manager if automatic detection fails.

## FAQ

#### I'm seeing an error "Missing package.json"

Your project needs at least a package.json at the same level as `npx setup-airbnb-config` is run in order to install the required dependencies.

#### What package manager is used for installing required dependencies?

The CLI will try to automatically detect which package manager you're using. If it cannot be determined, the CLI will ask you which package manager you want to use.

## Contributing

Contributions are always welcome!

File an issue or create a pull request if you find something that can be enhanced.

## Related

- ESLint Rules - https://eslint.org/docs/rules/
- Prettier Options - https://prettier.io/docs/en/options.html
- Airbnb Style Guide - https://github.com/airbnb/javascript

## License

[![MIT License](https://img.shields.io/github/license/christopherafbjur/setup-airbnb-config)](https://github.com/christopherafbjur/setup-airbnb-config/blob/main/LICENSE)

---
_Source: https://npm.io/package/setup-airbnb-config · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
