@sencha/extjs/no-private-method-call
Report the calling of a private method
Rule Details
This rule will report when a private method is being called.
In this example, createWidget
is a private method of the Ext
Class and has been around since version 4. And _hasIcon
is a private method of the Ext.button.Button
Class and has been around since version 5. A problem will be reported when calling either of these methods when the fromVersion
is >= 4 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-call": "warn"
}
}
JavaScript
Ext.createWidget('button', {})._hasIcon();
Problem Messages reported by ESLint
Call to private method 'createWidget' found for 'Ext'
Call to private method '_hasIcon' found for 'Ext.button.Button'