@sencha/extjs/no-private-method-override
Report the overriding of a private method
Rule Details
This rule will report when a private method is being overridden.
In this example, getAutoId
is a private method of the Ext.Component
Class and has been around since version 4. And getActiveCounter
is a getter method generated by the framework because of the activeCounter
config starting with version 5. A problem will be reported if the fromVersion
is any version and the toVersion
is set to any value >= 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-private-method-override": "warn"
}
}
JavaScript
Ext.define('MyCustomComponent', {
extend: 'Ext.Component',
getAutoId: function () {},
getActiveCounter: function () {}
});
Problem Messages reported by ESLint
Override of private method 'getAutoId' found for 'Ext.Component'
Override of private method 'getActiveCounter', for the 'activeCounter' config, found for 'Ext.Component'