@sencha/extjs/no-removed-method-override

Report the overriding of a removed method

Rule Details

This rule will report when a removed method is being overridden.

In this example, the disable method existed on the Ext.util.ClickRepeater Class until version 6.5 when it was removed. Therefore, this problem will only be reported if the fromVersion in the extjs settings is set to < 6.5 and the toVersion is set to >= 6.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": 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-removed-method-override": "error"
  22. }
  23. }

JavaScript

  1. // overriding 'disable' in an Ext.create() call
  2. Ext.create('Ext.util.ClickRepeater', me.prevElEnd, {
  3. disable: function () {}
  4. });
  5. // overriding 'disable' in an Ext.define() call
  6. Ext.define('MyCustomClickRepeater', {
  7. extend: 'Ext.util.ClickRepeater',
  8. disable: function () {}
  9. });
  10. // overriding 'disable' in an override to the Ext.util.ClickRepeater Class
  11. Ext.define('overrides.ClickRepeater', {
  12. override: 'Ext.util.ClickRepeater',
  13. disable: true
  14. });

Problem Message reported by ESLint

  1. Call to removed method 'disable' found for 'Ext.util.ClickRepeater'