我遇到流程错误:
从未类型化的模块中导入类型使其变为
any
,而不是 安全!您是要在// @flow
的顶部添加../types
吗? (untyped-type-import
)
这是'../types'文件中的一些代码。
// @flow
import type { Account } from '../../props/account'
import type { Accrual } from '../../props/accrual-prop'
import type { Amount } from '../../props/amount'
import type { Customer } from '../../props/customer'
import type { PaymentTerms } from '../../props/payment-terms'
import type { NumberSeries } from '../../props/number-series'
import type { SalesDocumentLock } from '../../props/lock-prop'
export type Status = 'invoice'|'order'|'offer'
export type CustomerContact = {
customerContactNumber: number,
name: string,
}
export type Employee = {
self?: ?string,
employeeNumber: number,
name: string,
}
export type AdditionalExpenseLine = {
additionalExpense: {
additionalExpenseNumber: number,
name: string,
isSystemCreated: boolean
},
vatAccount: VATAccount,
vatAmount?: ?number,
amount?: number,
grossAmount?:number,
isExcluded: boolean,
salesPricesEnteredInGross : boolean,
vatRate?:number,
additionalExpenseType: AdditionalExpenseType
}
答案 0 :(得分:0)
我有一个类似的问题,似乎是由于两个导出功能引起的:
export function foo() {}
还有一个
module.exports = { ... }
。
一旦我摆脱了export function
声明,问题就消失了。 (我的文件中有很多export type
条语句,它们很好。)