Skip to content

Commit

Permalink
feat: more better docs
Browse files Browse the repository at this point in the history
  • Loading branch information
stabback committed Oct 25, 2024
1 parent 76b9ea3 commit 9aa2d3d
Showing 1 changed file with 43 additions and 23 deletions.
66 changes: 43 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,66 @@
# eslint-plugin-6river

set of 6river eslint plugins
A set of ESLint plugins and configurations used by 6river.

## Installation

You'll first need to install [ESLint](http://eslint.org):
First, install [ESLint](http://eslint.org):

```
$ npm i eslint --save-dev
```sh
npm install eslint --save-dev
```

Next, install `eslint-plugin-6river`:
Then, install `eslint-plugin-6river`:

```
$ npm install eslint-plugin-6river --save-dev
```sh
npm install eslint-plugin-6river --save-dev
```

**Note:** If you installed ESLint globally (using the `-g` flag) then you must also install
**Note:** If you installed ESLint globally (using the `-g` flag), you must also install
`eslint-plugin-6river` globally.

## Usage

Add `6river` to the plugins section of your `.eslintrc` configuration file. You can omit the
`eslint-plugin-` prefix:
This plugin requires ESLint 9 or later.

You can use this plugin with pre-set configurations, or you can configure it yourself.

### Pre-set Configurations

#### Node & Mocha

```js
import eslintPlugin6river from 'eslint-plugin-6river';

```json
{
"plugins": ["6river"]
}
export default [...eslintPlugin6river['node-mocha']];
```

Then configure the rules you want to use under the rules section.
#### Browser & Jest

```js
import eslintPlugin6river from 'eslint-plugin-6river';

export default [...eslintPlugin6river['browser-jest']];
```

### Custom Configuration

```js
import eslintPlugin6river from 'eslint-plugin-6river';

```json
{
"rules": {
"6river/rule-name": 2
}
}
export default [
{
plugins: {
'6river': eslintPlugin6river,
},
rules: {
'6river/rule-name': 'error',
},
},
];
```

## Supported Rules

- new-cap - same as eslint core rule but adds @ prefix to decorator function while parsed to make it
easy to apply regex rules for all decorators.
- **new-cap**: Similar to the ESLint core rule but adds an `@` prefix to decorator functions, making
it easier to apply regex rules to all decorators.

0 comments on commit 9aa2d3d

Please sign in to comment.