From 9d7b036cd59813d18c820299573285e148eaf9ef Mon Sep 17 00:00:00 2001 From: daniele-mng Date: Wed, 12 Jun 2024 17:00:28 +0200 Subject: [PATCH 1/2] Add: eslint rule camelCase --- .eslintrc.cjs | 1 + 1 file changed, 1 insertion(+) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index e1fb300d68..9aaf334298 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -31,6 +31,7 @@ module.exports = { 'warn', {ignore: ['children', 'className', 'location']}, ], + camelcase: ['warn', {properties: 'always'}], 'no-case-declarations': 'off', 'no-unused-vars': [ 'warn', From fe67b9afb32e2b7af628aaf4f672d59e4e8e1e52 Mon Sep 17 00:00:00 2001 From: daniele-mng Date: Fri, 14 Jun 2024 08:31:34 +0200 Subject: [PATCH 2/2] create exeptions --- .eslintrc.cjs | 10 +- allowedSnakeCase.cjs | 688 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 697 insertions(+), 1 deletion(-) create mode 100644 allowedSnakeCase.cjs diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 9aaf334298..3c4373bc58 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,3 +1,5 @@ +const allowedSnakeCase = require('./allowedSnakeCase.cjs'); + module.exports = { ignorePatterns: ['build', '.eslintrc.cjs'], extends: [ @@ -31,7 +33,13 @@ module.exports = { 'warn', {ignore: ['children', 'className', 'location']}, ], - camelcase: ['warn', {properties: 'always'}], + camelcase: [ + 'warn', + { + allow: allowedSnakeCase, + properties: 'always', + }, + ], 'no-case-declarations': 'off', 'no-unused-vars': [ 'warn', diff --git a/allowedSnakeCase.cjs b/allowedSnakeCase.cjs new file mode 100644 index 0000000000..2ba2448ee2 --- /dev/null +++ b/allowedSnakeCase.cjs @@ -0,0 +1,688 @@ +/* SPDX-FileCopyrightText: 2024 Greenbone AG + * + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +module.exports = [ + 'access_hosts', + 'action_result', + 'actions_column', + 'activation_time', + 'active_filter', + 'active_notes', + 'active_overrides', + 'add_tag', + 'aggregate_mode', + 'aggregate_type', + 'alert_email', + 'alert_id', + 'alert_ids', + 'alert_items', + 'alert_list', + 'alerts_data', + 'alive_tests', + 'allow_insecure', + 'allow_simultaneous_ips', + 'apply_overrides', + 'apps_array', + 'apps_temp', + '_asset_id', + 'asset_id', + 'assigned_to', + 'auth_algorithm', + 'auth_conf_setting', + 'auth_method', + 'auth_settings', + 'auto_cache_rebuild', + 'auto_delete', + 'auto_delete_data', + 'auto_start', + 'av_duration', + 'average_duration', + 'average_severity', + 'average_severity_score', + 'backend_operation', + 'base_metrics', + 'best_os_cpe', + 'best_os_txt', + 'bulk_select', + 'cancel_token', + 'can_create_target', + 'cap_names', + 'ca_pub', + 'ca_pub_info', + 'c_count', + 'cert_bund_adv', + 'certificate_info', + 'cert_ref', + 'certs_array', + 'certs_per_port', + 'cert_type', + 'change_community', + 'change_passphrase', + 'change_password', + 'change_privacy_password', + 'change_task', + 'client_address', + 'closed_cves', + 'closed_note', + 'closed_time', + 'collection_count_parse_func', + 'compliance_count', + 'component_name', + 'condition_data_at_least_count', + 'condition_data_at_least_filter_id', + 'condition_data_count', + 'condition_data_direction', + 'condition_data_fields', + 'condition_data_filter_id', + 'condition_data_filters', + 'condition_data_filt_id', + 'condition_data_severity', + 'config_id', + 'config_list', + 'config_resp', + 'config_resp_all', + 'configs_data', + 'configurable_formats', + 'contents_table', + 'content_type', + 'convert_allow', + 'convert_auth_method', + 'convert_data', + 'convert_func', + 'cpe_host_details', + 'created_port_ranges', + 'created_port_ranges_copy', + 'create_func', + 'create_pem_certificate', + 'create_values', + 'creation_time', + 'credential_id', + 'credential_list', + 'credential_login', + 'credentials_data', + 'credentials_title', + 'credential_type', + 'csv_blob', + 'csv_data', + 'currently_syncing', + 'current_report', + 'customer_name', + 'custom_severity', + 'cve_id', + 'cve_refs', + 'cves_array', + 'cvss_base', + 'cvss_v2_entries', + 'cvss_v3_entries', + 'cvss_vector', + 'data_all', + 'default_item', + 'default_item_label', + 'default_item_value', + 'default_labels', + 'default_severity', + 'default_timeout', + 'default_values', + 'deleted_port_ranges', + 'deleted_port_ranges_copy', + 'delete_func', + 'delta_report', + 'delta_report_id', + 'delta_states', + 'delta_type', + '_deprecated_by', + 'describe_auth_response', + 'details_count_for_cpe', + 'details_fname', + 'detection_details', + 'dfn_cert_adv', + 'download_title', + 'dynamic_severity', + 'edit_alert', + 'email_credential_filter', + 'empty_default', + 'end_time', + 'entities_filter_func', + 'entities_parse_func', + 'entity_v2', + 'entity_v3', + 'errors_array', + 'esxi_cred', + 'esxi_credential', + 'esxi_credential_filter', + 'esxi_credential_id', + 'event_data', + 'event_data_feed_event', + 'event_data_fields', + 'event_data_modify_task_fields', + 'event_data_quick_first_scan_fields', + 'event_data_quick_task_fields', + 'event_data_secinfo_type', + 'event_data_status', + 'event_type', + 'exclude_array', + 'exclude_file', + 'exclude_hosts', + 'exclude_props', + 'executable_version', + 'executable_version_unreliable', + 'expiration_time', + 'false_positive', + 'family_count', + 'family_list', + 'feed_event', + 'feed_type', + 'field_value', + 'filtered_count', + 'filter_func', + 'filter_id', + 'filter_identifiers', + 'filter_list', + 'filter_parse_func', + 'filter_results_filter', + 'filters_data', + 'filter_secinfo_filter', + 'filter_string', + 'filter_type', + 'filter_types', + 'f_impact', + 'find_item', + 'find_label', + 'first_time', + 'fixed_note', + 'fixed_time', + 'fix_verified_report', + 'fix_verified_time', + 'foo_id', + 'format_items', + 'formdata_append', + 'from_address', + 'from_file', + 'full_count', + 'full_type', + 'general_note', + 'general_permissions', + 'get_aggregate', + 'get_aggregates_response', + 'get_config_family_response', + 'get_config_nvt_response', + 'get_feeds', + 'get_feeds_response', + 'get_identifier', + 'get_img_url', + 'get_info', + 'get_info_response', + 'get_license', + 'get_license_response', + 'get_nvt_families', + 'get_nvt_families_response', + 'get_nvts_response', + 'get_resource_names', + 'get_resource_names_response', + 'get_scanner', + 'get_settings', + 'get_settings_response', + 'get_value', + 'goto_details', + 'goto_host', + 'goto_list', + 'grant_full', + 'group_column', + 'group_id', + 'group_ids', + 'group_list', + 'groups_data', + 'gsad_response', + 'has_av_duration', + '_has_caps', + 'has_detection', + 'has_duration', + 'has_reference', + 'has_selected', + 'has_severity_filter', + 'header_title', + 'highest_severity', + 'high_per_host', + 'host_allow', + 'host_cves', + 'hostnames_by_ip', + 'hosts_allow', + 'hosts_array', + 'hosts_count', + 'hosts_filter', + 'hosts_manual', + 'hosts_ordering', + 'hr_name', + 'i18n_1', + 'id_field', + 'id_lists', + 'id_name', + 'id_or__', + 'id_or_empty', + 'ignore_pagination', + 'img_path', + 'import_func', + 'in_assets', + 'include_related', + 'includes_type', + 'info_elem', + 'info_filter', + 'info_id', + '_Info_Issuer', + 'info_type', + '_Info_URL', + 'inheritor_id', + 'in_use', + 'invisible_alerts', + 'invisible_report_configs', + 'is_edit', + 'is_ended', + 'is_radio', + 'issuer_dn', + 'is_task_event', + 'key_code', + 'known_nvt_count', + 'last_id', + 'last_report', + 'last_seen', + 'latest_severity', + 'ldaps_only', + 'list_fname', + 'load_formats', + 'lsc_password', + 'max_checks', + 'max_epss', + 'max_groups', + 'max_high', + 'max_hosts', + 'max_log', + 'max_low', + 'max_medium', + 'max_nvt_count', + 'max_severity', + 'may_edit_target', + 'may_op_configuration', + 'may_op_scans', + 'md5_fingerprint', + 'method_data_composer_ignore_pagination', + 'method_data_composer_include_notes', + 'method_data_composer_include_overrides', + 'method_data_defense_center_ip', + 'method_data_defense_center_port', + 'method_data_delta_report_id', + 'method_data_delta_type', + 'method_data_details_url', + 'method_data_fields', + 'method_data_from_address', + 'method_data_message', + 'method_data_message_attach', + 'method_data_notice', + 'method_data_notice_attach_config', + 'method_data_notice_attach_format', + 'method_data_notice_report_config', + 'method_data_notice_report_format', + 'method_data_pkcs12_credential', + 'method_data_recipient_credential', + 'method_data_scp_credential', + 'method_data_scp_host', + 'method_data_scp_known_hosts', + 'method_data_scp_path', + 'method_data_scp_port', + 'method_data_scp_report_config', + 'method_data_scp_report_format', + 'method_data_send_host', + 'method_data_send_port', + 'method_data_send_report_config', + 'method_data_send_report_format', + 'method_data_smb_credential', + 'method_data_smb_file_path', + 'method_data_smb_file_path_type', + 'method_data_smb_max_protocol', + 'method_data_smb_report_config', + 'method_data_smb_report_format', + 'method_data_smb_share_path', + 'method_data_snmp_agent', + 'method_data_snmp_community', + 'method_data_snmp_message', + 'method_data_start_task_task', + 'method_data_status', + 'method_data_subject', + 'method_data_submethod', + 'method_data_to_address', + 'method_data_tp_sms_credential', + 'method_data_tp_sms_hostname', + 'method_data_tp_sms_tls_workaround', + 'method_data_URL', + 'method_data_verinice_server_credential', + 'method_data_verinice_server_report_config', + 'method_data_verinice_server_report_format', + 'method_data_verinice_server_url', + 'method_data_vfire_base_url', + 'method_data_vfire_call_description', + 'method_data_vfire_call_impact_name', + 'method_data_vfire_call_partition_name', + 'method_data_vfire_call_template_name', + 'method_data_vfire_call_type_name', + 'method_data_vfire_call_urgency_name', + 'method_data_vfire_client_id', + 'method_data_vfire_credential', + 'method_data_vfire_session_type', + 'min_high', + 'min_low', + 'min_medium', + 'min_qod', + 'model_type', + 'modification_time', + 'modify_password', + 'native_name', + 'new_alert', + 'new_family', + 'new_port_ranges', + 'new_severity', + 'new_severity_from_list', + 'new_threat', + 'new_title', + 'next_time', + 'no_filter_history', + 'noop_convert', + 'no_redirect', + 'note_list', + 'notes_data', + 'nvd_id', + 'nvt_count', + 'nvt_name', + 'nvt_preferences', + 'obj_url', + 'old_login', + 'old_name', + 'old_password', + 'open_dialog', + 'open_note', + 'open_time', + 'openvas_config_id', + 'openvas_scan_config_items', + 'operating_systems', + 'optional_resource_type', + 'orig_filter', + 'original_severity', + 'origin_id', + 'origin_type', + 'os_array', + 'os_count', + 'os_cpe', + 'os_icon', + 'os_txt', + 'override_list', + 'overrides_data', + 'package_format', + 'package_unreliable', + 'param_item', + 'param_name', + 'params_using_default', + 'param_types', + 'parse_collection_counts', + 'parse_count', + 'parse_counts', + 'parse_errors', + 'parse_page_count', + 'parse_report_report_counts', + 'parse_scanner_info', + 'password_only_credential_filter', + 'period_months', + 'permission_group_id', + 'permission_list', + 'permission_role_id', + 'permissions_data', + 'permission_type', + 'permission_user_id', + 'perm_names', + 'pkcs12_credential_id', + 'plural_name', + 'policy_resp', + 'policy_resp_all', + 'port_count', + 'port_list', + 'port_list_id', + 'port_list_list', + 'port_lists', + 'port_lists_data', + 'port_lists_title', + 'port_manual', + 'port_range', + 'port_range_end', + 'port_range_id', + 'port_ranges', + 'port_range_start', + 'ports_array', + 'port_type', + 'pref_count', + 'preference_count', + 'privacy_algorithm', + 'privacy_password', + 'private_key', + 'prop_name', + 'props_value', + 'protocol_type', + 'public_key', + 'public_url_loader', + 'raw_data', + 'raw_exploit', + 'raw_impact', + 'ready_1', + 'recipient_credential_id', + '_reference_type', + 'reference_type', + 'Ref_Num', + 'remote_active', + 'remote_analysis', + 'remote_app', + 'remote_banner', + 'remote_banner_unreliable', + 'remote_probe', + 'remote_vul', + 'render_alerts', + 'render_credentials', + 'render_filter', + 'render_filters', + 'render_groups', + 'render_notes', + 'render_overrides', + 'render_permissions', + 'render_port_lists', + 'render_report_configs', + 'render_report_formats', + 'render_roles', + 'render_scanners', + 'render_schedules', + 'render_severity', + 'render_tags', + 'render_targets', + 'render_tickets', + 'report_config', + 'report_config_id', + 'report_config_ids', + 'report_config_list', + 'report_configs', + 'report_configs_data', + 'report_config_values', + 'report_count', + 'report_fname', + 'report_format', + 'report_format_id', + 'report_format_ids', + 'report_format_list', + 'report_formats', + 'report_formats_data', + 'report_id', + 'report_type', + 'resource_id', + 'resource_ids', + 'resources_action', + 'resource_type', + 'resource_types', + 'response_alerts', + 'response_all', + 'response_configs', + 'response_credentials', + 'response_filters', + 'response_groups', + 'response_notes', + 'response_overrides', + 'response_permissions', + 'response_port_lists', + 'response_report_configs', + 'response_report_formats', + 'response_roles', + 'response_scanners', + 'response_schedules', + 'response_tags', + 'response_targets', + 'response_tasks', + 'response_tickets', + 'result_count', + 'result_counts', + 'result_filter_id', + 'result_filters', + 'result_hosts_only', + 'result_id', + 'result_name', + 'result_severity', + 'results_with_cve', + 'result_uuid', + 'reverse_lookup_only', + 'reverse_lookup_unify', + 'role_id', + 'role_ids', + 'role_list', + 'roles_data', + '_same_source', + 'same_source', + 'scan_configs', + 'scan_end', + 'scanner_credentials', + 'scanner_host', + 'scanner_id', + 'scanner_list', + 'scanner_name', + 'scanner_preferences', + 'scanners_data', + 'scanner_type', + 'scan_nvt_version', + 'scan_run_status', + 'scan_start', + 'schedule_id', + 'schedule_items', + 'schedule_list', + 'schedule_periods', + 'schedules_data', + 'schedules_only', + 'scp_credential', + 'scp_credential_id', + 'secinfo_filters', + 'secinfo_type', + 'section_title', + 'select_verinice_report_id', + 'setting_id', + 'setting_value', + 'set_url_loader', + 'severity_class', + 'severity_from_list_items', + 'severity_levels', + 'sha256_fingerprint', + 'simple_duration', + 'simple_period', + 'slave_id', + 'smb_cred', + 'smb_credential', + 'smb_credential_filter', + 'smb_credential_id', + 'snmp_agent', + 'snmp_cred', + 'snmp_credential', + 'snmp_credential_filter', + 'snmp_credential_id', + 'snmp_credentials', + 'solution_type', + 'source_type', + 'ssh_cred', + 'ssh_credential', + 'ssh_credential_filter', + 'ssh_credential_id', + 'ssh_credentials', + 'ssh_elevate_credential', + 'ssh_elevate_credential_id', + 'ssh_port', + 'ssl_certs', + 'start_date', + 'start_hour', + 'start_minute', + 'start_time', + 'start_timezone', + 'subgroup_column', + 'subject_dn', + 'subject_type', + 'svg_blob', + 'svg_data', + 'sys_reports', + 'sys_response', + 'table_props', + 'tag_id', + 'tag_items', + 'tag_list', + 'tag_name', + 'tags_data', + 'tag_value', + 'target_elevate', + 'target_exclude_source', + 'target_hosts', + 'target_id', + 'target_items', + 'target_list', + 'target_no_elevate', + 'target_no_portlist', + 'targets_data', + 'target_source', + 'target_title', + 'task_id', + 'task_list', + 'task_name', + 'tasks_data', + 'task_uuid', + 'temp_ports', + 'text_excerpt', + 'ticket_id', + 'ticket_list', + 'tickets_data', + 'ticket_status', + 'time_status', + 'timezone_abbrev', + 'tls_cert', + 'tls_certificate', + 'tls_certificate_id', + 'tls_certificates', + 'to_address', + 'tp_sms_credential_id', + 'up_credentials', + 'update_time', + 'url_loader', + 'usage_type', + 'use_default_check', + 'use_openvas_scan_config', + 'user_id', + 'user_tags', + '_using_default', + 'value_func', + 'value_labels', + 'value_using_default', + 'vendor_version', + 'verinice_credential_id', + 'verinice_server_credential', + 'vFire_credential_filter', + 'vfire_credential_id', + 'which_cert', + 'xml_file', + 'yes_no_props', + 'zh_TW', +];