# Environment `env.decorators`

Creates configuration objects to add support for native decorators to JavaScript source files.
Does not affect TypeScript source files which use an own parser aware of the decorator syntax.

Adds the following plugins:

- [@babel/eslint-parser](https://www.npmjs.com/package/@babel/eslint-parser)
- [@babel/plugin-proposal-decorators](https://babeljs.io/docs/babel-plugin-proposal-decorators)

## Signature

```ts
function decorators(options: EnvDecoratorsOptions): ConfigArg
```

## Options

| Name | Type | Default | Description |
| - | - | - | - |
| `basePath` | `string` | `'.'` | Path to a sub directory to apply the environment preset to. |
| `files` | `Array<string\|string[]>` | _required_ | Glob patterns for source files to be included. Use embedded arrays for AND patterns. |
| `ignores` | `string[]` | `[]` | Glob patterns for source files matching `files` to be ignored. |
| `rules` | `RulesConfig` | `{}` | Additional linter rules to be added to the configuration. |

## Example

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

export default defineConfig(

  // project configuration options
  { /* ... */ },

  // decorators environment
  env.decorators({
    files: ['src/**/*.js'],
  }),
)
```
