diff --git a/.prettierignore b/.prettierignore index 1828094893f08e6d12e3b0890fe494d2cd106fa4..4274507814454119edb0b426323e7ae84b010f95 100644 --- a/.prettierignore +++ b/.prettierignore @@ -848,39 +848,6 @@ app/assets/javascripts/snippets/components/snippet_blob_view.vue app/assets/javascripts/snippets/components/snippet_header.vue app/assets/javascripts/snippets/mixins/snippets.js -## practical-wozniak -app/assets/javascripts/vue_shared/components/rich_content_editor/services/sanitize_html.js -app/assets/javascripts/vue_shared/components/select2_select.vue -app/assets/javascripts/vue_shared/components/sidebar/labels_select/dropdown_create_label.vue -app/assets/javascripts/vue_shared/components/sidebar/labels_select/dropdown_value_collapsed.vue -app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/dropdown_contents_create_view.vue -app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/labels_select_root.vue -app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/store/getters.js -app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/store/mutations.js -app/assets/javascripts/vue_shared/components/split_button.vue -app/assets/javascripts/vue_shared/components/tabs/tabs.js -app/assets/javascripts/vue_shared/components/timezone_dropdown.vue -app/assets/javascripts/vue_shared/components/web_ide_link.vue -app/assets/javascripts/vue_shared/directives/autofocusonshow.js -app/assets/javascripts/vue_shared/directives/validation.js -app/assets/javascripts/vue_shared/gl_feature_flags_plugin.js -app/assets/javascripts/vue_shared/mixins/ci_pagination_api_mixin.js -app/assets/javascripts/vue_shared/security_reports/security_reports_app.vue -app/assets/javascripts/vue_shared/security_reports/store/getters.js -app/assets/javascripts/vue_shared/security_reports/store/modules/sast/actions.js -app/assets/javascripts/vue_shared/security_reports/store/modules/secret_detection/actions.js -app/assets/javascripts/vue_shared/security_reports/store/utils.js -app/assets/javascripts/vue_shared/translate.js -app/assets/javascripts/vuex_shared/bindings.js -app/assets/javascripts/whats_new/components/app.vue -app/assets/javascripts/whats_new/index.js -app/assets/javascripts/whats_new/utils/get_drawer_body_height.js -app/assets/javascripts/whats_new/utils/notification.js -app/assets/javascripts/zen_mode.js -config/helpers/is_eslint.js -config/helpers/vendor_dll_hash.js -config/karma.config.js - ## frosty-kare config/plugins/monaco_webpack.js config/webpack.config.js diff --git a/app/assets/javascripts/vue_shared/components/rich_content_editor/services/sanitize_html.js b/app/assets/javascripts/vue_shared/components/rich_content_editor/services/sanitize_html.js index eae2e0335c1206920b398fb4bbfb717d712f0cc2..cb0f1d51cb1f4027a6a029a37c32fc454d6aeee2 100644 --- a/app/assets/javascripts/vue_shared/components/rich_content_editor/services/sanitize_html.js +++ b/app/assets/javascripts/vue_shared/components/rich_content_editor/services/sanitize_html.js @@ -5,7 +5,7 @@ import { getURLOrigin } from '~/lib/utils/url_utility'; const sanitizer = createSanitizer(window); const ADD_TAGS = ['iframe']; -sanitizer.addHook('uponSanitizeElement', node => { +sanitizer.addHook('uponSanitizeElement', (node) => { if (node.tagName !== 'IFRAME') { return; } @@ -17,6 +17,6 @@ sanitizer.addHook('uponSanitizeElement', node => { } }); -const sanitize = content => sanitizer.sanitize(content, { ADD_TAGS }); +const sanitize = (content) => sanitizer.sanitize(content, { ADD_TAGS }); export default sanitize; diff --git a/app/assets/javascripts/vue_shared/components/select2_select.vue b/app/assets/javascripts/vue_shared/components/select2_select.vue index 3dbf0ccdfa90f404449d56fbccda46318396efa8..6574a5ddfdeadfd1d179702d382a89aa8a4b8637 100644 --- a/app/assets/javascripts/vue_shared/components/select2_select.vue +++ b/app/assets/javascripts/vue_shared/components/select2_select.vue @@ -26,7 +26,7 @@ export default { $(this.$refs.dropdownInput) .val(this.value) .select2(this.options) - .on('change', event => this.$emit('input', event.target.value)); + .on('change', (event) => this.$emit('input', event.target.value)); }) .catch(() => {}); }, diff --git a/app/assets/javascripts/vue_shared/components/sidebar/labels_select/dropdown_create_label.vue b/app/assets/javascripts/vue_shared/components/sidebar/labels_select/dropdown_create_label.vue index 434aabc3df977ffee2e80a33dd94f20c1b452404..795f16f4efc91080eec9978efe1146577ceaf704 100644 --- a/app/assets/javascripts/vue_shared/components/sidebar/labels_select/dropdown_create_label.vue +++ b/app/assets/javascripts/vue_shared/components/sidebar/labels_select/dropdown_create_label.vue @@ -18,7 +18,7 @@ export default { }, created() { const rawLabelsColors = gon.suggested_label_colors; - this.suggestedColors = Object.keys(rawLabelsColors).map(colorCode => ({ + this.suggestedColors = Object.keys(rawLabelsColors).map((colorCode) => ({ colorCode, title: rawLabelsColors[colorCode], })); diff --git a/app/assets/javascripts/vue_shared/components/sidebar/labels_select/dropdown_value_collapsed.vue b/app/assets/javascripts/vue_shared/components/sidebar/labels_select/dropdown_value_collapsed.vue index 973cc314ee3a73a7e709c6b11e5782b78c3d39c5..122250d1ce7805eba336cd0745c131abd17dc75f 100644 --- a/app/assets/javascripts/vue_shared/components/sidebar/labels_select/dropdown_value_collapsed.vue +++ b/app/assets/javascripts/vue_shared/components/sidebar/labels_select/dropdown_value_collapsed.vue @@ -20,7 +20,7 @@ export default { const labelsString = this.labels.length ? this.labels .slice(0, 5) - .map(label => label.title) + .map((label) => label.title) .join(', ') : s__('LabelSelect|Labels'); diff --git a/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/dropdown_contents_create_view.vue b/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/dropdown_contents_create_view.vue index 55e2fb682758b035b73195309e798e4e83937657..41308e352e32a4848b483003c20f3b01d0cf1d1f 100644 --- a/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/dropdown_contents_create_view.vue +++ b/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/dropdown_contents_create_view.vue @@ -25,7 +25,7 @@ export default { }, suggestedColors() { const colorsMap = gon.suggested_label_colors; - return Object.keys(colorsMap).map(color => ({ [color]: colorsMap[color] })); + return Object.keys(colorsMap).map((color) => ({ [color]: colorsMap[color] })); }, }, methods: { diff --git a/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/labels_select_root.vue b/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/labels_select_root.vue index 8ce624aa303070d0001a10598909deb692240f1c..683889b86111e04e15e9a08a4afb1eba2c297529 100644 --- a/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/labels_select_root.vue +++ b/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/labels_select_root.vue @@ -182,9 +182,9 @@ export default { !state.showDropdownButton && !state.showDropdownContents ) { - let filterFn = label => label.touched; + let filterFn = (label) => label.touched; if (this.isDropdownVariantEmbedded) { - filterFn = label => label.set; + filterFn = (label) => label.set; } this.handleDropdownClose(state.labels.filter(filterFn)); } @@ -204,13 +204,13 @@ export default { 'js-btn-cancel-create', 'js-sidebar-dropdown-toggle', ].some( - className => + (className) => target?.classList.contains(className) || target?.parentElement?.classList.contains(className), ); const hadExceptionParent = ['.js-btn-back', '.js-labels-list'].some( - className => $(target).parents(className).length, + (className) => $(target).parents(className).length, ); if ( diff --git a/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/store/getters.js b/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/store/getters.js index 5a30e29cad369bce2c38911cd507909c510fe501..d14f96720b737ac592d6eebdfc62fab429a84b04 100644 --- a/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/store/getters.js +++ b/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/store/getters.js @@ -9,7 +9,7 @@ import { DropdownVariant } from '../constants'; */ export const dropdownButtonText = (state, getters) => { const selectedLabels = getters.isDropdownVariantSidebar - ? state.labels.filter(label => label.set) + ? state.labels.filter((label) => label.set) : state.selectedLabels; if (!selectedLabels.length) { @@ -28,25 +28,25 @@ export const dropdownButtonText = (state, getters) => { * selectedLabels array. * @param {object} state */ -export const selectedLabelsList = state => state.selectedLabels.map(label => label.id); +export const selectedLabelsList = (state) => state.selectedLabels.map((label) => label.id); /** * Returns boolean representing whether dropdown variant * is `sidebar` * @param {object} state */ -export const isDropdownVariantSidebar = state => state.variant === DropdownVariant.Sidebar; +export const isDropdownVariantSidebar = (state) => state.variant === DropdownVariant.Sidebar; /** * Returns boolean representing whether dropdown variant * is `standalone` * @param {object} state */ -export const isDropdownVariantStandalone = state => state.variant === DropdownVariant.Standalone; +export const isDropdownVariantStandalone = (state) => state.variant === DropdownVariant.Standalone; /** * Returns boolean representing whether dropdown variant * is `embedded` * @param {object} state */ -export const isDropdownVariantEmbedded = state => state.variant === DropdownVariant.Embedded; +export const isDropdownVariantEmbedded = (state) => state.variant === DropdownVariant.Embedded; diff --git a/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/store/mutations.js b/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/store/mutations.js index 54f8c78b4e17c13b9359b04cb7cf3b1158f2bccc..6de436ffd136a383953b8d7d3a33f0d0f8a1f5ed 100644 --- a/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/store/mutations.js +++ b/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/store/mutations.js @@ -33,7 +33,7 @@ export default { // Iterate over every label and add a `set` prop // to determine whether it is already a part of // selectedLabels array. - const selectedLabelIds = state.selectedLabels.map(label => label.id); + const selectedLabelIds = state.selectedLabels.map((label) => label.id); state.labelsFetchInProgress = false; state.labels = labels.reduce((allLabels, label) => { allLabels.push({ @@ -61,7 +61,7 @@ export default { // Find the label to update from all the labels // and change `set` prop value to represent their current state. const labelId = labels.pop()?.id; - const candidateLabel = state.labels.find(label => labelId === label.id); + const candidateLabel = state.labels.find((label) => labelId === label.id); if (candidateLabel) { candidateLabel.touched = true; candidateLabel.set = !candidateLabel.set; diff --git a/app/assets/javascripts/vue_shared/components/split_button.vue b/app/assets/javascripts/vue_shared/components/split_button.vue index 11049028ff6436ff86909cc85e34187c1c1c63bb..61b317d0d1de28a515889e8625d7d78ce7ca31fc 100644 --- a/app/assets/javascripts/vue_shared/components/split_button.vue +++ b/app/assets/javascripts/vue_shared/components/split_button.vue @@ -2,7 +2,7 @@ import { isString } from 'lodash'; import { GlDropdown, GlDropdownDivider, GlDropdownItem } from '@gitlab/ui'; -const isValidItem = item => +const isValidItem = (item) => isString(item.eventName) && isString(item.title) && isString(item.description); export default { diff --git a/app/assets/javascripts/vue_shared/components/tabs/tabs.js b/app/assets/javascripts/vue_shared/components/tabs/tabs.js index 9b9e4bb47bd4f087ec71679245144fe21a6054f5..233df96a520b0d8e924844e0465fc07b81a767d6 100644 --- a/app/assets/javascripts/vue_shared/components/tabs/tabs.js +++ b/app/assets/javascripts/vue_shared/components/tabs/tabs.js @@ -17,8 +17,8 @@ export default { }, methods: { updateTabs() { - this.tabs = this.$children.filter(child => child.isTab); - this.currentIndex = this.tabs.findIndex(tab => tab.localActive); + this.tabs = this.$children.filter((child) => child.isTab); + this.currentIndex = this.tabs.findIndex((tab) => tab.localActive); }, setTab(e, index) { if (this.stopPropagation) { @@ -48,7 +48,7 @@ export default { href: '#', }, on: { - click: e => this.setTab(e, i), + click: (e) => this.setTab(e, i), }, }, tab.$slots.title || tab.title, diff --git a/app/assets/javascripts/vue_shared/components/timezone_dropdown.vue b/app/assets/javascripts/vue_shared/components/timezone_dropdown.vue index 3fa8efcd1451f05900e78848d2e261e6bce75805..f1db26ff4fc81c30c5c73d9a83e07a9c9cbb29aa 100644 --- a/app/assets/javascripts/vue_shared/components/timezone_dropdown.vue +++ b/app/assets/javascripts/vue_shared/components/timezone_dropdown.vue @@ -36,14 +36,14 @@ export default { }, computed: { timezones() { - return this.timezoneData.map(timezone => ({ + return this.timezoneData.map((timezone) => ({ formattedTimezone: this.formatTimezone(timezone), identifier: timezone.identifier, })); }, filteredResults() { const lowerCasedSearchTerm = this.searchTerm.toLowerCase(); - return this.timezones.filter(timezone => + return this.timezones.filter((timezone) => timezone.formattedTimezone.toLowerCase().includes(lowerCasedSearchTerm), ); }, diff --git a/app/assets/javascripts/vue_shared/components/web_ide_link.vue b/app/assets/javascripts/vue_shared/components/web_ide_link.vue index dbb1a075e768af678862463ae199fb9eb04ce4e3..c957876f8abf99534556cba6de635f579cd2502c 100644 --- a/app/assets/javascripts/vue_shared/components/web_ide_link.vue +++ b/app/assets/javascripts/vue_shared/components/web_ide_link.vue @@ -72,7 +72,7 @@ export default { }, computed: { actions() { - return [this.webIdeAction, this.editAction, this.gitpodAction].filter(action => action); + return [this.webIdeAction, this.editAction, this.gitpodAction].filter((action) => action); }, editAction() { if (!this.showEditButton) { diff --git a/app/assets/javascripts/vue_shared/directives/autofocusonshow.js b/app/assets/javascripts/vue_shared/directives/autofocusonshow.js index 4659ec20ceb3def0986f98469c68b1bce0945a5e..1be4612a7e45668c10c271a6f50a7f0f4fc41cc7 100644 --- a/app/assets/javascripts/vue_shared/directives/autofocusonshow.js +++ b/app/assets/javascripts/vue_shared/directives/autofocusonshow.js @@ -11,8 +11,8 @@ export default { inserted(el) { if ('IntersectionObserver' in window) { // Element visibility is dynamic, so we attach observer - el.visibilityObserver = new IntersectionObserver(entries => { - entries.forEach(entry => { + el.visibilityObserver = new IntersectionObserver((entries) => { + entries.forEach((entry) => { // Combining `intersectionRatio > 0` and // element's `offsetParent` presence will // deteremine if element is truely visible diff --git a/app/assets/javascripts/vue_shared/directives/validation.js b/app/assets/javascripts/vue_shared/directives/validation.js index 772c4b3a0828b269ee2911accb9ebd3df56ce720..ece09df272c0f4eff3c5d2142e8a6d1f23ff1115 100644 --- a/app/assets/javascripts/vue_shared/directives/validation.js +++ b/app/assets/javascripts/vue_shared/directives/validation.js @@ -12,19 +12,19 @@ import { s__ } from '~/locale'; */ const defaultFeedbackMap = { valueMissing: { - isInvalid: el => el.validity?.valueMissing, + isInvalid: (el) => el.validity?.valueMissing, message: s__('Please fill out this field.'), }, urlTypeMismatch: { - isInvalid: el => el.type === 'url' && el.validity?.typeMismatch, + isInvalid: (el) => el.type === 'url' && el.validity?.typeMismatch, message: s__('Please enter a valid URL format, ex: http://www.example.com/home'), }, }; const getFeedbackForElement = (feedbackMap, el) => - Object.values(feedbackMap).find(f => f.isInvalid(el))?.message || el.validationMessage; + Object.values(feedbackMap).find((f) => f.isInvalid(el))?.message || el.validationMessage; -const focusFirstInvalidInput = e => { +const focusFirstInvalidInput = (e) => { const { target: formEl } = e; const invalidInput = formEl.querySelector('input:invalid'); @@ -33,7 +33,7 @@ const focusFirstInvalidInput = e => { } }; -const isEveryFieldValid = form => Object.values(form.fields).every(({ state }) => state === true); +const isEveryFieldValid = (form) => Object.values(form.fields).every(({ state }) => state === true); const createValidator = (context, feedbackMap) => ({ el, reportInvalidInput = false }) => { const { form } = context; diff --git a/app/assets/javascripts/vue_shared/gl_feature_flags_plugin.js b/app/assets/javascripts/vue_shared/gl_feature_flags_plugin.js index 3488a44bd0f490e0bc04614b4eaf74ead0c7a4e4..e1734809bce3ddaea13c021fa4d394dab2527c4e 100644 --- a/app/assets/javascripts/vue_shared/gl_feature_flags_plugin.js +++ b/app/assets/javascripts/vue_shared/gl_feature_flags_plugin.js @@ -1,4 +1,4 @@ -export default Vue => { +export default (Vue) => { Vue.mixin({ provide: { glFeatures: { ...((window.gon && window.gon.features) || {}) }, diff --git a/app/assets/javascripts/vue_shared/mixins/ci_pagination_api_mixin.js b/app/assets/javascripts/vue_shared/mixins/ci_pagination_api_mixin.js index cdbde55901dea4940a80127a5e6918267d7ce9fd..be04ff158e77acb643a8643e25cbe3442ec489c3 100644 --- a/app/assets/javascripts/vue_shared/mixins/ci_pagination_api_mixin.js +++ b/app/assets/javascripts/vue_shared/mixins/ci_pagination_api_mixin.js @@ -48,7 +48,7 @@ export default { this.poll.stop(); const queryString = Object.keys(parameters) - .map(parameter => { + .map((parameter) => { const value = parameters[parameter]; // update internal state for UI this[parameter] = value; diff --git a/app/assets/javascripts/vue_shared/security_reports/security_reports_app.vue b/app/assets/javascripts/vue_shared/security_reports/security_reports_app.vue index bdbf9957ad48fb52a70635ac945bde8acf63a68f..a6c7b59aa71ff2f587e30954fe60a11ab4d304dc 100644 --- a/app/assets/javascripts/vue_shared/security_reports/security_reports_app.vue +++ b/app/assets/javascripts/vue_shared/security_reports/security_reports_app.vue @@ -97,7 +97,7 @@ export default { projectPath: this.targetProjectFullPath, iid: String(this.mrIid), reportTypes: this.$options.reportTypes.map( - reportType => reportTypeToSecurityReportTypeEnum[reportType], + (reportType) => reportTypeToSecurityReportTypeEnum[reportType], ), }; }, @@ -151,7 +151,7 @@ export default { created() { if (!this.canShowDownloads) { this.checkAvailableSecurityReports(this.$options.reportTypes) - .then(availableSecurityReports => { + .then((availableSecurityReports) => { this.onCheckingAvailableSecurityReports(Array.from(availableSecurityReports)); }) .catch(this.showError); diff --git a/app/assets/javascripts/vue_shared/security_reports/store/getters.js b/app/assets/javascripts/vue_shared/security_reports/store/getters.js index 1e5a60c32fdb29ad952c8a1180a9bfa24dee457c..443255b0e6a8177346ead7670194d4cae99159d8 100644 --- a/app/assets/javascripts/vue_shared/security_reports/store/getters.js +++ b/app/assets/javascripts/vue_shared/security_reports/store/getters.js @@ -3,7 +3,7 @@ import { countVulnerabilities, groupedTextBuilder } from './utils'; import { LOADING, ERROR, SUCCESS } from '~/reports/constants'; import { TRANSLATION_IS_LOADING } from './messages'; -export const summaryCounts = state => +export const summaryCounts = (state) => countVulnerabilities( state.reportTypes.reduce((acc, reportType) => { acc.push(...state[reportType].newIssues); @@ -50,17 +50,17 @@ export const summaryStatus = (state, getters) => { return SUCCESS; }; -export const areReportsLoading = state => - state.reportTypes.some(reportType => state[reportType].isLoading); +export const areReportsLoading = (state) => + state.reportTypes.some((reportType) => state[reportType].isLoading); -export const areAllReportsLoading = state => - state.reportTypes.every(reportType => state[reportType].isLoading); +export const areAllReportsLoading = (state) => + state.reportTypes.every((reportType) => state[reportType].isLoading); -export const allReportsHaveError = state => - state.reportTypes.every(reportType => state[reportType].hasError); +export const allReportsHaveError = (state) => + state.reportTypes.every((reportType) => state[reportType].hasError); -export const anyReportHasError = state => - state.reportTypes.some(reportType => state[reportType].hasError); +export const anyReportHasError = (state) => + state.reportTypes.some((reportType) => state[reportType].hasError); -export const anyReportHasIssues = state => - state.reportTypes.some(reportType => state[reportType].newIssues.length > 0); +export const anyReportHasIssues = (state) => + state.reportTypes.some((reportType) => state[reportType].newIssues.length > 0); diff --git a/app/assets/javascripts/vue_shared/security_reports/store/modules/sast/actions.js b/app/assets/javascripts/vue_shared/security_reports/store/modules/sast/actions.js index 22a45341c5178b5f8c07af24ba7a08ff0e41ef44..0f26e3c30efab6d9d961f3ead78804a9f5d8a23d 100644 --- a/app/assets/javascripts/vue_shared/security_reports/store/modules/sast/actions.js +++ b/app/assets/javascripts/vue_shared/security_reports/store/modules/sast/actions.js @@ -15,7 +15,7 @@ export const fetchDiff = ({ state, rootState, dispatch }) => { dispatch('requestDiff'); return fetchDiffData(rootState, state.paths.diffEndpoint, 'sast') - .then(data => { + .then((data) => { dispatch('receiveDiffSuccess', data); }) .catch(() => { diff --git a/app/assets/javascripts/vue_shared/security_reports/store/modules/secret_detection/actions.js b/app/assets/javascripts/vue_shared/security_reports/store/modules/secret_detection/actions.js index c9da824613da5f5065c4d2788ae0f3d7697aba9f..e3ae5435f5d38afa736bf4f8515cf937a270ca47 100644 --- a/app/assets/javascripts/vue_shared/security_reports/store/modules/secret_detection/actions.js +++ b/app/assets/javascripts/vue_shared/security_reports/store/modules/secret_detection/actions.js @@ -15,7 +15,7 @@ export const fetchDiff = ({ state, rootState, dispatch }) => { dispatch('requestDiff'); return fetchDiffData(rootState, state.paths.diffEndpoint, 'secret_detection') - .then(data => { + .then((data) => { dispatch('receiveDiffSuccess', data); }) .catch(() => { diff --git a/app/assets/javascripts/vue_shared/security_reports/store/utils.js b/app/assets/javascripts/vue_shared/security_reports/store/utils.js index c5e786c92b104eb817379f378ae28a991e679862..fd6613ae11ce08c075ab1e92821e17d3b95dabfd 100644 --- a/app/assets/javascripts/vue_shared/security_reports/store/utils.js +++ b/app/assets/javascripts/vue_shared/security_reports/store/utils.js @@ -29,7 +29,7 @@ export const fetchDiffData = (state, endpoint, category) => { */ export const enrichVulnerabilityWithFeedback = (vulnerability, feedback = []) => feedback - .filter(fb => fb.project_fingerprint === vulnerability.project_fingerprint) + .filter((fb) => fb.project_fingerprint === vulnerability.project_fingerprint) .reduce((vuln, fb) => { if (fb.feedback_type === FEEDBACK_TYPE_DISMISSAL) { return { @@ -63,7 +63,7 @@ export const enrichVulnerabilityWithFeedback = (vulnerability, feedback = []) => * @returns {Object} */ export const parseDiff = (diff, enrichData) => { - const enrichVulnerability = vulnerability => ({ + const enrichVulnerability = (vulnerability) => ({ ...enrichVulnerabilityWithFeedback(vulnerability, enrichData), category: vulnerability.report_type, title: vulnerability.message || vulnerability.name, diff --git a/app/assets/javascripts/vue_shared/translate.js b/app/assets/javascripts/vue_shared/translate.js index e0baf03acc36801f98c71f0534863de4600cf163..616848639f1cd0a96bd289ed4280c4416db4f971 100644 --- a/app/assets/javascripts/vue_shared/translate.js +++ b/app/assets/javascripts/vue_shared/translate.js @@ -1,6 +1,6 @@ import { __, n__, s__, sprintf } from '../locale'; -export default Vue => { +export default (Vue) => { Vue.mixin({ methods: { /** diff --git a/app/assets/javascripts/vuex_shared/bindings.js b/app/assets/javascripts/vuex_shared/bindings.js index cc18b41e2de0f6debcabc0727392fd8ed4dc0e38..741690886b7063e061f96f1ab585eebfd61a3791 100644 --- a/app/assets/javascripts/vuex_shared/bindings.js +++ b/app/assets/javascripts/vuex_shared/bindings.js @@ -11,7 +11,7 @@ */ export const mapComputed = (list, defaultUpdateFn, root) => { const result = {}; - list.forEach(item => { + list.forEach((item) => { const [getter, key, updateFn] = typeof item === 'string' ? [false, item, defaultUpdateFn] diff --git a/app/assets/javascripts/whats_new/components/app.vue b/app/assets/javascripts/whats_new/components/app.vue index 854e6c527017a14ed9b0068b9e58c3134e313f9c..9fc60fa804f410bcb2dd2d33dc8147a742b316bf 100644 --- a/app/assets/javascripts/whats_new/components/app.vue +++ b/app/assets/javascripts/whats_new/components/app.vue @@ -71,7 +71,7 @@ export default { this.setDrawerBodyHeight(height); }, featuresForVersion(version) { - return this.features.filter(feature => { + return this.features.filter((feature) => { return feature.release === parseFloat(version); }); }, diff --git a/app/assets/javascripts/whats_new/index.js b/app/assets/javascripts/whats_new/index.js index ed0258c399283670bcf6beba2c474d685217db29..6da141cb19adb43f5c417f4f69022eeaabb6fc3c 100644 --- a/app/assets/javascripts/whats_new/index.js +++ b/app/assets/javascripts/whats_new/index.js @@ -6,7 +6,7 @@ import { getStorageKey, setNotification } from './utils/notification'; let whatsNewApp; -export default el => { +export default (el) => { if (whatsNewApp) { store.dispatch('openDrawer'); } else { diff --git a/app/assets/javascripts/whats_new/utils/get_drawer_body_height.js b/app/assets/javascripts/whats_new/utils/get_drawer_body_height.js index 21fc90c34a4c2669ff34dfe29bb83e802a3d4b19..7d6c2392974b7241c299e8fc5e6550de59fb3e61 100644 --- a/app/assets/javascripts/whats_new/utils/get_drawer_body_height.js +++ b/app/assets/javascripts/whats_new/utils/get_drawer_body_height.js @@ -1,4 +1,4 @@ -export const getDrawerBodyHeight = drawer => { +export const getDrawerBodyHeight = (drawer) => { const drawerViewableHeight = drawer.clientHeight - drawer.getBoundingClientRect().top; const drawerHeaderHeight = drawer.querySelector('.gl-drawer-header').clientHeight; diff --git a/app/assets/javascripts/whats_new/utils/notification.js b/app/assets/javascripts/whats_new/utils/notification.js index f261a089554f74bed5e63222a6273eb0c31fa899..52ca8058d1cebe036cf4897b81b63e5a2d546993 100644 --- a/app/assets/javascripts/whats_new/utils/notification.js +++ b/app/assets/javascripts/whats_new/utils/notification.js @@ -1,6 +1,6 @@ -export const getStorageKey = appEl => appEl.getAttribute('data-storage-key'); +export const getStorageKey = (appEl) => appEl.getAttribute('data-storage-key'); -export const setNotification = appEl => { +export const setNotification = (appEl) => { const storageKey = getStorageKey(appEl); const notificationEl = document.querySelector('.header-help'); let notificationCountEl = notificationEl.querySelector('.js-whats-new-notification-count'); diff --git a/app/assets/javascripts/zen_mode.js b/app/assets/javascripts/zen_mode.js index 260ee972783de71d28d6302b32294691fe393e01..3ee9a19e2d937d9d6a1cfa1f891a71ae0888828c 100644 --- a/app/assets/javascripts/zen_mode.js +++ b/app/assets/javascripts/zen_mode.js @@ -39,21 +39,21 @@ export default class ZenMode { constructor() { this.active_backdrop = null; this.active_textarea = null; - $(document).on('click', '.js-zen-enter', e => { + $(document).on('click', '.js-zen-enter', (e) => { e.preventDefault(); return $(e.currentTarget).trigger('zen_mode:enter'); }); - $(document).on('click', '.js-zen-leave', e => { + $(document).on('click', '.js-zen-leave', (e) => { e.preventDefault(); return $(e.currentTarget).trigger('zen_mode:leave'); }); - $(document).on('zen_mode:enter', e => { + $(document).on('zen_mode:enter', (e) => { this.enter($(e.target).closest('.md-area').find('.zen-backdrop')); }); $(document).on('zen_mode:leave', () => { this.exit(); }); - $(document).on('keydown', e => { + $(document).on('keydown', (e) => { // Esc if (e.keyCode === 27) { e.preventDefault(); diff --git a/config/helpers/is_eslint.js b/config/helpers/is_eslint.js index 55ec42e68c1d32bf9c4bb6f48767db9bb9b2d145..60528796962ec3519baa8a1fb72e9f6314aed72a 100644 --- a/config/helpers/is_eslint.js +++ b/config/helpers/is_eslint.js @@ -1,7 +1,7 @@ /** * Returns true if the given module is required from eslint */ -const isESLint = mod => { +const isESLint = (mod) => { let parent = mod.parent; while (parent) { diff --git a/config/helpers/vendor_dll_hash.js b/config/helpers/vendor_dll_hash.js index ca7b564a07c96639525906e87eda2b3b6fe064ec..2df97e7b95d609b6eee217ee36af537075c171e4 100644 --- a/config/helpers/vendor_dll_hash.js +++ b/config/helpers/vendor_dll_hash.js @@ -9,9 +9,9 @@ const CACHE_PATHS = [ './yarn.lock', ]; -const resolvePath = file => path.resolve(__dirname, '../..', file); -const readFile = file => fs.readFileSync(file); -const fileHash = buffer => crypto.createHash('md5').update(buffer).digest('hex'); +const resolvePath = (file) => path.resolve(__dirname, '../..', file); +const readFile = (file) => fs.readFileSync(file); +const fileHash = (buffer) => crypto.createHash('md5').update(buffer).digest('hex'); module.exports = () => { const fileBuffers = CACHE_PATHS.map(resolvePath).map(readFile); diff --git a/config/karma.config.js b/config/karma.config.js index 23afc437608dc79f01c896429af3e3c86588ed57..1d65e65ce2ac6383f4dc346396c9b7c7c96bdfc9 100644 --- a/config/karma.config.js +++ b/config/karma.config.js @@ -71,13 +71,13 @@ const createContext = (specFiles, regex, suffix) => { if (specFilters.length) { // resolve filters - let filteredSpecFiles = specFilters.map(filter => + let filteredSpecFiles = specFilters.map((filter) => glob .sync(filter, { root: ROOT_PATH, matchBase: true, }) - .filter(path => path.endsWith('spec.js')), + .filter((path) => path.endsWith('spec.js')), ); // flatten @@ -92,14 +92,14 @@ if (specFilters.length) { exit('Your filter did not match any test files.', isError); } - if (!filteredSpecFiles.every(file => SPECS_PATH.test(file))) { + if (!filteredSpecFiles.every((file) => SPECS_PATH.test(file))) { exitError('Test files must be located within /spec/javascripts.'); } - const CE_FILES = filteredSpecFiles.filter(file => !file.startsWith('ee')); + const CE_FILES = filteredSpecFiles.filter((file) => !file.startsWith('ee')); createContext(CE_FILES, /[^e]{2}[\\\/]spec[\\\/]javascripts$/, 'spec/javascripts'); - const EE_FILES = filteredSpecFiles.filter(file => file.startsWith('ee')); + const EE_FILES = filteredSpecFiles.filter((file) => file.startsWith('ee')); createContext(EE_FILES, /ee[\\\/]spec[\\\/]javascripts$/, 'ee/spec/javascripts'); }