open-index/open-npm huggingface dataset:
npm package: @simplo-sro/eslint-config
Description: ESLint config for Simplo projects
Latest version: 2.3.0

# eslint-config-simplo

Sharable *flat* ESLint config for Simplo projects

## Using the config

Use ESLint >= v8.45.0 for flat config support.

Install the `@simplo-sro/eslint-config` [package](https://www.npmjs.com/package/@simplo-sro/eslint-config).

### For Webpack / Vite

For shop admin / themes

Import the config package:
```js
const simploConfig = require('@simplo-sro/eslint-config');
```

(or with ESM syntax)
```js
import simploConfig from '@simplo-sro/eslint-config';
```

Then append the generated config from this package, as such:
```js
...simploConfig.createConfig({ projectType: 'webpack-vite' }),
```

### Nuxt

Use the [ESLint module](https://eslint.nuxt.com/packages/module).

Generate the config with `withNuxt()`, passing this package's config as such:
```js
import simploConfig from '@simplo-sro/eslint-config';

export default withNuxt(
    ...simploConfig.createConfig({ projectType: 'nuxt' }),
)
```
This will first generate the config for your Nuxt project, then overrides it with rules generated in this config package.

Nuxt ESLint plugin will import ESLint plugins by default, and since those plugins are already imported in this config, this will lead to duplicate imports - to which, ESLint will respond with a crash.
So, don't forget to add this to the root of your `nuxt.config.ts`
```ts
eslint: {
    config: {
        standalone: false,
    }
},
```

## Configurations

This config is split into multiple sub-configs in `/configurations`:
- `base`
    - `simplo/base` - overrides for ESLint recommended rules
    - `simplo/base/formatting` - rules for formatting/style from `@stylistic/eslint-plugin`
- `vue` - Overrides for `flat/recommended` rules from `eslint-plugin-vue`
- `typescript` - Typescript specific rules (includes rules ported over from `@nuxtjs/eslint-config-typescript`) and overrides for `tseslint.configs.recommended` from `typescript-eslint`
- `tailwind` - Overrides for `flat/recommended` rules from `eslint-plugin-tailwindcss`

## Linting the config

This config is self-linting:
```sh
npm run lint
npm run lint:fix
```