@sencha/extjs/override-method-call
Report the usage of a override method
Rule Details
This rule will report when the override method is being called.
In this example, Ext.override()
and this.override()
is being called. This rule reports this problem regardless of extjs
settings so any value can be used for the fromVersion
and the toVersion
. In fact, these settings can be left off entirely and just the version
setting used.
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",
"version": "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/override-method-call": "warn"
}
}
JavaScript
// Calling Ext.override() directly
Ext.override(panel, {
initComponent: function () {
this.callParent();
}
});
// Calling this.override() directly
Ext.define('MyCustomClass', {
extend: 'Ext.Component',
constructor: function () {
this.override({
alignTo: function () {}
});
this.callParent();
}
});
Problem Messages reported by ESLint
Call to 'Ext.override()' method found
Call to 'this.override()' method found