• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#  No decorators except ArkUI decorators are currently allowed
2
3Rule ``arkts-no-decorators-except-arkui``
4
5**Severity: warning**
6
7Currently, only ArkUI decorators are allowed  in the ArkTS.
8Any other decorator will cause a compile-time error.
9
10
11## TypeScript
12
13
14```
15
16    function classDecorator(x: any, y: any): void {
17        //
18    }
19
20    @classDecorator
21    class BugReport {
22    }
23
24
25```
26
27## ArkTS
28
29
30```
31
32    function classDecorator(x: any, y: any): void {
33        //
34    }
35
36    @classDecorator // compile-time error: unsupported decorator
37    class BugReport {
38    }
39
40```
41
42
43