# @prezly/eslint-config

> ESLint, Prettier and StyleLint configs used for Prezly TypeScript projects

Latest version **6.0.0** (published 2024-12-25) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 40/100 (D)** — status: stable.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 6.0.0 |
| Published | 2024-12-25 |
| First published | 2022-02-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 18 |
| Unpacked size | 19.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Maintainers | pestaa, e1npm, makanda, digitalbase, kudlik, mohammadxali, francis-prezly, yuriyyakym |

## Links

- npm: https://www.npmjs.com/package/@prezly/eslint-config
- Repository: https://github.com/prezly/code-style
- Homepage: https://github.com/prezly/code-style#readme
- Issues: https://github.com/prezly/code-style/issues
- npm.io page: https://npm.io/package/@prezly/eslint-config

## Dependencies (18)

- [globals](https://npm.io/package/globals.md) ^15.11.0
- [@eslint/js](https://npm.io/package/@eslint/js.md) ^9.13.0
- [@eslint/compat](https://npm.io/package/@eslint/compat.md) ^1.2.3
- [typescript-eslint](https://npm.io/package/typescript-eslint.md) ^8.11.0
- [eslint-plugin-react](https://npm.io/package/eslint-plugin-react.md) ^7.37.2
- [eslint-plugin-import](https://npm.io/package/eslint-plugin-import.md) ^2.31.0
- [eslint-config-prettier](https://npm.io/package/eslint-config-prettier.md) ^9.1.0
- [eslint-plugin-jsx-a11y](https://npm.io/package/eslint-plugin-jsx-a11y.md) ^6.10.2
- [eslint-plugin-prettier](https://npm.io/package/eslint-plugin-prettier.md) ^5.2.1
- [@typescript-eslint/parser](https://npm.io/package/@typescript-eslint/parser.md) ^8.15.0
- [eslint-config-airbnb-base](https://npm.io/package/eslint-config-airbnb-base.md) ^15.0.0
- [eslint-plugin-react-hooks](https://npm.io/package/eslint-plugin-react-hooks.md) ^5.0.0
- [eslint-plugin-react-refresh](https://npm.io/package/eslint-plugin-react-refresh.md) ^0.4.14
- [eslint-plugin-sort-export-all](https://npm.io/package/eslint-plugin-sort-export-all.md) ^1.4.1
- [stylelint-config-standard-scss](https://npm.io/package/stylelint-config-standard-scss.md) ^13.1.0
- [eslint-config-airbnb-typescript](https://npm.io/package/eslint-config-airbnb-typescript.md) ^18.0.0
- [@typescript-eslint/eslint-plugin](https://npm.io/package/@typescript-eslint/eslint-plugin.md) ^8.15.0
- [eslint-import-resolver-typescript](https://npm.io/package/eslint-import-resolver-typescript.md) ^3.6.3

## Recent versions

- 6.0.0 (latest) — 2024-12-25
- 5.4.6-10 (preview) — 2024-11-19
- 5.4.6-9 — 2024-11-19
- 5.4.6-8 — 2024-11-19
- 5.4.6-7 — 2024-11-19
- 5.4.6-6 — 2024-11-19
- 5.4.6-5 — 2024-11-19
- 5.4.6-4 — 2024-11-19
- 5.4.6-3 — 2024-11-19
- 5.4.6-2 — 2024-11-19
- 5.4.6-1 — 2024-11-19
- 5.4.6-0 — 2024-11-19
- 5.4.5 — 2024-11-19
- 5.4.4 — 2024-09-12
- 5.4.3 — 2024-09-12
- … 42 more at https://npm.io/package/@prezly/eslint-config/versions

## README

Prezly code style configurations
================================

PHP Code Style checker (and fixer) is built with 
[Easy-Coding-Standard](https://github.com/symplify/easy-coding-standard).

### Usage

1. (Optional) Add prefixed ECS CLI tool into your composer requirements
   (if you're not a fan of resolving conflicts with enormous dependencies
   list of `simplify/easy-coding-standard`).
 
   ```bash
   composer require --dev symplify/easy-coding-standard-prefixed
   ```

2. Link prezly/code-style repo as composer dependency

   ```bash
   composer require prezly/code-style:~4.0
   ```

3. Include the provided configuration into your project.

   Simply create an *ecs.php* file in your project root 
   and include the *ecs.php* provided by this package into it.
   
   ```php
   <?php
    
   // Include the stock prezly/code-style config as is.
   return require __DIR__ . '/vendor/prezly/code-style/ecs.php';
   ```

4. If you need to extend or override the stock configuration, 
   you can of course do it by adding code on top of it:
   
   ```php
   <?php
   
   declare(strict_types=1);
   
   use PhpCsFixer\Fixer\Operator\BinaryOperatorSpacesFixer;
   use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
   
   return static function (ContainerConfigurator $config): void {
       // Include the stock prezly/code-style config.
       (require __DIR__ . '/vendor/prezly/code-style/ecs.php')($config);
   
       $services = $config->services();
   
       // Override stock preset configuration.
       $services->set(BinaryOperatorSpacesFixer::class)->call('configure', [
           [
               'operators' => [
                   '=>' => 'align',
               ],
           ],
       ]);
   };
   ```

5. Run checks (you can also configure your CI to run this for you on every push):

   ```bash
   vendor/bin/ecs check src/
   ```

6. Fix problems:

   ```bash
   vendor/bin/ecs check src/ --fix
   ```

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