@sencha/extjs/no-private-property-usage
Report the usage of a private property
Rule Details
This rule will report when a private property is being used.
In this example, the complete
property is a private property of the Ext.data.Batch Class that was introduced in version 5 and is still a private property as of the latest version. Therefore, this problem will only be reported if the fromVersion
in the extjs settings is set to >= 5 and the toVersion
is also set to >= 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": 5,
"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-property-usage": "warn"
}
}
JavaScript
Ext.define('MyCustomDataBatch', {
extend: 'Ext.data.Batch',
runOperation: function () {
this.complete = true;
}
});
Problem Message reported by ESLint
Usage of private property 'complete' found for 'Ext.data.Batch'