@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
{
"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": 4,
"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-removed-method-override": "error"
}
}
JavaScript
// overriding 'disable' in an Ext.create() call
Ext.create('Ext.util.ClickRepeater', me.prevElEnd, {
disable: function () {}
});
// overriding 'disable' in an Ext.define() call
Ext.define('MyCustomClickRepeater', {
extend: 'Ext.util.ClickRepeater',
disable: function () {}
});
// overriding 'disable' in an override to the Ext.util.ClickRepeater Class
Ext.define('overrides.ClickRepeater', {
override: 'Ext.util.ClickRepeater',
disable: true
});
Problem Message reported by ESLint
Call to removed method 'disable' found for 'Ext.util.ClickRepeater'