Commit 600155b6 authored by Mark Florian's avatar Mark Florian

Disable default export rules

This is part of the work to implement the consensus reached in the
[RFC][1] to prefer named exports over defalt exports.

Future iterations will migrate existing default exports to named
exports.

The bulk of the changes in this commit were performed with the following
script:

```bash
set -u

changed-files()
{
    local trunk="origin/master"
    local file=
    local committed_files=$(git diff "$trunk"... --numstat \
        | awk '/\.(js|vue)$/{ print $3 }')
    local changed_files=$(git diff --numstat \
        | awk '/\.(js|vue)$/{ print $3 }')
    for file in ${committed_files[@]} ${changed_files[@]}; do
        if [ -f "$file" ]; then
            echo "$file"
        fi
    done
}

git grep -lz "import/prefer-default-export" -- '**/*.js' \
    | xargs -0 perl -0pi -e \
    "s/[^\n]*eslint-disable[^\n]*"\
"import\/prefer-default-export[^\n]*\n//mgs"

git grep -lz "rfcs/-/issues/20" -- '**/*.js' \
    | xargs -0 perl -0pi -e \
    "s/[^\n]*rfcs\/-\/issues\/20[^\n]*\n//mgs"

yarn prettier --write $(changed-files)
```

The script is [idempotent][2], to help make it easier to keep
up-to-date.

