open-index/open-npm huggingface dataset:
npm package: @openweb3-io/eslint-config
Description: OpenWeb3 Common ESLint Configs
Author: AI
Latest version: 1.0.0

# OpenWeb3 ESLint Config

This package provides OpenWeb3's eslint extensible shared config.

## Usage

### Install

```bash
pnpm i -D eslint @openweb3-io/eslint-config
```

And create eslint.config.mjs in your project root:

- for typescript only project:

```javascript
import eslint from "@openweb3-io/eslint-config";

export default [...eslint.recommended.typescript];
```

- for typescript & react project:

```javascript
import eslint from "@openweb3-io/eslint-config";

export default [...eslint.recommended.react];
```

### Add script for package.json

```json
{
  "scripts": {
    "lint": "eslint",
    "lint-fix": "eslint --fix"
  }
}
```

### Customization

You can easily customize the config, for example:

```javascript
import eslint from "@openweb3-io/eslint-config";
import storybook from "eslint-plugin-storybook";

export default [
  ...eslint.recommended.react,
  ...storybook.configs["flat/recommended"],
  {
    languageOptions: {
      parserOptions: {
        projectService: {
          allowDefaultProject: [".storybook/*.ts"],
        },
      },
    },
    rule: {
      "no-console": ["warn", { allow: ["warn", "error"] }],
      "i18next/no-literal-string": "off",
      "@typescript-eslint/no-explicit-any": "off",
    },
  },
];
```