Configurable rule to Disallow Use of some native api. Sometimes you need to use the encapsulated API uniformly, such as using miniprogram-api-promise。
{
"rules": {
"ahaha-miniprogram/no-native-api": [
"error",
{
"getStorageSync": true, // equal 'disallow use of native api: wx.getStorageSync'
"navigateTo": "disallow use of native api: wx.navigateTo, use wxp.navigateTo instead" // custom message
}
]
}
}
With ["error", { "getStorageSync": true }]
, the following codes are invalid:
wx.getStorageSync('bar');
more example see tests/lib/rules/no-native-api