@sencha/extjs/no-private-config-usage
Report the usage of a private config
Rule Details
This rule will report when a private config is being used.
In this example, allowDomMove
is a private config of the Ext.container.Viewport
Class and has been around since version 4. A problem will be reported when using this config with a fromVersion
or toVersion
in the extjs settings set to a value >= 4.
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-private-config-usage": "warn"
}
}
JavaScript
Ext.create('Ext.container.Viewport', {
layout: 'border',
allowDomMove: true,
items: []
});
Problem Message reported by ESLint
Usage of private config 'allowDomMove' found for 'Ext.container.Viewport'