@sencha/extjs/no-removed-class-usage
Report the usage of a removed Class
Rule Details
This rule will report when a removed Class is being used.
In this example, the Ext.ModelManager Class existed in 4.x but was removed in 5.0. Therefore, this problem will only be reported if the fromVersion
in the extjs settings is set to 4 and the toVersion
is set to >= 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-class-usage": "error"
}
}
JavaScript
Ext.define('User', {
extend: 'Ext.data.Model',
fields: ['first', 'last']
});
Ext.ModelManager.create({
first: 'Jack',
last: 'Ratcliff'
}, 'User');
Problem Message reported by ESLint
Usage of removed Class 'Ext.ModelManager' found