AArtem UdovichenkoAdd ets2panda
0ee26c4f创建于 2023年10月10日历史提交

import statements after other statements are not allowed

Rule arkts-no-misplaced-imports

Severity: error

In ArkTS, all import statements should go before all other statements in the program.

TypeScript


    class C {
        s: string = ""
        n: number = 0
    }

    import foo from "module1"

ArkTS


    import foo from "module1"

    class C {
        s: string = ""
        n: number = 0
    }