@sencha/extjs/no-deprecated-method-call
Report the calling of a deprecated method
Rule Details
This rule will report when a deprecated method is being called.
In this example, we are calling the setText
method of the Ext.toolbar.TextItem
Class, which was deprecated in 5.1
. So upgrading from a prior version to a version greater than 5.1
will cause this problem to be reported.
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-deprecated-method-call": "warn"
}
}
JavaScript
// setText is a deprecated method of Ext.toolbar.TextItem
Ext.define('Ext.ux.desktop.TrayClock', {
extend: 'Ext.toolbar.TextItem',
updateTime: function () {
var me = this;
me.setText(text);
}
});
Problem Message reported by ESLint
Call to deprecated method 'setText' found for 'Ext.toolbar.TextItem'