Home > @lynx-js/rspeedy > Decorators > version

Decorators.version property

Specify the decorator syntax version to be used.

Signature:

version?: 'legacy' | '2022-03';

Remarks

If you want to know the differences between different decorators versions, you can refer to: How does this proposal compare to other versions of decorators?

Example 1

'2022-03' corresponds to the Stage 3 decorator proposal, equivalent to the decorator syntax supported by TypeScript 5.0 by default.

import { defineConfig } from '@lynx-js/rspeedy'

export default defineConfig({
  source: {
    decorators: { version: '2022-03' },
  },
})

Example 2

'legacy' corresponds to TypeScript's experimentalDecorators: true.

import { defineConfig } from '@lynx-js/rspeedy'

export default defineConfig({
  source: {
    decorators: { version: 'legacy' },
  },
})
Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.