[1]: https://gitlab.com/gitlab-org/frontend/rfcs/-/issues/20
[2]: https://en.wikipedia.org/wiki/Idempotence
parent 53814371
...@@ -17,6 +17,7 @@ settings: ...@@ -17,6 +17,7 @@ settings:
config: './config/webpack.config.js' config: './config/webpack.config.js'
rules: rules:
import/no-commonjs: error import/no-commonjs: error
import/no-default-export: off
no-underscore-dangle: no-underscore-dangle:
- error - error
- allow: - allow:
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
* and returns an array of the following form: * and returns an array of the following form:
* [{ key: "forks", label: "Forks", value: 50 }] * [{ key: "forks", label: "Forks", value: 50 }]
*/ */
// eslint-disable-next-line import/prefer-default-export
export const getStatistics = state => labels => export const getStatistics = state => labels =>
Object.keys(labels).map(key => { Object.keys(labels).map(key => {
const result = { const result = {
......
...@@ -3,7 +3,6 @@ import { mapActions } from 'vuex'; ...@@ -3,7 +3,6 @@ import { mapActions } from 'vuex';
import store from '~/mr_notes/stores'; import store from '~/mr_notes/stores';
import ReviewBar from './components/review_bar.vue'; import ReviewBar from './components/review_bar.vue';
// eslint-disable-next-line import/prefer-default-export
export const initReviewBar = () => { export const initReviewBar = () => {
const el = document.getElementById('js-review-bar'); const el = document.getElementById('js-review-bar');
......
import { __ } from '~/locale'; import { __ } from '~/locale';
// eslint-disable import/prefer-default-export
export const ADD_CI_VARIABLE_MODAL_ID = 'add-ci-variable'; export const ADD_CI_VARIABLE_MODAL_ID = 'add-ci-variable';
export const displayText = { export const displayText = {
......
/* eslint-disable import/prefer-default-export */
// Disabling import/prefer-default-export can be
// removed once a second getter is added to this file
import { uniq } from 'lodash'; import { uniq } from 'lodash';
export const joinedEnvironments = state => { export const joinedEnvironments = state => {
......
...@@ -3,7 +3,6 @@ import { __ } from '~/locale'; ...@@ -3,7 +3,6 @@ import { __ } from '~/locale';
import service from '../services/contributors_service'; import service from '../services/contributors_service';
import * as types from './mutation_types'; import * as types from './mutation_types';
// eslint-disable-next-line import/prefer-default-export
export const fetchChartData = ({ commit }, endpoint) => { export const fetchChartData = ({ commit }, endpoint) => {
commit(types.SET_LOADING_STATE, true); commit(types.SET_LOADING_STATE, true);
......
// eslint-disable-next-line import/prefer-default-export
export const KUBERNETES_VERSIONS = [{ name: '1.14', value: '1.14' }]; export const KUBERNETES_VERSIONS = [{ name: '1.14', value: '1.14' }];
// eslint-disable-next-line import/prefer-default-export
export const subnetValid = ({ selectedSubnet }) => export const subnetValid = ({ selectedSubnet }) =>
Array.isArray(selectedSubnet) && selectedSubnet.length >= 2; Array.isArray(selectedSubnet) && selectedSubnet.length >= 2;
...@@ -5,7 +5,6 @@ const DESIGN_TRACKING_CONTEXT_SCHEMA = 'iglu:com.gitlab/design_management_contex ...@@ -5,7 +5,6 @@ const DESIGN_TRACKING_CONTEXT_SCHEMA = 'iglu:com.gitlab/design_management_contex
const DESIGN_TRACKING_PAGE_NAME = 'projects:issues:design'; const DESIGN_TRACKING_PAGE_NAME = 'projects:issues:design';
const DESIGN_TRACKING_EVENT_NAME = 'view_design'; const DESIGN_TRACKING_EVENT_NAME = 'view_design';
// eslint-disable-next-line import/prefer-default-export
export function trackDesignDetailView( export function trackDesignDetailView(
referer = '', referer = '',
owner = '', owner = '',
......
...@@ -5,7 +5,6 @@ const DESIGN_TRACKING_CONTEXT_SCHEMA = 'iglu:com.gitlab/design_management_contex ...@@ -5,7 +5,6 @@ const DESIGN_TRACKING_CONTEXT_SCHEMA = 'iglu:com.gitlab/design_management_contex
const DESIGN_TRACKING_PAGE_NAME = 'projects:issues:design'; const DESIGN_TRACKING_PAGE_NAME = 'projects:issues:design';
const DESIGN_TRACKING_EVENT_NAME = 'view_design'; const DESIGN_TRACKING_EVENT_NAME = 'view_design';
// eslint-disable-next-line import/prefer-default-export
export function trackDesignDetailView( export function trackDesignDetailView(
referer = '', referer = '',
owner = '', owner = '',
......
...@@ -18,7 +18,6 @@ function fileSymlinkInformation(file, fileList) { ...@@ -18,7 +18,6 @@ function fileSymlinkInformation(file, fileList) {
); );
} }
/* eslint-disable-next-line import/prefer-default-export */
export function prepareRawDiffFile({ file, allFiles }) { export function prepareRawDiffFile({ file, allFiles }) {
Object.assign(file, { Object.assign(file, {
brokenSymlink: fileSymlinkInformation(file, allFiles), brokenSymlink: fileSymlinkInformation(file, allFiles),
......
...@@ -11,9 +11,6 @@ ...@@ -11,9 +11,6 @@
* @typedef {String} UUIDv4 * @typedef {String} UUIDv4
*/ */
// https://gitlab.com/gitlab-org/frontend/rfcs/-/issues/20
/* eslint-disable import/prefer-default-export */
import MersenneTwister from 'mersenne-twister'; import MersenneTwister from 'mersenne-twister';
import stringHash from 'string-hash'; import stringHash from 'string-hash';
import { isString } from 'lodash'; import { isString } from 'lodash';
......
...@@ -4,5 +4,4 @@ ...@@ -4,5 +4,4 @@
* @param {Object} environment * @param {Object} environment
* @returns {Object} * @returns {Object}
*/ */
// eslint-disable-next-line import/prefer-default-export
export const setDeployBoard = (oldEnvironmentState, environment) => environment; export const setDeployBoard = (oldEnvironmentState, environment) => environment;
...@@ -10,7 +10,6 @@ const stopPolling = poll => { ...@@ -10,7 +10,6 @@ const stopPolling = poll => {
if (poll) poll.stop(); if (poll) poll.stop();
}; };
// eslint-disable-next-line import/prefer-default-export
export function startPollingStacktrace({ commit }, endpoint) { export function startPollingStacktrace({ commit }, endpoint) {
stackTracePoll = new Poll({ stackTracePoll = new Poll({
resource: service, resource: service,
......
// eslint-disable-next-line import/prefer-default-export
export const stacktrace = state => export const stacktrace = state =>
state.stacktraceData.stack_trace_entries state.stacktraceData.stack_trace_entries
? state.stacktraceData.stack_trace_entries.reverse() ? state.stacktraceData.stack_trace_entries.reverse()
......
// eslint-disable-next-line import/prefer-default-export
export const hasSearchQuery = state => state.searchQuery !== ''; export const hasSearchQuery = state => state.searchQuery !== '';
...@@ -33,7 +33,6 @@ const EmptyRouterComponent = { ...@@ -33,7 +33,6 @@ const EmptyRouterComponent = {
}, },
}; };
// eslint-disable-next-line import/prefer-default-export
export const createRouter = store => { export const createRouter = store => {
const router = new IdeRouter({ const router = new IdeRouter({
mode: 'history', mode: 'history',
......
import { diffLines } from 'diff'; import { diffLines } from 'diff';
import { defaultDiffOptions } from '../editor_options'; import { defaultDiffOptions } from '../editor_options';
// See: https://gitlab.com/gitlab-org/frontend/rfcs/-/issues/20
// eslint-disable-next-line import/prefer-default-export
export const computeDiff = (originalContent, newContent) => { export const computeDiff = (originalContent, newContent) => {
// prevent EOL changes from highlighting the entire file // prevent EOL changes from highlighting the entire file
const changes = diffLines( const changes = diffLines(
......
...@@ -42,7 +42,6 @@ function getRulesWithConfigs(filePath, configFiles = [], rules = {}) { ...@@ -42,7 +42,6 @@ function getRulesWithConfigs(filePath, configFiles = [], rules = {}) {
return isRoot ? result : getRulesWithConfigs(filePath, nextConfigs, result); return isRoot ? result : getRulesWithConfigs(filePath, nextConfigs, result);
} }
// eslint-disable-next-line import/prefer-default-export
export function getRulesWithTraversal(filePath, getFileContent) { export function getRulesWithTraversal(filePath, getFileContent) {
const editorconfigPaths = [ const editorconfigPaths = [
...getPathParents(filePath).map(x => `${x}/.editorconfig`), ...getPathParents(filePath).map(x => `${x}/.editorconfig`),
......
...@@ -17,5 +17,4 @@ const getClient = memoize(() => ...@@ -17,5 +17,4 @@ const getClient = memoize(() =>
), ),
); );
// eslint-disable-next-line import/prefer-default-export
export const query = (...args) => getClient().query(...args); export const query = (...args) => getClient().query(...args);
// eslint-disable-next-line import/prefer-default-export
export const isAliveView = state => view => export const isAliveView = state => view =>
state.keepAliveViews[view] || (state.isOpen && state.currentView === view); state.keepAliveViews[view] || (state.isOpen && state.currentView === view);
// eslint-disable-next-line import/prefer-default-export
export const states = { export const states = {
failed: 'failed', failed: 'failed',
}; };
// eslint-disable-next-line import/prefer-default-export
export const normalizeJob = job => ({ export const normalizeJob = job => ({
id: job.id, id: job.id,
name: job.name, name: job.name,
......
import * as types from './mutation_types'; import * as types from './mutation_types';
// eslint-disable-next-line import/prefer-default-export
export const push = ({ commit }, fullPath) => { export const push = ({ commit }, fullPath) => {
commit(types.PUSH, fullPath); commit(types.PUSH, fullPath);
}; };
// eslint-disable-next-line import/prefer-default-export
export const PUSH = 'PUSH'; export const PUSH = 'PUSH';
// eslint-disable-next-line import/prefer-default-export
export const allCheck = state => { export const allCheck = state => {
const checks = Object.values(state.checks); const checks = Object.values(state.checks);
......
/* eslint-disable import/prefer-default-export */
/** /**
* This method adds listeners to the given router and store and syncs their state with eachother * This method adds listeners to the given router and store and syncs their state with eachother
* *
......
import { STATUSES } from './constants'; import { STATUSES } from './constants';
// Will be expanded in future // Will be expanded in future
// eslint-disable-next-line import/prefer-default-export
export function isProjectImportable(project) { export function isProjectImportable(project) {
return project.importStatus === STATUSES.NONE && !project.importSource.incompatible; return project.importStatus === STATUSES.NONE && !project.importSource.incompatible;
} }
import * as types from './mutation_types'; import * as types from './mutation_types';
// eslint-disable-next-line import/prefer-default-export
export const setOverride = ({ commit }, override) => commit(types.SET_OVERRIDE, override); export const setOverride = ({ commit }, override) => commit(types.SET_OVERRIDE, override);
...@@ -7,7 +7,6 @@ import createState from './state'; ...@@ -7,7 +7,6 @@ import createState from './state';
Vue.use(Vuex); Vue.use(Vuex);
// eslint-disable-next-line import/prefer-default-export
export const createStore = (initialState = {}) => export const createStore = (initialState = {}) =>
new Vuex.Store({ new Vuex.Store({
actions, actions,
......
// eslint-disable-next-line import/prefer-default-export
export const SET_OVERRIDE = 'SET_OVERRIDE'; export const SET_OVERRIDE = 'SET_OVERRIDE';
...@@ -3,7 +3,6 @@ import { __ } from '~/locale'; ...@@ -3,7 +3,6 @@ import { __ } from '~/locale';
/** /**
* Returns the attributes used for gl-empty-state in the Service Desk issues list. * Returns the attributes used for gl-empty-state in the Service Desk issues list.
*/ */
// eslint-disable-next-line import/prefer-default-export
export function emptyStateHelper(emptyStateMeta) { export function emptyStateHelper(emptyStateMeta) {
const { isServiceDeskSupported, svgPath, serviceDeskHelpPage } = emptyStateMeta; const { isServiceDeskSupported, svgPath, serviceDeskHelpPage } = emptyStateMeta;
......
/* eslint-disable import/prefer-default-export */
export function isImageLoaded(element) { export function isImageLoaded(element) {
return element.complete && element.naturalHeight !== 0; return element.complete && element.naturalHeight !== 0;
} }
...@@ -4,6 +4,5 @@ ...@@ -4,6 +4,5 @@
* @param {Set} superset The set to be considered as the superset. * @param {Set} superset The set to be considered as the superset.
* @returns {boolean} * @returns {boolean}
*/ */
// eslint-disable-next-line import/prefer-default-export
export const isSubset = (subset, superset) => export const isSubset = (subset, superset) =>
Array.from(subset).every(value => superset.has(value)); Array.from(subset).every(value => superset.has(value));
// eslint-disable-next-line import/prefer-default-export
export const isObject = obj => obj && obj.constructor === Object; export const isObject = obj => obj && obj.constructor === Object;
import { joinPaths } from '~/lib/utils/url_utility'; import { joinPaths } from '~/lib/utils/url_utility';
// tell webpack to load assets from origin so that web workers don't break // tell webpack to load assets from origin so that web workers don't break
// eslint-disable-next-line import/prefer-default-export
export function resetServiceWorkersPublicPath() { export function resetServiceWorkersPublicPath() {
// __webpack_public_path__ is a global variable that can be used to adjust // __webpack_public_path__ is a global variable that can be used to adjust
// the webpack publicPath setting at runtime. // the webpack publicPath setting at runtime.
......
...@@ -125,7 +125,6 @@ const csvData = (metricHeaders, metricValues) => { ...@@ -125,7 +125,6 @@ const csvData = (metricHeaders, metricValues) => {
* @param {Object} graphData - Panel contents * @param {Object} graphData - Panel contents
* @returns {String} * @returns {String}
*/ */
// eslint-disable-next-line import/prefer-default-export
export const graphDataToCsv = graphData => { export const graphDataToCsv = graphData => {
const delimiter = ','; const delimiter = ',';
const br = '\r\n'; const br = '\r\n';
......
import * as types from './mutation_types'; import * as types from './mutation_types';
// eslint-disable-next-line import/prefer-default-export
export const addModule = ({ commit }, data) => commit(types.ADD_MODULE, data); export const addModule = ({ commit }, data) => commit(types.ADD_MODULE, data);
// eslint-disable-next-line import/prefer-default-export
export const metricsWithData = (state, getters, rootState, rootGetters) => export const metricsWithData = (state, getters, rootState, rootGetters) =>
state.modules.map(module => rootGetters[`${module}/metricsWithData`]().length); state.modules.map(module => rootGetters[`${module}/metricsWithData`]().length);
// eslint-disable-next-line import/prefer-default-export
export const ADD_MODULE = 'ADD_MODULE'; export const ADD_MODULE = 'ADD_MODULE';
/* eslint-disable import/prefer-default-export */
export const FILTERED_SEARCH = { export const FILTERED_SEARCH = {
MERGE_REQUESTS: 'merge_requests', MERGE_REQUESTS: 'merge_requests',
ISSUES: 'issues', ISSUES: 'issues',
......
/* eslint-disable import/prefer-default-export */
export const ISSUABLE_INDEX = { export const ISSUABLE_INDEX = {
MERGE_REQUEST: 'merge_request_', MERGE_REQUEST: 'merge_request_',
ISSUE: 'issue_', ISSUE: 'issue_',
......
import { pickBy } from 'lodash'; import { pickBy } from 'lodash';
import { SUPPORTED_FILTER_PARAMETERS } from './constants'; import { SUPPORTED_FILTER_PARAMETERS } from './constants';
// eslint-disable-next-line import/prefer-default-export
export const validateParams = params => { export const validateParams = params => {
return pickBy(params, (val, key) => SUPPORTED_FILTER_PARAMETERS.includes(key) && val); return pickBy(params, (val, key) => SUPPORTED_FILTER_PARAMETERS.includes(key) && val);
}; };
...@@ -7,7 +7,6 @@ import state from './state'; ...@@ -7,7 +7,6 @@ import state from './state';
Vue.use(Vuex); Vue.use(Vuex);
// eslint-disable-next-line import/prefer-default-export
export const createStore = () => export const createStore = () =>
new Vuex.Store({ new Vuex.Store({
state, state,
......
// eslint-disable-next-line import/prefer-default-export
export const decodeAndParse = param => JSON.parse(window.atob(param)); export const decodeAndParse = param => JSON.parse(window.atob(param));
import { LOADING, ERROR, SUCCESS, STATUS_FAILED } from '../constants'; import { LOADING, ERROR, SUCCESS, STATUS_FAILED } from '../constants';
// eslint-disable-next-line import/prefer-default-export
export const summaryStatus = state => { export const summaryStatus = state => {
if (state.isLoading) { if (state.isLoading) {
return LOADING; return LOADING;
......
// eslint-disable-next-line import/prefer-default-export
export function normalizeData(data, path, extra = () => {}) { export function normalizeData(data, path, extra = () => {}) {
return data.map(d => ({ return data.map(d => ({
sha: d.commit.id, sha: d.commit.id,
......
...@@ -88,7 +88,6 @@ const fileTypeIcons = [ ...@@ -88,7 +88,6 @@ const fileTypeIcons = [
}, },
]; ];
// eslint-disable-next-line import/prefer-default-export
export const getIconName = (type, path) => { export const getIconName = (type, path) => {
if (entryTypeIcons[type]) return entryTypeIcons[type]; if (entryTypeIcons[type]) return entryTypeIcons[type];
......
...@@ -28,5 +28,4 @@ const isPlainReadme = file => { ...@@ -28,5 +28,4 @@ const isPlainReadme = file => {
return re.test(file.name); return re.test(file.name);
}; };
// eslint-disable-next-line import/prefer-default-export
export const readmeFile = blobs => blobs.find(isRichReadme) || blobs.find(isPlainReadme); export const readmeFile = blobs => blobs.find(isRichReadme) || blobs.find(isPlainReadme);
...@@ -2,7 +2,6 @@ import GetSnippetQuery from '../queries/snippet.query.graphql'; ...@@ -2,7 +2,6 @@ import GetSnippetQuery from '../queries/snippet.query.graphql';
const blobsDefault = []; const blobsDefault = [];
// eslint-disable-next-line import/prefer-default-export
export const getSnippetMixin = { export const getSnippetMixin = {
apollo: { apollo: {
snippet: { snippet: {
......
// eslint-disable-next-line import/prefer-default-export
export const getBinary = file => { export const getBinary = file => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const reader = new FileReader(); const reader = new FileReader();
......
import { s__, n__ } from '~/locale'; import { s__, n__ } from '~/locale';
// eslint-disable-next-line import/prefer-default-export
export const title = state => { export const title = state => {
if (state.isLoading) { if (state.isLoading) {
return s__('BuildArtifacts|Loading artifacts'); return s__('BuildArtifacts|Loading artifacts');
......
// eslint-disable-next-line import/prefer-default-export
export const stripQuotes = value => { export const stripQuotes = value => {
return value.includes(' ') ? value.slice(1, -1) : value; return value.includes(' ') ? value.slice(1, -1) : value;
}; };
/* eslint-disable import/prefer-default-export */
function trimFirstCharOfLineContent(text) { function trimFirstCharOfLineContent(text) {
if (!text) { if (!text) {
return text; return text;
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
* @param {string} root - the key of the state where to search fo they keys described in list * @param {string} root - the key of the state where to search fo they keys described in list
* @returns {Object} a dictionary with all the computed properties generated * @returns {Object} a dictionary with all the computed properties generated
*/ */
// eslint-disable-next-line import/prefer-default-export
export const mapComputed = (list, defaultUpdateFn, root) => { export const mapComputed = (list, defaultUpdateFn, root) => {
const result = {}; const result = {};
list.forEach(item => { list.forEach(item => {
......
...@@ -55,10 +55,6 @@ export const createStore = () => ...@@ -55,10 +55,6 @@ export const createStore = () =>
}); });
``` ```
_Note:_ Until this
[RFC](https://gitlab.com/gitlab-org/frontend/rfcs/-/issues/20) is implemented,
the above will need to disable the `import/prefer-default-export` ESLint rule.
### `state.js` ### `state.js`
The first thing you should do before writing any code is to design the state. The first thing you should do before writing any code is to design the state.
......
// eslint-disable-next-line import/prefer-default-export
export const customStageFormActive = ({ isCreatingCustomStage, isEditingCustomStage }) => export const customStageFormActive = ({ isCreatingCustomStage, isEditingCustomStage }) =>
Boolean(isCreatingCustomStage || isEditingCustomStage); Boolean(isCreatingCustomStage || isEditingCustomStage);
...@@ -18,7 +18,6 @@ import { dateFormats } from '../shared/constants'; ...@@ -18,7 +18,6 @@ import { dateFormats } from '../shared/constants';
* *
* @return {Array} the computed month data * @return {Array} the computed month data
*/ */
// eslint-disable-next-line import/prefer-default-export
export const computeMonthRangeData = (startDate, endDate, format = dateFormats.isoDate) => { export const computeMonthRangeData = (startDate, endDate, format = dateFormats.isoDate) => {
const monthData = []; const monthData = [];
const monthNames = getMonthNames(true); const monthNames = getMonthNames(true);
......
import SET_ENDPOINT from './mutation_types'; import SET_ENDPOINT from './mutation_types';
// eslint-disable-next-line import/prefer-default-export
export const setEndpoint = ({ commit }, endpoint) => commit(SET_ENDPOINT, endpoint); export const setEndpoint = ({ commit }, endpoint) => commit(SET_ENDPOINT, endpoint);
// eslint-disable-next-line import/prefer-default-export
export const getMetricTypes = state => chartKey => export const getMetricTypes = state => chartKey =>
state.metricTypes.filter(m => m.charts.indexOf(chartKey) !== -1); state.metricTypes.filter(m => m.charts.indexOf(chartKey) !== -1);
// eslint-disable-next-line import/prefer-default-export
export const isEmpty = state => !state.rules || !state.rules.length; export const isEmpty = state => !state.rules || !state.rules.length;
// eslint-disable-next-line import/prefer-default-export
export const isFreePlan = state => state.plan.code === null; export const isFreePlan = state => state.plan.code === null;
// Limit the number of vulnerabilities to display so as to avoid jank. // Limit the number of vulnerabilities to display so as to avoid jank.
// In practice, this limit will probably never be reached, since the // In practice, this limit will probably never be reached, since the
// largest number of vulnerabilities we've seen one dependency have is 20. // largest number of vulnerabilities we've seen one dependency have is 20.
// eslint-disable-next-line import/prefer-default-export
export const MAX_DISPLAYED_VULNERABILITIES_PER_DEPENDENCY = 50; export const MAX_DISPLAYED_VULNERABILITIES_PER_DEPENDENCY = 50;
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import { FILTER } from './modules/list/constants'; import { FILTER } from './modules/list/constants';
// eslint-disable-next-line import/prefer-default-export
export const DEPENDENCY_LIST_TYPES = { export const DEPENDENCY_LIST_TYPES = {
all: { all: {
namespace: 'allDependencies', namespace: 'allDependencies',
......
import listModule from './modules/list'; import listModule from './modules/list';
// eslint-disable-next-line import/prefer-default-export
export const addListType = (store, listType) => { export const addListType = (store, listType) => {
const { initialState, namespace } = listType; const { initialState, namespace } = listType;
store.registerModule(namespace, listModule()); store.registerModule(namespace, listModule());
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
* @param {Object} environment * @param {Object} environment
* @returns {Object} * @returns {Object}
*/ */
// eslint-disable-next-line import/prefer-default-export
export const setDeployBoard = (oldEnvironmentState, environment) => { export const setDeployBoard = (oldEnvironmentState, environment) => {
let parsedEnvironment = environment; let parsedEnvironment = environment;
if (environment.size === 1 && environment.rollout_status) { if (environment.size === 1 && environment.rollout_status) {
......
/* eslint-disable import/prefer-default-export */
import { USER_TOKEN_TYPES as CE_USER_TOKEN_TYPES } from '~/filtered_search/constants'; import { USER_TOKEN_TYPES as CE_USER_TOKEN_TYPES } from '~/filtered_search/constants';
export const USER_TOKEN_TYPES = [...CE_USER_TOKEN_TYPES, 'approver', 'approved-by']; export const USER_TOKEN_TYPES = [...CE_USER_TOKEN_TYPES, 'approver', 'approved-by'];
// eslint-disable-next-line import/prefer-default-export
export const formHasError = state => Object.values(state.formErrors).some(val => Boolean(val)); export const formHasError = state => Object.values(state.formErrors).some(val => Boolean(val));
// eslint-disable-next-line import/prefer-default-export
export const replicableTypeName = state => state.replicableType.split('_').join(' '); export const replicableTypeName = state => state.replicableType.split('_').join(' ');
...@@ -7,7 +7,6 @@ import createGqClient, { fetchPolicies } from '~/lib/graphql'; ...@@ -7,7 +7,6 @@ import createGqClient, { fetchPolicies } from '~/lib/graphql';
think the sync process is broken. think the sync process is broken.
*/ */
// eslint-disable-next-line import/prefer-default-export
export const gqClient = createGqClient( export const gqClient = createGqClient(
{}, {},
{ {
......
// eslint-disable-next-line import/prefer-default-export
export const formHasError = state => export const formHasError = state =>
Object.keys(state.formErrors) Object.keys(state.formErrors)
.map(key => state.formErrors[key]) .map(key => state.formErrors[key])
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
* *
* @returns {Object} the transformed filters for the public api * @returns {Object} the transformed filters for the public api
*/ */
// eslint-disable-next-line import/prefer-default-export
export const transformFilters = ({ export const transformFilters = ({
label_name: labels = null, label_name: labels = null,
milestone_title: milestone = null, milestone_title: milestone = null,
......
/* eslint-disable import/prefer-default-export */
export const LICENSE_LIST = 'licenseList'; export const LICENSE_LIST = 'licenseList';
// eslint-disable-next-line import/prefer-default-export
export const hasLicenses = state => state.licenses.length > 0; export const hasLicenses = state => state.licenses.length > 0;
/* eslint-disable import/prefer-default-export */
export const SCAN_TYPES = { export const SCAN_TYPES = {
PASSIVE: 'PASSIVE', PASSIVE: 'PASSIVE',
}; };
...@@ -4,7 +4,6 @@ import { deprecatedCreateFlash as createFlash } from '~/flash'; ...@@ -4,7 +4,6 @@ import { deprecatedCreateFlash as createFlash } from '~/flash';
import { normalizeHeaders, parseIntPagination } from '~/lib/utils/common_utils'; import { normalizeHeaders, parseIntPagination } from '~/lib/utils/common_utils';
import * as types from './mutation_types'; import * as types from './mutation_types';
// eslint-disable-next-line import/prefer-default-export
export function fetchPage({ commit, state }, newPage) { export function fetchPage({ commit, state }, newPage) {
return Api.groupMembers(state.groupId, { return Api.groupMembers(state.groupId, {
with_saml_identity: 'true', with_saml_identity: 'true',
......
// eslint-disable-next-line import/prefer-default-export
export const RECEIVE_SAML_MEMBERS_SUCCESS = 'RECEIVE_SAML_MEMBERS_SUCCESS'; export const RECEIVE_SAML_MEMBERS_SUCCESS = 'RECEIVE_SAML_MEMBERS_SUCCESS';
/* eslint-disable import/prefer-default-export */
/** /**
* *
* Sets the text content of a DOM element to a given value. * Sets the text content of a DOM element to a given value.
......
import { normalizeData as normalizeDataFOSS } from '~/repository/utils/commit'; import { normalizeData as normalizeDataFOSS } from '~/repository/utils/commit';
// eslint-disable-next-line import/prefer-default-export
export function normalizeData(data, path) { export function normalizeData(data, path) {
return normalizeDataFOSS(data, path, d => ({ return normalizeDataFOSS(data, path, d => ({
lockLabel: d.lock_label || false, lockLabel: d.lock_label || false,
......
...@@ -2,7 +2,6 @@ import * as Sentry from '@sentry/browser'; ...@@ -2,7 +2,6 @@ import * as Sentry from '@sentry/browser';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import * as types from './mutation_types'; import * as types from './mutation_types';
// eslint-disable-next-line import/prefer-default-export
export const fetchSecurityConfiguration = ({ commit, state }) => { export const fetchSecurityConfiguration = ({ commit, state }) => {
if (!state.securityConfigurationPath) { if (!state.securityConfigurationPath) {
return commit(types.RECEIVE_SECURITY_CONFIGURATION_ERROR); return commit(types.RECEIVE_SECURITY_CONFIGURATION_ERROR);
......
/* eslint-disable import/prefer-default-export */
export const COLLAPSE_SECURITY_REPORTS_SUMMARY_LOCAL_STORAGE_KEY = export const COLLAPSE_SECURITY_REPORTS_SUMMARY_LOCAL_STORAGE_KEY =
'hide_pipelines_security_reports_summary_details'; 'hide_pipelines_security_reports_summary_details';
/* eslint-disable import/prefer-default-export */
export const FUZZING_STAGE = 'fuzz'; export const FUZZING_STAGE = 'fuzz';
/* eslint-disable import/prefer-default-export */
import { getDayDifference, isValidDate } from '~/lib/utils/datetime_utility'; import { getDayDifference, isValidDate } from '~/lib/utils/datetime_utility';
/** /**
......
/* eslint-disable import/prefer-default-export */
import { isEqual } from 'lodash'; import { isEqual } from 'lodash';
const isVulnerabilityLike = object => const isVulnerabilityLike = object =>
......
import { SEVERITY_GROUPS, SEVERITY_LEVELS_ORDERED_BY_SEVERITY } from './constants'; import { SEVERITY_GROUPS, SEVERITY_LEVELS_ORDERED_BY_SEVERITY } from './constants';
import { projectsForSeverityGroup, addMostSevereVulnerabilityInformation } from './utils'; import { projectsForSeverityGroup, addMostSevereVulnerabilityInformation } from './utils';
// eslint-disable-next-line import/prefer-default-export
export const severityGroups = ({ projects }) => { export const severityGroups = ({ projects }) => {
// add data about it's most severe vulnerability to each project // add data about it's most severe vulnerability to each project
const projectsWithSeverityInformation = projects.map( const projectsWithSeverityInformation = projects.map(
......
/* eslint-disable import/prefer-default-export */
import { PREDEFINED_NETWORK_POLICIES } from 'ee/threat_monitoring/constants'; import { PREDEFINED_NETWORK_POLICIES } from 'ee/threat_monitoring/constants';
export const policiesWithDefaults = ({ policies }) => { export const policiesWithDefaults = ({ policies }) => {
......
// eslint-disable-next-line import/prefer-default-export
export const hasHistory = ({ statistics: { history } }) => export const hasHistory = ({ statistics: { history } }) =>
Boolean(history.nominal.length || history.anomalous.length); Boolean(history.nominal.length || history.anomalous.length);
// eslint-disable-next-line import/prefer-default-export
export const DropdownVariant = { export const DropdownVariant = {
Sidebar: 'sidebar', Sidebar: 'sidebar',
Standalone: 'standalone', Standalone: 'standalone',
......
/* eslint-disable import/prefer-default-export */
export const LICENSE_MANAGEMENT = 'licenseManagement'; export const LICENSE_MANAGEMENT = 'licenseManagement';
import subscriptionState from 'ee/billings/stores/modules/subscription/state'; import subscriptionState from 'ee/billings/stores/modules/subscription/state';
// eslint-disable-next-line import/prefer-default-export
export const resetStore = store => { export const resetStore = store => {
const newState = { const newState = {
subscription: subscriptionState(), subscription: subscriptionState(),
......
// eslint-disable-next-line import/prefer-default-export
export const makeDependency = (changes = {}) => ({ export const makeDependency = (changes = {}) => ({
name: 'left-pad', name: 'left-pad',
version: '0.0.3', version: '0.0.3',
......
// eslint-disable-next-line import/prefer-default-export
export const makeLicense = (changes = {}) => ({ export const makeLicense = (changes = {}) => ({
name: 'Apache 2.0', name: 'Apache 2.0',
url: 'http://www.apache.org/licenses/LICENSE-2.0.txt', url: 'http://www.apache.org/licenses/LICENSE-2.0.txt',
......
// eslint-disable-next-line import/prefer-default-export
export const generateFeatures = (n, overrides = {}) => { export const generateFeatures = (n, overrides = {}) => {
return [...Array(n).keys()].map(i => ({ return [...Array(n).keys()].map(i => ({
type: `scan-type-${i}`, type: `scan-type-${i}`,
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
* generated entities. * generated entities.
* @returns {Object[]} * @returns {Object[]}
*/ */
// eslint-disable-next-line import/prefer-default-export
export const makeEntities = (count, changes) => export const makeEntities = (count, changes) =>
[...Array(count).keys()].map(i => ({ [...Array(count).keys()].map(i => ({
defaultValue: `defaultValue${i}`, defaultValue: `defaultValue${i}`,
......
import vulnerabilitiesState from 'ee/security_dashboard/store/modules/vulnerabilities/state'; import vulnerabilitiesState from 'ee/security_dashboard/store/modules/vulnerabilities/state';
import filterState from 'ee/security_dashboard/store/modules/filters/state'; import filterState from 'ee/security_dashboard/store/modules/filters/state';
// eslint-disable-next-line import/prefer-default-export
export const resetStore = store => { export const resetStore = store => {
const newState = { const newState = {
vulnerabilities: vulnerabilitiesState(), vulnerabilities: vulnerabilitiesState(),
......
import { TEST_HOST } from 'spec/test_constants'; import { TEST_HOST } from 'spec/test_constants';
// eslint-disable-next-line import/prefer-default-export
export const createDraft = () => ({ export const createDraft = () => ({
author: { author: {
id: 1, id: 1,
......
/* eslint-disable import/prefer-default-export */
/* https://gitlab.com/gitlab-org/frontend/rfcs/-/issues/20 */
export const diffMetadata = { export const diffMetadata = {
real_size: '1', real_size: '1',
size: 1, size: 1,
......
// eslint-disable-next-line import/prefer-default-export
export const triggerDOMEvent = type => { export const triggerDOMEvent = type => {
window.document.dispatchEvent( window.document.dispatchEvent(
new Event(type, { new Event(type, {
......
// eslint-disable-next-line import/prefer-default-export
export const useFakeRequestAnimationFrame = () => { export const useFakeRequestAnimationFrame = () => {
let orig; let orig;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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