open-index/open-npm huggingface dataset:
npm package: @ivao/eslint-config
Description: IVAO ESLint config
Author: IVAO
Latest version: 2.0.0

# IVAO ESLint config

This package is a shared configuration file for ESLint.
To use this config, follow the installation instructions.

## Installation

Install the following packages:

- `eslint`
- `@ivao/eslint-config`

`npm add --save-dev eslint @ivao/eslint-config` or `yarn add -D eslint @ivao/eslint-config` or `pnpm add -D eslint @ivao/eslint-config`

### `eslint.config.(m)js`

You must add a `eslint.config.(m)js` file to your project to use this config package:

```js
import ivaoConfig from '@ivao/eslint-config';

export default [
  ...ivaoConfig.configs.base,
  ...ivaoConfig.configs.prettier,
  {
    languageOptions: {
      parserOptions: {
        projectService: {
          allowDefaultProject: ['eslint.config.(m)js'],
        },
        // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
        tsconfigRootDir: import.meta.dirname,
      },
    },
  },
];
```

## Usage

The package provides 5 configuration presets and 2 setups.

### `configs`

#### `base`

The base configuration for all projects.

#### `prettier`

Enables the prettier plugin.

#### `react`

Enables many React ESLint plugins. Checkout `src/react.ts` for more information. _Tip: you can always disable some specific rules in your [`eslint.config.(m)js`](#eslintconfigmjs) file by appending a new block to the export array in which you can overwrite any settings._

#### `storybook`

Enables rules and plugins for storybook development

For this config to work, you need to manually install the plugin `eslint-plugin-storybook` in your project.
The reason is a dependency tree that includes `storybook` in most installations, which is only wanted in specific projects.

#### `tailwind`

Enables ESLint rules for TailwindCSS.

> This rule is not enabled automatically, because at time of writing, the eslint tailwind plugin does not support tailwind v4.

##### Installation

> _Works for tailwind v3 only!_

```js
import ivaoConfig from '@ivao/eslint-config';
import ivaoTaliwindConfig from '@ivao/eslint-config';

export default [
  // ...
  ...ivaoTaliwindConfig,
  // ...
];
```

### `setups`

#### `reactRecommended`

The setup enables the configs `base`, `prettier`, `react`.

#### `reactRecommendedNoPrettier`

The setup enables the configs `base`, `react`.
npm package: @ivao/prettier-config
Description: IVAO prettier config
Author: IVAO
Latest version: 1.2.0

# IVAO Prettier config

This package is a shared configuration file for Prettier.
To use this config, follow the installation instructions.

## Installation

Install the following packages:

- `prettier`
- `@ivao/prettier-config`
- `@ianvs/prettier-plugin-sort-imports`
- `prettier-plugin-tailwindcss`

NPM:
```sh
npm add --save-dev prettier @ivao/prettier-config @ianvs/prettier-plugin-sort-imports prettier-plugin-tailwindcss
```

Yarn:
```sh
yarn add -D prettier @ivao/prettier-config @ianvs/prettier-plugin-sort-imports prettier-plugin-tailwindcss
```

PNPM:
```sh
pnpm add -D prettier @ivao/prettier-config @ianvs/prettier-plugin-sort-imports prettier-plugin-tailwindcss
```

### package.json

You can add the following to your `package.json` file to use this config:

```json
"prettier": "@ivao/prettier-config",
```

Using this setup, you cannot modify anything.

### .prettierrc

You can add a `.prettierrc` file to your project to use this config:

```
"@ivao/prettier-config"
```

Using this setup, you cannot modify anything.

### .prettierrc

You can add a `.prettierrc` file to your project to use this config:

```js
const ivaoPrettierConfig = require('@ivao/prettier-config');
const generateImportOrder = require('@ivao/prettier-config/generateImportOrder');

module.exports = generateImportOrder(['@components', '', '@lib', '@config']);
```

#### `generateImportOrder`

`generateImportOrder` takes two arguments and returns a prettier config object.

##### First argument: `importOrder`

`importOrder` is an array of strings.
Each string is a path to a directory or a regex.
The order of the strings in the array is the order in which the imports will be sorted.
Consult the docs of the `@ianvs/prettier-plugin-sort-imports` package for more information.

##### Second argument: `overwrite`

`overwrite` is a boolean value.
If `true`, the `importOrder` array will overwrite the default import order.
Otherwise, the `importOrder` array will be merged into the default import order.

## Ignore files

It is recommended to ignore files from formatting. Do this using the `.prettierignore` file.