@sencha/extjs/no-removed-method-call
Report the calling of a removed method
Rule Details
This rule will report when a removed method is being called.
In this example, addEvents
existed in version 4 of the framework but was removed in version 5. Therefore, this problem will only be reported if the fromVersion
in the extjs settings is set to < 5 and the toVersion
is set to >= 5.
ESLint Config
{
"plugins": [
"@sencha/extjs"
],
"extends": [
// this rule is in the recommended configuration list
// so including this line enables this rule
"plugin:@sencha/extjs/recommended"
],
"settings": {
"extjs": {
"toolkit": "classic",
"fromVersion": 4,
"toVersion": 'latest'
}
},
"rules": {
// optionally, you can specify the rule explicitly
// and the errorlevel and any options set here
// will override any defaults from the 'extends' section
"@sencha/extjs/no-removed-method-call": "error"
}
}
JavaScript
Ext.define('MyCustomComponent', {
extend: 'Ext.panel.Panel',
initComponent: function(){
var me = this;
me.addEvents('drop');
me.callParent();
}
});
Problem Message reported by ESLint
Call to removed method 'addEvents' found for 'Ext.panel.Panel'