Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 14 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The eslint config that we use at [Etch](https://etch.co)
## Install

```bash
npm i -D eslint@^9.0.0 prettier @etchteam/eslint-config eslint-plugin-react eslint-plugin-jsx-a11y
npm i -D eslint@^9.0.0 prettier @etchteam/eslint-config eslint-plugin-react eslint-plugin-jsx-a11y eslint-plugin-storybook
```

## Usage
Expand All @@ -27,7 +27,7 @@ For projects that don't need the full config, use environment-specific imports t
### Next.js

```bash
npm i -D eslint prettier @etchteam/eslint-config eslint-plugin-react eslint-plugin-jsx-a11y @next/eslint-plugin-next eslint-plugin-react-hooks
npm i -D eslint prettier @etchteam/eslint-config eslint-plugin-react eslint-plugin-jsx-a11y eslint-plugin-storybook @next/eslint-plugin-next eslint-plugin-react-hooks
```

```javascript
Expand All @@ -51,7 +51,7 @@ export default nodejs;
### Angular

```bash
npm i -D eslint prettier @etchteam/eslint-config angular-eslint
npm i -D eslint prettier @etchteam/eslint-config eslint-plugin-storybook angular-eslint
```

```javascript
Expand All @@ -63,7 +63,7 @@ export default angular;
### Preact

```bash
npm i -D eslint prettier @etchteam/eslint-config eslint-plugin-react eslint-plugin-jsx-a11y
npm i -D eslint prettier @etchteam/eslint-config eslint-plugin-react eslint-plugin-jsx-a11y eslint-plugin-storybook
```

```javascript
Expand All @@ -75,7 +75,7 @@ export default preact;
### Web Components (Lit)

```bash
npm i -D eslint prettier @etchteam/eslint-config eslint-plugin-lit
npm i -D eslint prettier @etchteam/eslint-config eslint-plugin-storybook eslint-plugin-lit
```

```javascript
Expand Down Expand Up @@ -138,29 +138,24 @@ export default [
| `web-components` | base + json + yaml + storybook + Lit rules |
| `nestjs` | base + json + yaml + NestJS rules + Jest globals |

### Required Plugins
### Required Peer Dependencies

The **base**, **json**, **yaml**, and **storybook** modules have all their plugins included as package dependencies — no extra installs needed.
The **base**, **json**, and **yaml** modules have all their plugins included as package dependencies — no extra installs needed.

Environment-specific configs require additional plugins to be installed as peer dependencies:
Other configs require additional plugins to be installed as peer dependencies:

| Config | Additional plugins to install |
|--------|-------------------------------|
| Default (`@etchteam/eslint-config`) | `eslint-plugin-react` `eslint-plugin-jsx-a11y` |
| Default (`@etchteam/eslint-config`) | `eslint-plugin-react` `eslint-plugin-jsx-a11y` `eslint-plugin-storybook` |
| `react` | `eslint-plugin-react` `eslint-plugin-jsx-a11y` |
| `nextjs` | `eslint-plugin-react` `eslint-plugin-jsx-a11y` `@next/eslint-plugin-next` `eslint-plugin-react-hooks` |
| `storybook` | `eslint-plugin-storybook` |
| `nextjs` | `eslint-plugin-react` `eslint-plugin-jsx-a11y` `eslint-plugin-storybook` `@next/eslint-plugin-next` `eslint-plugin-react-hooks` |
| `nodejs` | None |
| `preact` | `eslint-plugin-react` `eslint-plugin-jsx-a11y` |
| `angular` | `angular-eslint` |
| `web-components` | `eslint-plugin-lit` |
| `preact` | `eslint-plugin-react` `eslint-plugin-jsx-a11y` `eslint-plugin-storybook` |
| `angular` | `eslint-plugin-storybook` `angular-eslint` |
| `web-components` | `eslint-plugin-storybook` `eslint-plugin-lit` |
| `nestjs` | `@darraghor/eslint-plugin-nestjs-typed` |

For example, to use the Next.js config:

```bash
npm i -D eslint prettier @etchteam/eslint-config eslint-plugin-react eslint-plugin-jsx-a11y @next/eslint-plugin-next eslint-plugin-react-hooks
```

## With lint-staged

### New project
Expand Down
Loading
Loading