@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

  1. {
  2. "plugins": [
  3. "@sencha/extjs"
  4. ],
  5. "extends": [
  6. // this rule is in the recommended configuration list
  7. // so including this line enables this rule
  8. "plugin:@sencha/extjs/recommended"
  9. ],
  10. "settings": {
  11. "extjs": {
  12. "toolkit": "classic",
  13. "fromVersion": 5,
  14. "toVersion": 'latest'
  15. }
  16. },
  17. "rules": {
  18. // optionally, you can specify the rule explicitly
  19. // and the errorlevel and any options set here
  20. // will override any defaults from the 'extends' section
  21. "@sencha/extjs/no-private-property-usage": "warn"
  22. }
  23. }

JavaScript

  1. Ext.define('MyCustomDataBatch', {
  2. extend: 'Ext.data.Batch',
  3. runOperation: function () {
  4. this.complete = true;
  5. }
  6. });

Problem Message reported by ESLint

  1. Usage of private property 'complete' found for 'Ext.data.Batch'