Skip to content

Commit f697d76

Browse files
authored
Alphabetize imports (#2073)
1 parent 59d1acf commit f697d76

File tree

166 files changed

+566
-581
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+566
-581
lines changed

.eslintrc.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,8 @@
253253
"import/order": [
254254
"warn",
255255
{
256-
"newlines-between": "always-and-inside-groups"
256+
"newlines-between": "always-and-inside-groups",
257+
"alphabetize": {"order": "asc", "caseInsensitive": true}
257258
}
258259
],
259260
"import/unambiguous": "warn",
@@ -416,6 +417,10 @@
416417
"require-atomic-updates": "warn",
417418
"require-unicode-regexp": "warn",
418419
"require-yield": "error",
420+
"sort-imports": [
421+
"warn",
422+
{"ignoreCase": true, "ignoreDeclarationSort": true}
423+
],
419424
"spaced-comment": ["warn", "always"],
420425
"strict": ["warn", "never"],
421426
"use-isnan": "warn",

__mocks__/@bugsnag/js.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import React, {Fragment} from 'react';
2-
import PropTypes from 'prop-types';
31
import noop from 'lodash-es/noop';
2+
import PropTypes from 'prop-types';
3+
import React, {Fragment} from 'react';
44

55
function ErrorBoundary({children}) {
66
return React.createElement(Fragment, null, children);

gulpfile.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
const fs = require('fs');
2-
const path = require('path');
32
const https = require('https');
3+
const path = require('path');
44

5+
const BrowserSync = require('browser-sync');
6+
const cloudflare = require('cloudflare');
7+
const cssnano = require('cssnano');
58
const gulp = require('gulp');
69
const concat = require('gulp-concat');
10+
const postcss = require('gulp-postcss');
711
const sourcemaps = require('gulp-sourcemaps');
8-
const cssnano = require('cssnano');
12+
const isDocker = require('is-docker');
913
const forOwn = require('lodash.forown');
10-
const postcss = require('gulp-postcss');
14+
const pify = require('pify');
1115
const postcssPresetEnv = require('postcss-preset-env');
1216
const webpack = require('webpack');
1317
const webpackDevMiddleware = require('webpack-dev-middleware');
14-
const cloudflare = require('cloudflare');
15-
const BrowserSync = require('browser-sync');
16-
const pify = require('pify');
17-
const isDocker = require('is-docker');
1818

1919
const config = require('./src/config');
2020
const webpackConfiguration = require('./webpack.config');

karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
const isDocker = require('is-docker');
21
const commandExists = require('command-exists').sync;
2+
const isDocker = require('is-docker');
33

44
const webpackConfiguration = require('./webpack.config.js');
55

src/actions/compiledProjects.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import {createAction} from 'redux-actions';
21
import identity from 'lodash-es/identity';
2+
import {createAction} from 'redux-actions';
33

44
export const projectCompiled = createAction(
55
'PROJECT_COMPILED',

src/actions/console.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import {createAction} from 'redux-actions';
21
import identity from 'lodash-es/identity';
2+
import {createAction} from 'redux-actions';
33
import uuid from 'uuid/v4';
44

55
export const consoleValueProduced = createAction(

src/actions/index.js

Lines changed: 44 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -5,84 +5,80 @@ import {createAssignment} from './assignments';
55
import {
66
createSnapshot,
77
exportProject,
8-
projectExportDisplayed,
9-
projectExportNotDisplayed,
108
gapiClientReady,
119
gapiClientUnavailable,
10+
projectExportDisplayed,
11+
projectExportNotDisplayed,
1212
} from './clients';
1313

1414
import {
15+
projectCompilationFailed,
16+
projectCompiled,
17+
refreshPreview,
18+
} from './compiledProjects';
19+
import {
20+
clearConsoleEntries,
21+
consoleErrorProduced,
22+
consoleInputChanged,
23+
consoleLogBatchProduced,
24+
consoleValueProduced,
25+
evaluateConsoleEntry,
26+
nextConsoleHistory,
27+
previousConsoleHistory,
28+
} from './console';
29+
import {addRuntimeError} from './errors';
30+
import {
31+
archiveProject,
1532
beautifyProjectSource,
16-
createProject,
1733
changeCurrentProject,
18-
toggleLibrary,
34+
createProject,
1935
hideComponent,
20-
unhideComponent,
21-
toggleComponent,
22-
updateProjectSource,
23-
updateProjectInstructions,
2436
projectSuccessfullySaved,
25-
archiveProject,
2637
saveProject,
38+
toggleComponent,
39+
toggleLibrary,
40+
unhideComponent,
41+
updateProjectInstructions,
42+
updateProjectSource,
2743
} from './projects';
2844

45+
import {updateResizableFlex} from './resizableFlex';
2946
import {
30-
focusLine,
47+
cancelEditingInstructions,
48+
closeAssignmentCreator,
49+
closeLoginPrompt,
50+
closeTopBarMenu,
51+
coursesFullyLoaded,
52+
coursesLoaded,
3153
editorFocusedRequestedLine,
32-
startDragColumnDivider,
33-
stopDragColumnDivider,
54+
focusLine,
55+
hideSaveIndicator,
3456
notificationTriggered,
35-
userDismissedNotification,
36-
updateNotificationMetadata,
57+
openAssignmentCreator,
58+
openLoginPrompt,
3759
popOutProject,
38-
toggleEditorTextSize,
39-
toggleTopBarMenu,
40-
closeTopBarMenu,
41-
startEditingInstructions,
42-
cancelEditingInstructions,
4360
showSaveIndicator,
44-
hideSaveIndicator,
45-
openAssignmentCreator,
46-
closeAssignmentCreator,
47-
coursesLoaded,
48-
coursesFullyLoaded,
61+
startDragColumnDivider,
62+
startEditingInstructions,
63+
stopDragColumnDivider,
4964
toggleArchivedView,
50-
openLoginPrompt,
51-
closeLoginPrompt,
65+
toggleEditorTextSize,
66+
toggleTopBarMenu,
67+
updateNotificationMetadata,
68+
userDismissedNotification,
5269
} from './ui';
5370

54-
import {addRuntimeError} from './errors';
55-
5671
import {
5772
dismissAccountMigration,
5873
linkGithubIdentity,
59-
unlinkGithubIdentity,
6074
logIn,
6175
logOut,
6276
startAccountMigration,
77+
unlinkGithubIdentity,
6378
userAuthenticated,
6479
userLoggedOut,
6580
} from './user';
6681

67-
import {
68-
projectCompiled,
69-
projectCompilationFailed,
70-
refreshPreview,
71-
} from './compiledProjects';
72-
73-
import {
74-
clearConsoleEntries,
75-
consoleErrorProduced,
76-
consoleInputChanged,
77-
consoleLogBatchProduced,
78-
consoleValueProduced,
79-
evaluateConsoleEntry,
80-
nextConsoleHistory,
81-
previousConsoleHistory,
82-
} from './console';
83-
84-
import {updateResizableFlex} from './resizableFlex';
85-
8682
export {
8783
beautifyProjectSource,
8884
clearConsoleEntries,

src/application.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import './init/DOMParserShim';
77
import React from 'react';
88
import ReactDOM from 'react-dom';
99

10-
import init from './init';
1110
import Application from './components/Application';
11+
import init from './init';
1212

1313
const {store} = init();
1414

src/clients/firebase.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1+
import * as firebase from 'firebase/app'; // eslint-disable-line import/no-namespace
12
import Cookies from 'js-cookie';
23
import get from 'lodash-es/get';
34
import isEmpty from 'lodash-es/isEmpty';
45
import isNil from 'lodash-es/isNil';
56
import isNull from 'lodash-es/isNull';
67
import omit from 'lodash-es/omit';
8+
import once from 'lodash-es/once';
79
import values from 'lodash-es/values';
810
import uuid from 'uuid/v4';
9-
import once from 'lodash-es/once';
10-
import * as firebase from 'firebase/app'; // eslint-disable-line import/no-namespace
1111
import 'firebase/analytics';
1212
import 'firebase/auth';
1313
import 'firebase/performance';
1414

15-
import {bugsnagClient} from '../util/bugsnag';
1615
import config from '../config';
17-
import retryingFailedImports from '../util/retryingFailedImports';
1816
import {
1917
getGapiSync,
20-
loadAndConfigureGapi,
2118
SCOPES as GOOGLE_SCOPES,
19+
loadAndConfigureGapi,
2220
} from '../services/gapi';
21+
import {bugsnagClient} from '../util/bugsnag';
22+
import retryingFailedImports from '../util/retryingFailedImports';
2323

2424
const GITHUB_SCOPES = ['gist', 'public_repo', 'read:user', 'user:email'];
2525
const VALID_SESSION_UID_COOKIE = 'firebaseAuth.validSessionUid';

src/clients/github.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import isEmpty from 'lodash-es/isEmpty';
22
import isNull from 'lodash-es/isNull';
33
import trim from 'lodash-es/trim';
44

5-
import retryingFailedImports from '../util/retryingFailedImports';
6-
import performWithRetries from '../util/performWithRetries';
75
import compileProject from '../util/compileProject';
86
import ExtendableError from '../util/ExtendableError';
7+
import performWithRetries from '../util/performWithRetries';
8+
import retryingFailedImports from '../util/retryingFailedImports';
99

1010
const COMMIT_MESSAGE = 'Created using Popcode: https://popcode.org';
1111
const MASTER = 'master';

0 commit comments

Comments
 (0)