# @miwebb/eslint-config

> miWebb shared linting config

Latest version **0.1.0-preview.5** (published 2021-12-07) · ISC license · 0 weekly downloads

## Install

```sh
npm install @miwebb/eslint-config
pnpm add @miwebb/eslint-config
yarn add @miwebb/eslint-config
bun add @miwebb/eslint-config
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0-preview.5 |
| Published | 2021-12-07 |
| First published | 2021-12-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 62.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | miWebb |
| Maintainers | miwebb |
| Keywords | eslint, eslintconfig, prettier |

## Links

- npm: https://www.npmjs.com/package/@miwebb/eslint-config
- npm.io page: https://npm.io/package/@miwebb/eslint-config

## Dependencies (5)

- [eslint-plugin-import](https://npm.io/package/eslint-plugin-import.md) ^2.25.3
- [eslint-config-prettier](https://npm.io/package/eslint-config-prettier.md) ^8.3.0
- [eslint-plugin-prettier](https://npm.io/package/eslint-plugin-prettier.md) ^4.0.0
- [@miwebb/prettier-config](https://npm.io/package/@miwebb/prettier-config.md) latest
- [eslint-config-airbnb-base](https://npm.io/package/eslint-config-airbnb-base.md) ^15.0.0

## 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

- 0.1.0-preview.5 (latest) — 2021-12-07
- 0.1.0-preview.4 — 2021-12-07

## README

# miWebb shared linting config

To use the config run

```shell
yarn add --dev eslint prettier @miwebb/eslint-config
# OR
npm install --save-dev eslint prettier @miwebb/eslint-config
```

After that, create a new `.eslintrc` file with the following contents:

```json
{
  "extends": ["@miwebb"]
}
```

Add a prettier key to your `package.json`:

```json
{
  // ...
  "prettier": "@miwebb/prettier-config",
  // ...
}
```

Finally, add some simple linting helpers in your `package.json`:

```json
{
  // ...
  "scripts": {
    "lint": "eslint .",
    "lint:fix": "eslint . --fix"
    // ... other scripts
  }
}
```

You can then run `yarn lint` (or `npm run lint`) to run and report all linting errors.
Some of these errors (such as indentation, etc.) can be automagically fixed for you.
Run `yarn lint:fix` (or `npm run lint:fix`) to do so. 

Formatting will extend @miwebb/prettier-config (to be completed).

## Environments

Some of our projects will run in environments that will have globals defined.
Our linting config will complain about that unless you tell it otherwise.

First, common environments can be enabled in the `.eslintrc` under the env key.
For example, to assume common browser globals are enabled use:

```json
{
  "extends": ["@miwebb"],
  "env": {
    "browser": true
  }
}
```

For a complete list of environments, consult the [eslint documentation](https://eslint.org/docs/user-guide/configuring/language-options#specifying-environments).

## Globals

For globals that are not part of environments, such as the `wp` global in wordpress,
you can add custom global variables to the `.eslintrc` using the "globals" key:

```json
{
  "extends": ["@miwebb"],
  "globals": {
    "wp": "readonly",
    "someOtherGlobal": "writable" // or `true`
  }
}
```

Globals marked as readonly will raise errors if they are overwritten later, 
so try to mark globals accordingly.
Again, consult the [eslint documentation](https://eslint.org/docs/user-guide/configuring/language-options#specifying-globals) for more information.

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