@sencha/extjs/no-private-class-usage
Report the usage of a private Class
Rule Details
This rule will report when a private Class is being used.
In this example, Ext.AbstractManager
is a private Class that has been available since version 4 and Ext.util.GroupCollection
is a private Class that has been available since version 5. So if used together, with a desired toVersion
of latest
, a problem will be reported for each usage.
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-class-usage": "warn"
}
}
JavaScript
// Ext.AbstractManager is a private Class
var MyCustomClass = Ext.extend(Ext.AbstractManager, {
customProp: true
});
// Ext.util.GroupCollection is a private Class
Ext.create({
xclass: 'Ext.util.GroupCollection'
});
Problem Messages reported by ESLint
Usage of private Class 'Ext.AbstractManager' found.
Usage of private Class 'Ext.util.GroupCollection' found.