npm package: @jeffsays/lint-staged
Description: Shared lint stage configuration
Latest version: 0.0.17

[![code style: prettier][code-style]][prettier]

# Sharable `lint-staged` configuration

lint-staged:

> Run tasks like formatters and linters against staged git files and don't let 💩 slip into your code base!

- [Github][ls-github]
- [NPM Package][ls-npmjs]

## Usage

Meant for usage in conjunction with prettier, eslint & husky.

For additional information, see docs for

- [`@jeffsays/prettier`][jeffsays/prettier]

### Installation

<details><summary>npm</summary>

```shell
npm install --save-dev \
  @jeffsays/lint-staged \
  lint-staged
```

</details>

<details><summary>pnpm</summary>

```shell
pnpm add --save-dev \
  @jeffsays/lint-staged \
  lint-staged
```

</details>

<details><summary>yarn</summary>

```shell
yarn add --dev \
  @jeffsays/lint-staged \
  lint-staged
```

</details>

### Configuration

`lint-staged.config.mjs`:

<details open><summary>Basic configuration</summary>

#### javascript

```javascript
/**
 * @file - Shared configuration for lint-staged.
 * @author - Jeff Beck.
 * @ref - https://www.npmjs.com/package/lint-staged
 * @ref - https://github.com/lint-staged/lint-staged
 * @packageDocumentation - https://github.com/lint-staged/lint-staged?tab=readme-ov-file#configuration
 */

/**
 * @type  {import("lint-staged").Configuration}
 */
export { asyncConfig as default } from "@jeffsays/lint-staged";
```

#### typescript

```typescript
/**
 * @file - Shared configuration for lint-staged.
 * @author - Jeff Beck.
 * @ref - https://www.npmjs.com/package/lint-staged
 * @ref - https://github.com/lint-staged/lint-staged
 * @packageDocumentation - https://github.com/lint-staged/lint-staged?tab=readme-ov-file#configuration
 */

export { asyncConfig as default } from "@jeffsays/lint-staged";
```

</details>

<details open><summary>Overrides or additional settings may be added</summary>

#### javascript

```javascript
/**
 * @file - Shared configuration for lint-staged.
 * @author - Jeff Beck.
 * @ref - https://www.npmjs.com/package/lint-staged
 * @ref - https://github.com/lint-staged/lint-staged
 * @packageDocumentation - https://github.com/lint-staged/lint-staged?tab=readme-ov-file#configuration
 */

import { asyncConfig } from "@jeffsays/lint-staged";

/**
 * @type  {import("lint-staged").Configuration}
 */
const config: Configuration = {
  ...asyncConfig,
  // extend as-needed
};

export default config;
```

#### typescript

```typescript
/**
 * @file - Shared configuration for lint-staged.
 * @author - Jeff Beck.
 * @ref - https://www.npmjs.com/package/lint-staged
 * @ref - https://github.com/lint-staged/lint-staged
 * @packageDocumentation - https://github.com/lint-staged/lint-staged?tab=readme-ov-file#configuration
 */

import { asyncConfig } from "@jeffsays/lint-staged";
import type { Configuration } from "lint-staged";

const config: Configuration = {
  ...asyncConfig,
  // extend as-needed
};

export default config;
```

</details>

[code-style]: https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square
[prettier]: https://github.com/prettier/prettier
[jeffsays/prettier]: https://github.com/jeffsays/prettier
[ls-github]: https://github.com/lint-staged/lint-staged
[ls-npmjs]: https://www.npmjs.com/package/lint-staged/