# @open-xchange/linter-presets

This package provides configuration presets for [ESLint](https://eslint.org/) and [StyleLint](https://stylelint.io/), including wrappers for various linter plugins.

## ESLint

The module `eslint` exports a `defineConfig` function for setting up the entire project (e.g. TypeScript files, JSON files, license headers, etc.), and a set of environment presets that apply more ESLint plugins and rules to a specific subset of the project (e.g. browser code, unit test code, etc.).

_Usage example:_

```ts
// eslint.config.ts
import { defineConfig, env } from '@open-xchange/linter-presets/eslint'

export default defineConfig(

  // required parameter: global project configuration
  { /* config options */ },

  // add environments
  env.browser({ files: ['src/**/*.js'], /* ... */ }),
  env.vitest({ files: ['test/**/*.js'], /* ... */ }),

  // add custom configurations
  { /* ... */ },
)
```

See the [`eslint` module documentation](./docs/eslint/README.md) for more details.

## StyleLint

The module `stylelint` exports a `defineConfig` function for setting up the entire project (e.g. CSS files, SCSS files, license headers, etc.).

_Usage example:_

```ts
// stylelint.config.js
import { defineConfig } from '@open-xchange/linter-presets/stylelint'

export default defineConfig({
  /* config options */
})
```

See the [`stylelint` module documentation](./docs/stylelint/README.md) for more details.
