# @clearc2/eslint-config-c2-react

> An ESLint Shareable Config for React/JSX support in JavaScript Standard Style

Latest version **3.0.2** (published 2022-03-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install @clearc2/eslint-config-c2-react
pnpm add @clearc2/eslint-config-c2-react
yarn add @clearc2/eslint-config-c2-react
bun add @clearc2/eslint-config-c2-react
```

## 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 | 3.0.2 |
| Published | 2022-03-29 |
| First published | 2019-04-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 10 |
| Unpacked size | 269.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Clear C2, Inc. |
| Maintainers | kevinbull, dadamssg, c2builds |
| Keywords | eslint, standard, react |

## Links

- npm: https://www.npmjs.com/package/@clearc2/eslint-config-c2-react
- Repository: https://github.com/ClearC2/eslint-config-c2-react
- Homepage: https://github.com/ClearC2/eslint-config-c2-react#readme
- Issues: https://github.com/ClearC2/eslint-config-c2-react/issues
- npm.io page: https://npm.io/package/@clearc2/eslint-config-c2-react

## Dependencies (10)

- [eslint](https://npm.io/package/eslint.md) ^8.7.0
- [eslint-plugin-node](https://npm.io/package/eslint-plugin-node.md) ^11.1.0
- [eslint-plugin-react](https://npm.io/package/eslint-plugin-react.md) ^7.28.0
- [@babel/eslint-parser](https://npm.io/package/@babel/eslint-parser.md) ^7.16.5
- [eslint-plugin-import](https://npm.io/package/eslint-plugin-import.md) ^2.25.4
- [eslint-plugin-promise](https://npm.io/package/eslint-plugin-promise.md) ^6.0.0
- [eslint-config-standard](https://npm.io/package/eslint-config-standard.md) ^16.0.3
- [eslint-plugin-react-hooks](https://npm.io/package/eslint-plugin-react-hooks.md) ^4.3.0
- [eslint-config-standard-jsx](https://npm.io/package/eslint-config-standard-jsx.md) ^10.0.0
- [eslint-config-standard-react](https://npm.io/package/eslint-config-standard-react.md) ^11.0.1

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 3.0.2 (latest) — 2022-03-29
- 3.0.1 — 2022-03-24
- 3.0.0 — 2022-03-24
- 2.0.8 — 2020-02-10
- 2.0.7 — 2019-08-05
- 2.0.6 — 2019-07-09
- 2.0.5 — 2019-06-24
- 2.0.4 — 2019-06-24
- 2.0.3 — 2019-06-24
- 2.0.2 — 2019-05-06
- 2.0.1 — 2019-05-03
- 2.0.0 — 2019-04-08
- 1.5.0 — 2019-04-04

## README

# eslint-config-c2-react

An ESLint Shareable Config for React/JSX support in JavaScript Standard Style

## Pre Install

If your project already has an eslint ruleset that you're converting, remove all dependencies related to linting and git hooks from your `package.json` file. Example:

```sh
yarn remove husky babel-eslint eslint \
eslint-plugin-import eslint-plugin-node \
eslint-plugin-promise eslint-plugin-react \
eslint-plugin-standard
```

You may have references to other `eslint-config-*` and `eslint-plugin-*` packages. Remove those as well.

Remove your existing pre-commit hook if you have have one.
```sh
rm -rf .git/hooks/pre-commit
```

## Install
```sh
# for yarn
yarn add -D @clearc2/eslint-config-c2-react

# for npm
npm install -D @clearc2/eslint-config-c2-react
```

## Configure eslint
Create an `.eslintrc.json` file in the root of your project with the following contents:

```json
{
    "extends": [
      "@clearc2/c2-react"
    ]
}
```

Create an `.eslintignore` file with files and folders that should **not** be linted. Example:
```
docs/
src/index.ejs
lib/
dist/
```

## Configure the pre-commit hook
Use `lint-staged`'s [automatic setup to install](https://github.com/okonet/lint-staged#installation-and-setup).
```
npx mrm@2 lint-staged
```
Add a file pattern to your `package.json`.
```
"lint-staged": {
  "src/**/*.js": "eslint"
},
```
The above will lint all `.js` file anywhere within and below the `src` directory.

## Tips
You can always lint your files before you attempt to commit. Example:

```sh
./node_modules/.bin/eslint src/module/Component.js
```

You can also have eslint attempt to fix your files according to the ruleset:

```sh
./node_modules/.bin/eslint --fix src/module/Component.js
# or a directory
./node_modules/.bin/eslint --fix src/module
```

This will catch and fix most of the issues. You will most likely still need to go into the file(s)
to correct what eslint couldn't do automatically. It will show warnings of the problems that still exist after
a fix command is run.

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