Closed
Description
As per conclusions we arrived at in the January 2023 meeting
- we should allow decorators before and after
export
/export default
, but not around both. - our down-level emit and printing should preserve the ordering of where decorators are placed.
declare function decorator(...args: any[]): any;
// ✅ Works!
@decorator export class Foo {}
// ✅ Works!
export @decorator class Bar {}
// ❌ You have to pick *one or the other*.
@decorator export @decorator class Baz {}
declare function decorator(...args: any[]): any;
// ✅ Works!
@decorator export default class Foo {}
// ✅ Works!
export default @decorator class default Bar {}
// ❌ Not in between.
export @decorator default class Baz {}
// ❌ Not around both.
@decorator export default @decorator class Biz {}
// ❌ DEFINITELY not interleaved.
@decorator export @decorator default @decorator class Wat {}
Activity
[-]Remove restrictions on decorator-before-export in JavaScript files[/-][+]Preserve decorator ordering, remove restrictions on decorator-before-export in JavaScript files[/+]export
keyword dprint/dprint-plugin-typescript#495