Skip to content

Commit

Permalink
fix: improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
simonkoeck committed Nov 4, 2024
1 parent 3e87c19 commit 465fe4e
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,23 @@ npm install @shipsecure/eslint-plugin-next --save-dev

## Usage

### Basic Configuration
### Flat config (requires eslint >= v8.23.0)

To start using the plugin in your Next.js project, add `@shipsecure/eslint-plugin-next` to your ESLint configuration file (e.g., `.eslintrc.js`):
Add the following to your `eslint.config.js` file:

```javascript
module.exports = {
extends: [
"eslint:recommended",
"plugin:@shipsecure/next/recommended", // Use the recommended configuration
],
plugins: ["@shipsecure/next"],
};
const shipsecureNext = require("@shipsecure/eslint-plugin-next");

module.exports = [shipsecureNext.configs.recommended];
```

### Custom Configuration
### eslintrc config (deprecated)

If you want to enable or disable specific rules, add them to the rules section in your ESLint configuration:
Add the following to your `.eslintrc` file:

```javascript
module.exports = {
plugins: ["@shipsecure/next"],
rules: {
"@shipsecure/next/no-open-redirects": "error",
// Add other rules here
},
extends: ["plugin:shipsecure-next/recommended-legacy"],
};
```

Expand Down

0 comments on commit 465fe4e

Please sign in to comment.