Hide Kanban view for custom doctypes

Hello,
I’m working on my first custom frappe app and I need to hide kanban menu item from view selection dropdown.

At the moment the only way I found is customizing the Kanban view configuration in the setup_views function at the following path: sites/assets/frappe/js/frappe/list/list_view_select.js.

Following my custom code.

Kanban: {
	condition:  this.doctype != "File",
	action: () => this.setup_kanban_boards(),
	current_view_handler: () => {
		frappe.views.KanbanView.get_kanbans(this.doctype).then((kanbans) =>
			this.setup_kanban_switcher(kanbans)
		);
	},
},

Custom code.

Kanban: {
	condition: 
		this.doctype != "File" &&
		!(frappe.listview_settings[this.doctype] != null && frappe.listview_settings[this.doctype].skip_kanban),
	action: () => this.setup_kanban_boards(),
	current_view_handler: () => {
		frappe.views.KanbanView.get_kanbans(this.doctype).then((kanbans) =>
			this.setup_kanban_switcher(kanbans)
		);
	},
},

After editing the function, you can create the doctype_list.js file and with the following flag:

frappe.listview_settings['YourDocTypeHere'] = {
    skip_kanban: true
}

Looking for a cleaner solution if any.

Regards,
Diego