import { IRuleOption , IFinalConfig , TDynamicObj , TRuleOptionVal } from '../../typings' ; export const createRuleConfig = ( finalConfig , key ? ) : IRuleOption => { const config = { params : { ... finalConfig . params } , browsers : { ... finalConfig . browsers } , option : { } , } ; if ( key ) { config . option = finalConfig . rules [ key ] [ 1 ] as TDynamicObj < TRuleOptionVal > ; } return config ; } ;