@sencha/extjs/no-existing-class-override

Report the overriding of a Class

Rule Details

This rule will report when a Class is being overridden.

In this example, the Ext.panel.Panel Class is being overridden by using an override config. This rule reports this problem regardless of extjs settings so any value can be used for the fromVersion and the toVersion. In fact, these settings can be left off entirely and just the version setting used.

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. "version": "latest"
  14. }
  15. },
  16. "rules": {
  17. // optionally, you can specify the rule explicitly
  18. // and the errorlevel and any options set here
  19. // will override any defaults from the 'extends' section
  20. "@sencha/extjs/no-existing-class-override": "warn"
  21. }
  22. }

JavaScript

  1. Ext.define('MyCustomClass', {
  2. override: 'Ext.panel.Panel',
  3. setHtml: function () {
  4. // custom processing
  5. this.callParent(arguments);
  6. }
  7. });

Problem Message reported by ESLint

  1. Override of Class 'Ext.panel.Panel' found