@sencha/extjs/no-removed-property-usage
Report the usage of a removed property
Rule Details
This rule will report when a removed property is being used.
In this example, the version
property existed on the Ext.chart.PolarChart
Class from version 5 till it was removed in verion 6. Therefore, this problem will only be reported if the fromVersion
in the extjs settings is set to 5 and the toVersion
is set to >= 6.
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": 5,
"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-property-usage": "error"
}
}
JavaScript
Ext.define('MyCustomChart', {
extend: 'Ext.chart.PolarChart',
initComponent: function () {
this.version = 2; // version property removed in 6.0
}
});
Problem Message reported by ESLint
Usage of removed property 'version' found for 'Ext.chart.PolarChart`