# @wistia/eslint-config

Wistia's ESLint configuration. This repo is "pseudo-public" - private on our org, and [pushed to NPM](https://www.npmjs.com/package/@wistia/eslint-config) for ease of distribution.

## How to install

`yarn add -D @wistia/eslint-config`

## Guidelines for adding new rules

1. preference given for autofixable rules; for non-autofixable rules consider seeking consensus from co-workers (open a PR on this repo and ask for feedback in #engineering-general!)
2. should not contradict existing rules
3. person/team adding new rules handles upgrading consumers and fixing violations
4. rules should always be set to `error`, never `warn` (the latter are never fixed)
5. add short description of rule & link to rule definition in code comments

## Configs

configs are additive, so start with a base config, either `@wistia/eslint-config` or `@wistia/eslint-config/typescript` and then apply further configs as desired.

## Philosophy & Principles

- **Always Error, Never Warn:** Warnings become background noise that developers tune out. A rule should either flag a real problem or stay silent.
- **Strict, Consistent Code Style:** Where there's more than one way to do something, this configuration picks the strictest and most uniform option, favoring modern syntax and established best practices.
- **Fast:** Known performance-heavy rules are skipped.
- **Don't get in the way:** Rules that involve style preferences are intentionally disabled as this is best left to a formatter like `prettier`. Whenever possible, rules that can auto-fix are chosen to minimize friction and save developer time.
