@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

  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": 4,
  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-class-usage": "warn"
  22. }
  23. }

JavaScript

  1. // Ext.AbstractManager is a private Class
  2. var MyCustomClass = Ext.extend(Ext.AbstractManager, {
  3. customProp: true
  4. });
  5. // Ext.util.GroupCollection is a private Class
  6. Ext.create({
  7. xclass: 'Ext.util.GroupCollection'
  8. });

Problem Messages reported by ESLint

  1. Usage of private Class 'Ext.AbstractManager' found.
  2. Usage of private Class 'Ext.util.GroupCollection' found.