Commit 816a5658 authored by Paul Gascou-Vaillancourt's avatar Paul Gascou-Vaillancourt Committed by Natalia Tepluhina

Address camel case violations

- Converted identifiers to camelCase when possible
- Removed outdated camelcase ignores
- Ignored babel/camelcase everywhere else
parent bd3f5d88
/* eslint-disable camelcase, guard-for-in, no-restricted-syntax */ /* eslint-disable guard-for-in, no-restricted-syntax */
/* global NoteModel */ /* global NoteModel */
import $ from 'jquery'; import $ from 'jquery';
...@@ -40,13 +40,13 @@ class DiscussionModel { ...@@ -40,13 +40,13 @@ class DiscussionModel {
return true; return true;
} }
resolveAllNotes(resolved_by) { resolveAllNotes(resolvedBy) {
for (const noteId in this.notes) { for (const noteId in this.notes) {
const note = this.notes[noteId]; const note = this.notes[noteId];
if (!note.resolved) { if (!note.resolved) {
note.resolved = true; note.resolved = true;
note.resolved_by = resolved_by; note.resolved_by = resolvedBy;
} }
} }
} }
......
/* eslint-disable camelcase, no-restricted-syntax, guard-for-in */ /* eslint-disable no-restricted-syntax, guard-for-in */
/* global DiscussionModel */ /* global DiscussionModel */
import Vue from 'vue'; import Vue from 'vue';
...@@ -26,11 +26,11 @@ window.CommentsStore = { ...@@ -26,11 +26,11 @@ window.CommentsStore = {
discussion.createNote(noteObj); discussion.createNote(noteObj);
}, },
update(discussionId, noteId, resolved, resolved_by) { update(discussionId, noteId, resolved, resolvedBy) {
const discussion = this.state[discussionId]; const discussion = this.state[discussionId];
const note = discussion.getNote(noteId); const note = discussion.getNote(noteId);
note.resolved = resolved; note.resolved = resolved;
note.resolved_by = resolved_by; note.resolved_by = resolvedBy;
}, },
delete(discussionId, noteId) { delete(discussionId, noteId) {
const discussion = this.state[discussionId]; const discussion = this.state[discussionId];
......
export function hasInlineLines(diffFile) { export function hasInlineLines(diffFile) {
return diffFile?.highlighted_diff_lines?.length > 0; /* eslint-disable-line camelcase */ return diffFile?.highlighted_diff_lines?.length > 0;
} }
export function hasParallelLines(diffFile) { export function hasParallelLines(diffFile) {
return diffFile?.parallel_diff_lines?.length > 0; /* eslint-disable-line camelcase */ return diffFile?.parallel_diff_lines?.length > 0;
} }
export function isSingleViewStyle(diffFile) { export function isSingleViewStyle(diffFile) {
...@@ -11,9 +11,5 @@ export function isSingleViewStyle(diffFile) { ...@@ -11,9 +11,5 @@ export function isSingleViewStyle(diffFile) {
} }
export function hasDiff(diffFile) { export function hasDiff(diffFile) {
return ( return hasInlineLines(diffFile) || hasParallelLines(diffFile) || !diffFile?.blob?.readable_text;
hasInlineLines(diffFile) ||
hasParallelLines(diffFile) ||
!diffFile?.blob?.readable_text /* eslint-disable-line camelcase */
);
} }
...@@ -133,9 +133,9 @@ export const loadBranch = ({ dispatch, getters }, { projectId, branchId }) => ...@@ -133,9 +133,9 @@ export const loadBranch = ({ dispatch, getters }, { projectId, branchId }) =>
ref: branch.commit.id, ref: branch.commit.id,
}); });
}) })
.catch(() => { .catch(err => {
dispatch('showBranchNotFoundError', branchId); dispatch('showBranchNotFoundError', branchId);
return Promise.reject(); throw err;
}); });
export const openBranch = ({ dispatch, state, getters }, { projectId, branchId, basePath }) => { export const openBranch = ({ dispatch, state, getters }, { projectId, branchId, basePath }) => {
......
...@@ -8,7 +8,7 @@ export function resetServiceWorkersPublicPath() { ...@@ -8,7 +8,7 @@ export function resetServiceWorkersPublicPath() {
// see: https://webpack.js.org/guides/public-path/ // see: https://webpack.js.org/guides/public-path/
const relativeRootPath = (gon && gon.relative_url_root) || ''; const relativeRootPath = (gon && gon.relative_url_root) || '';
const webpackAssetPath = joinPaths(relativeRootPath, '/assets/webpack/'); const webpackAssetPath = joinPaths(relativeRootPath, '/assets/webpack/');
__webpack_public_path__ = webpackAssetPath; // eslint-disable-line camelcase __webpack_public_path__ = webpackAssetPath; // eslint-disable-line babel/camelcase
// monaco-editor-webpack-plugin currently (incorrectly) references the // monaco-editor-webpack-plugin currently (incorrectly) references the
// public path as a property of `window`. Once this is fixed upstream we // public path as a property of `window`. Once this is fixed upstream we
......
/* eslint-disable no-param-reassign, camelcase, no-nested-ternary, no-continue */ /* eslint-disable no-param-reassign, babel/camelcase, no-nested-ternary, no-continue */
import $ from 'jquery'; import $ from 'jquery';
import Vue from 'vue'; import Vue from 'vue';
......
/* eslint-disable func-names, consistent-return, camelcase */ /* eslint-disable func-names, consistent-return */
import $ from 'jquery'; import $ from 'jquery';
import { __ } from '../locale'; import { __ } from '../locale';
...@@ -270,14 +270,14 @@ export default class BranchGraph { ...@@ -270,14 +270,14 @@ export default class BranchGraph {
stroke: 'none', stroke: 'none',
}); });
const avatar_box_x = this.offsetX + this.unitSpace * this.mspace + 10; const avatarBoxX = this.offsetX + this.unitSpace * this.mspace + 10;
const avatar_box_y = y - 10; const avatarBoxY = y - 10;
r.rect(avatar_box_x, avatar_box_y, 20, 20).attr({ r.rect(avatarBoxX, avatarBoxY, 20, 20).attr({
stroke: this.colors[commit.space], stroke: this.colors[commit.space],
'stroke-width': 2, 'stroke-width': 2,
}); });
r.image(commit.author.icon, avatar_box_x, avatar_box_y, 20, 20); r.image(commit.author.icon, avatarBoxX, avatarBoxY, 20, 20);
return r return r
.text(this.offsetX + this.unitSpace * this.mspace + 35, y, commit.message.split('\n')[0]) .text(this.offsetX + this.unitSpace * this.mspace + 35, y, commit.message.split('\n')[0])
.attr({ .attr({
......
/* eslint-disable no-restricted-properties, camelcase, /* eslint-disable no-restricted-properties, babel/camelcase,
no-unused-expressions, default-case, no-unused-expressions, default-case,
consistent-return, no-alert, no-param-reassign, no-else-return, consistent-return, no-alert, no-param-reassign, no-else-return,
no-shadow, no-useless-escape, no-shadow, no-useless-escape,
......
/* eslint-disable func-names, prefer-rest-params, consistent-return, no-shadow, no-else-return, no-self-compare, no-unused-expressions, yoda, prefer-spread, camelcase, no-param-reassign */ /* eslint-disable func-names, prefer-rest-params, consistent-return, no-shadow, no-else-return, no-self-compare, no-unused-expressions, yoda, prefer-spread, babel/camelcase, no-param-reassign */
/* global Issuable */ /* global Issuable */
/* global emitSidebarEvent */ /* global emitSidebarEvent */
......
...@@ -5,5 +5,5 @@ ...@@ -5,5 +5,5 @@
*/ */
if (gon && gon.webpack_public_path) { if (gon && gon.webpack_public_path) {
__webpack_public_path__ = gon.webpack_public_path; // eslint-disable-line camelcase __webpack_public_path__ = gon.webpack_public_path; // eslint-disable-line babel/camelcase
} }
/* eslint-disable consistent-return, camelcase, class-methods-use-this */ /* eslint-disable consistent-return, class-methods-use-this */
// Zen Mode (full screen) textarea // Zen Mode (full screen) textarea
// //
...@@ -91,8 +91,8 @@ export default class ZenMode { ...@@ -91,8 +91,8 @@ export default class ZenMode {
} }
} }
scrollTo(zen_area) { scrollTo(zenArea) {
return $.scrollTo(zen_area, 0, { return $.scrollTo(zenArea, 0, {
offset: -150, offset: -150,
}); });
} }
......
...@@ -36,6 +36,6 @@ export const start = ({ rootState, commit }) => { ...@@ -36,6 +36,6 @@ export const start = ({ rootState, commit }) => {
}) })
.catch(err => { .catch(err => {
commit(types.SET_ERROR, err); commit(types.SET_ERROR, err);
return Promise.reject(err); throw err;
}); });
}; };
...@@ -62,7 +62,6 @@ export default { ...@@ -62,7 +62,6 @@ export default {
...this.diffFileCommentForm, ...this.diffFileCommentForm,
}); });
// eslint-disable-next-line camelcase
const diffFileHeadSha = this.commit && this?.diffFile?.diff_refs?.head_sha; const diffFileHeadSha = this.commit && this?.diffFile?.diff_refs?.head_sha;
postData.data.note.commit_id = diffFileHeadSha || null; postData.data.note.commit_id = diffFileHeadSha || null;
......
export default ({ packageEntity }) => { export default ({ packageEntity }) => {
// eslint-disable-next-line camelcase
if (packageEntity?.build_info?.pipeline_id) { if (packageEntity?.build_info?.pipeline_id) {
return true; return true;
} }
......
...@@ -202,7 +202,6 @@ export default { ...@@ -202,7 +202,6 @@ export default {
this.setCanCreateIssuePermission(this.canCreateIssue); this.setCanCreateIssuePermission(this.canCreateIssue);
this.setCanCreateFeedbackPermission(this.canCreateFeedback); this.setCanCreateFeedbackPermission(this.canCreateFeedback);
// eslint-disable-next-line camelcase
const sastDiffEndpoint = gl?.mrWidgetData?.sast_comparison_path; const sastDiffEndpoint = gl?.mrWidgetData?.sast_comparison_path;
if (sastDiffEndpoint && this.hasSastReports) { if (sastDiffEndpoint && this.hasSastReports) {
...@@ -210,7 +209,6 @@ export default { ...@@ -210,7 +209,6 @@ export default {
this.fetchSastDiff(); this.fetchSastDiff();
} }
// eslint-disable-next-line camelcase
const containerScanningDiffEndpoint = gl?.mrWidgetData?.container_scanning_comparison_path; const containerScanningDiffEndpoint = gl?.mrWidgetData?.container_scanning_comparison_path;
if (containerScanningDiffEndpoint && this.hasContainerScanningReports) { if (containerScanningDiffEndpoint && this.hasContainerScanningReports) {
...@@ -218,7 +216,6 @@ export default { ...@@ -218,7 +216,6 @@ export default {
this.fetchContainerScanningDiff(); this.fetchContainerScanningDiff();
} }
// eslint-disable-next-line camelcase
const dastDiffEndpoint = gl?.mrWidgetData?.dast_comparison_path; const dastDiffEndpoint = gl?.mrWidgetData?.dast_comparison_path;
if (dastDiffEndpoint && this.hasDastReports) { if (dastDiffEndpoint && this.hasDastReports) {
...@@ -226,7 +223,6 @@ export default { ...@@ -226,7 +223,6 @@ export default {
this.fetchDastDiff(); this.fetchDastDiff();
} }
// eslint-disable-next-line camelcase
const dependencyScanningDiffEndpoint = gl?.mrWidgetData?.dependency_scanning_comparison_path; const dependencyScanningDiffEndpoint = gl?.mrWidgetData?.dependency_scanning_comparison_path;
if (dependencyScanningDiffEndpoint && this.hasDependencyScanningReports) { if (dependencyScanningDiffEndpoint && this.hasDependencyScanningReports) {
......
...@@ -4,7 +4,7 @@ import DependenciesTable from 'ee/dependencies/components/dependencies_table.vue ...@@ -4,7 +4,7 @@ import DependenciesTable from 'ee/dependencies/components/dependencies_table.vue
import PaginatedDependenciesTable from 'ee/dependencies/components/paginated_dependencies_table.vue'; import PaginatedDependenciesTable from 'ee/dependencies/components/paginated_dependencies_table.vue';
import { DEPENDENCY_LIST_TYPES } from 'ee/dependencies/store/constants'; import { DEPENDENCY_LIST_TYPES } from 'ee/dependencies/store/constants';
import Pagination from '~/vue_shared/components/pagination_links.vue'; import Pagination from '~/vue_shared/components/pagination_links.vue';
import mockDependenciesResponse from '../store/modules/list/data/mock_dependencies'; import mockDependenciesResponse from '../store/modules/list/data/mock_dependencies.json';
describe('PaginatedDependenciesTable component', () => { describe('PaginatedDependenciesTable component', () => {
let store; let store;
......
...@@ -13,7 +13,7 @@ import { ...@@ -13,7 +13,7 @@ import {
} from 'ee/dependencies/store/modules/list/constants'; } from 'ee/dependencies/store/modules/list/constants';
import createFlash from '~/flash'; import createFlash from '~/flash';
import mockDependenciesResponse from './data/mock_dependencies'; import mockDependenciesResponse from './data/mock_dependencies.json';
jest.mock('~/flash', () => jest.fn()); jest.mock('~/flash', () => jest.fn());
......
...@@ -6,7 +6,7 @@ import FeatureFlagsComponent from 'ee/feature_flags/components/feature_flags.vue ...@@ -6,7 +6,7 @@ import FeatureFlagsComponent from 'ee/feature_flags/components/feature_flags.vue
import FeatureFlagsTable from 'ee/feature_flags/components/feature_flags_table.vue'; import FeatureFlagsTable from 'ee/feature_flags/components/feature_flags_table.vue';
import ConfigureFeatureFlagsModal from 'ee/feature_flags/components/configure_feature_flags_modal.vue'; import ConfigureFeatureFlagsModal from 'ee/feature_flags/components/configure_feature_flags_modal.vue';
import { TEST_HOST } from 'spec/test_constants'; import { TEST_HOST } from 'spec/test_constants';
import NavigationTabs from '~/vue_shared/components/navigation_tabs'; import NavigationTabs from '~/vue_shared/components/navigation_tabs.vue';
import TablePagination from '~/vue_shared/components/pagination/table_pagination.vue'; import TablePagination from '~/vue_shared/components/pagination/table_pagination.vue';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import { getRequestData } from '../mock_data'; import { getRequestData } from '../mock_data';
......
...@@ -5,7 +5,7 @@ import { toLicenseObject } from 'ee/project_licenses/utils/mappers'; ...@@ -5,7 +5,7 @@ import { toLicenseObject } from 'ee/project_licenses/utils/mappers';
import { LICENSE_LIST } from 'ee/project_licenses/store/constants'; import { LICENSE_LIST } from 'ee/project_licenses/store/constants';
import PaginatedLicensesTable from 'ee/project_licenses/components/paginated_licenses_table.vue'; import PaginatedLicensesTable from 'ee/project_licenses/components/paginated_licenses_table.vue';
import Pagination from '~/vue_shared/components/pagination_links.vue'; import Pagination from '~/vue_shared/components/pagination_links.vue';
import mockLicensesResponse from '../store/modules/list/data/mock_licenses'; import mockLicensesResponse from '../store/modules/list/data/mock_licenses.json';
jest.mock('underscore', () => ({ jest.mock('underscore', () => ({
uniqueId: () => 'fakeUniqueId', uniqueId: () => 'fakeUniqueId',
......
...@@ -9,7 +9,7 @@ import getInitialState from 'ee/project_licenses/store/modules/list/state'; ...@@ -9,7 +9,7 @@ import getInitialState from 'ee/project_licenses/store/modules/list/state';
import { FETCH_ERROR_MESSAGE } from 'ee/project_licenses/store/modules/list/constants'; import { FETCH_ERROR_MESSAGE } from 'ee/project_licenses/store/modules/list/constants';
import createFlash from '~/flash'; import createFlash from '~/flash';
import mockLicensesResponse from './data/mock_licenses'; import mockLicensesResponse from './data/mock_licenses.json';
jest.mock('~/flash', () => jest.fn()); jest.mock('~/flash', () => jest.fn());
......
import Vuex from 'vuex'; import Vuex from 'vuex';
import { createLocalVue, shallowMount } from '@vue/test-utils'; import { createLocalVue, shallowMount } from '@vue/test-utils';
import IdeStatusList from '~/ide/components/ide_status_list'; import IdeStatusList from '~/ide/components/ide_status_list.vue';
const TEST_FILE = { const TEST_FILE = {
name: 'lorem.md', name: 'lorem.md',
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import MRPopover from '~/mr_popover/components/mr_popover'; import MRPopover from '~/mr_popover/components/mr_popover.vue';
import CiIcon from '~/vue_shared/components/ci_icon.vue'; import CiIcon from '~/vue_shared/components/ci_icon.vue';
describe('MR Popover', () => { describe('MR Popover', () => {
......
import Vuex from 'vuex'; import Vuex from 'vuex';
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import ReleaseDetailApp from '~/releases/detail/components/app'; import ReleaseDetailApp from '~/releases/detail/components/app.vue';
import { release } from '../../mock_data'; import { release } from '../../mock_data';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils'; import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
......
...@@ -4,7 +4,7 @@ import ConfidentialIssueSidebar from '~/sidebar/components/confidential/confiden ...@@ -4,7 +4,7 @@ import ConfidentialIssueSidebar from '~/sidebar/components/confidential/confiden
import EditForm from '~/sidebar/components/confidential/edit_form.vue'; import EditForm from '~/sidebar/components/confidential/edit_form.vue';
import SidebarService from '~/sidebar/services/sidebar_service'; import SidebarService from '~/sidebar/services/sidebar_service';
import createFlash from '~/flash'; import createFlash from '~/flash';
import RecaptchaModal from '~/vue_shared/components/recaptcha_modal'; import RecaptchaModal from '~/vue_shared/components/recaptcha_modal.vue';
jest.mock('~/flash'); jest.mock('~/flash');
jest.mock('~/sidebar/services/sidebar_service'); jest.mock('~/sidebar/services/sidebar_service');
......
...@@ -2,7 +2,7 @@ import { shallowMount } from '@vue/test-utils'; ...@@ -2,7 +2,7 @@ import { shallowMount } from '@vue/test-utils';
import { eventHub } from '~/vue_shared/components/recaptcha_eventhub'; import { eventHub } from '~/vue_shared/components/recaptcha_eventhub';
import RecaptchaModal from '~/vue_shared/components/recaptcha_modal'; import RecaptchaModal from '~/vue_shared/components/recaptcha_modal.vue';
describe('RecaptchaModal', () => { describe('RecaptchaModal', () => {
const recaptchaFormId = 'recaptcha-form'; const recaptchaFormId = 'recaptcha-form';
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import SlotSwitch from '~/vue_shared/components/slot_switch'; import SlotSwitch from '~/vue_shared/components/slot_switch.vue';
describe('SlotSwitch', () => { describe('SlotSwitch', () => {
const slots = { const slots = {
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment