TSLint:JavaScript map.set()函数抛出无骨干获取设置外模型错误

问题描述 投票:0回答:1

我正在使用Microsoft的tslint-microsoft-contrib修复皮棉错误。它引发以下错误,我认为是错误警报。

Backbone set() called outside of owning model

var mapSet = new Map();
mapSet.set('base', {     
            id: 'base',
            label: 'label',
            type: 'type'
        }); // Error shown here: Backbone set() called outside of owning model: mapSet.set('base'...) (no-backbone-get-set-outside-model)

有什么办法解决这个问题?

javascript typescript tslint
1个回答
0
投票

根据thistslint-microsoft-contrib问题评论,您所提及的规则是tslint-microsoft-contrib特有的规则,如果您不使用Backbone,则可以在Backbone.js中将其禁用。

© www.soinside.com 2019 - 2024. All rights reserved.