@sencha/extjs/no-existing-class-override
Report the overriding of a Class
Rule Details
This rule will report when a Class is being overridden.
In this example, the Ext.panel.Panel Class is being overridden by using an override
config. 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/no-existing-class-override": "warn"
}
}
JavaScript
Ext.define('MyCustomClass', {
override: 'Ext.panel.Panel',
setHtml: function () {
// custom processing
this.callParent(arguments);
}
});
Problem Message reported by ESLint
Override of Class 'Ext.panel.Panel' found