# @waldronmatt/eslint-config

> A shareable eslint configuration for projects.

Latest version **1.5.16** (published 2023-11-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install @waldronmatt/eslint-config
pnpm add @waldronmatt/eslint-config
yarn add @waldronmatt/eslint-config
bun add @waldronmatt/eslint-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.5.16 |
| Published | 2023-11-03 |
| First published | 2021-12-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 14 |
| Unpacked size | 8.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 15 |
| Author | Matthew Waldron |
| Maintainers | waldronmatt |
| Keywords | eslint, eslint-config |

## Links

- npm: https://www.npmjs.com/package/@waldronmatt/eslint-config
- Repository: https://github.com/waldronmatt/shareable-configs
- Homepage: https://github.com/waldronmatt/shareable-configs/tree/main/packages/eslint-config#readme
- Issues: https://github.com/waldronmatt/shareable-configs/issues
- npm.io page: https://npm.io/package/@waldronmatt/eslint-config

## Dependencies (14)

- [eslint-plugin-jest](https://npm.io/package/eslint-plugin-jest.md) ^27.0.4
- [eslint-plugin-import](https://npm.io/package/eslint-plugin-import.md) ^2.26.0
- [eslint-plugin-promise](https://npm.io/package/eslint-plugin-promise.md) ^6.0.1
- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) ^0.21.0
- [eslint-plugin-unicorn](https://npm.io/package/eslint-plugin-unicorn.md) ^46.0.0
- [eslint-config-prettier](https://npm.io/package/eslint-config-prettier.md) ^8.5.0
- [eslint-plugin-jest-dom](https://npm.io/package/eslint-plugin-jest-dom.md) ^4.0.2
- [eslint-plugin-prettier](https://npm.io/package/eslint-plugin-prettier.md) ^4.2.1
- [eslint-plugin-security](https://npm.io/package/eslint-plugin-security.md) ^1.5.0
- [@typescript-eslint/parser](https://npm.io/package/@typescript-eslint/parser.md) ^5.38.1
- [eslint-config-airbnb-base](https://npm.io/package/eslint-config-airbnb-base.md) ^15.0.0
- [eslint-plugin-jest-formatting](https://npm.io/package/eslint-plugin-jest-formatting.md) ^3.1.0
- [eslint-config-airbnb-typescript](https://npm.io/package/eslint-config-airbnb-typescript.md) ^17.0.0
- [@typescript-eslint/eslint-plugin](https://npm.io/package/@typescript-eslint/eslint-plugin.md) ^5.38.1

## 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
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 1.5.16 (latest) — 2023-11-03
- 1.5.15 — 2023-04-09
- 1.5.14 — 2023-04-09
- 1.5.13 — 2023-02-10
- 1.5.12 — 2023-02-10
- 1.5.11 — 2022-11-25
- 1.5.10 — 2022-11-25
- 1.5.9 — 2022-11-01
- 1.5.8 — 2022-10-23
- 1.5.7 — 2022-10-01
- 1.5.6 — 2022-09-17
- 1.5.5 — 2022-09-15
- 1.5.4 — 2022-09-03
- 1.5.3 — 2022-08-01
- 1.5.2 — 2022-07-01
- … 24 more at https://npm.io/package/@waldronmatt/eslint-config/versions

## README

# Eslint Config

My personal shareable eslint configuration.

## Install

```bash
yarn add -D eslint @waldronmatt/eslint-config
```

## Usage

**`.eslintrc.js`**

### JS

```js
module.exports = {
  extends: '@waldronmatt/eslint-config',
};
```

### TS

```js
module.exports = {
  extends: '@waldronmatt/eslint-config/ts',
};
```

### Jest

```js
module.exports = {
  extends: '@waldronmatt/eslint-config/jest',
};
```

## Extending

An example configuring a mixed JS/TS, `tsconfig`-compatible configuration.

**`.eslintrc.js`**

```js
module.exports = {
  // ignore linting in dist bundle output folder
  ignorePatterns: ['dist/**'],
  // enable global variables
  env: {
    browser: true,
    node: true,
    jest: true,
  }
  overrides: [
    {
      files: ['**/*.ts'],
      extends: [
        '@waldronmatt/eslint-config/ts',
        // add jest linting
        '@waldronmatt/eslint-config/jest',
      ],
      parserOptions: {
        project: 'tsconfig.json',
        tsconfigRootDir: __dirname,
      },
    },
    {
      files: ['**/*.js'],
      extends: [
        '@waldronmatt/eslint-config',
        // add jest linting
        '@waldronmatt/eslint-config/jest',
      ],
    },
  ],
};
```

## Add an NPM Script

Running this command:

```bash
npm set-script lint:js "eslint --fix **/*.{js,jsx,ts,tsx}"
```

Will create:

**`package.json`**

```json
"scripts": {
  "lint:js": "eslint --fix **/*.{js,jsx,ts,tsx}"
},
```

## Add a Pre-commit Hook

**`lint-staged.config.js`**

```js
module.exports = {
  '*.{js,jsx,ts,tsx}': ['prettier --cache --write', 'eslint --cache --fix'],
};
```

## Under The Hood

### `index.js`

- Plugins
  - `eslint-plugin-prettier`
- Parser
  - default `eslint` parser
- Extends
  - `eslint-plugin-unicorn`
  - `eslint-plugin-promise`
  - `eslint-plugin-sonarjs`
  - `eslint-plugin-security`,
  - default `eslint` ruleset
  - `eslint-config-airbnb-base`
  - `eslint-config-prettier`
- Rules
  - [Prettier Special Rules](https://github.com/prettier/eslint-config-prettier#special-rules)
  - Other rules can be found in the config

### `ts.js`

- Plugins
  - `@typescript-eslint/eslint-plugin`
  - `eslint-plugin-prettier`
- Parser
  - `@typescript-eslint/parser`
- Extends
  - `eslint-plugin-unicorn`
  - `eslint-plugin-promise`
  - `eslint-plugin-sonarjs`
  - `eslint-plugin-security`,
  - `@typescript-eslint/eslint-plugin`
  - `eslint-config-airbnb-typescript`
  - `eslint-config-prettier`
- Rules
  - [Prettier Special Rules](https://github.com/prettier/eslint-config-prettier#special-rules)
  - Other rules can be found in the config

### `jest.js`

- Plugins
  - `jest`
  - `jest-dom`
  - `jest-formatting`
- Extends
  - `plugin:jest/recommended`
  - `plugin:jest-dom/recommended`
  - `plugin:jest-formatting/recommended`

## License

MIT

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