【发布时间】:2019-11-05 09:50:49
【问题描述】:
我在流程中遇到错误:
从无类型模块导入类型使其成为
any,而不是 安全的!您的意思是在../types的顶部添加// @flow吗? (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
}
【问题讨论】:
-
到目前为止,您采取了哪些修复措施?如果不查看更多文件或有关错误的更多信息,很难判断出了什么问题。显然,您在此文件的顶部有
// @flow,因此 Flow 推荐的明显修复不适用。
标签: javascript reactjs flowtype