Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more folder to import/order lint rule #58622

Merged
merged 4 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions apps/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,18 +213,9 @@ module.exports = {
'src/publicKeyCryptography/*',
'src/pythonlab/*',
'src/redux/*',
'src/regionalPartnerMiniContact/*',
'src/sites/**',
'src/standaloneVideo/*',
'src/storage/**',
// This one had some problems, see https://github.com/code-dot-org/code-dot-org/pull/58284
'src/templates/curriculumCatalog/**',
'src/third-party/*',
'src/types/*',
'src/userHeaderEventLogger/*',
'src/util/**',
'src/weblab/**',
'src/weblab2/*',
'test/integration/**',
'test/*',
'test/unit/*',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import $ from 'jquery';
import React from 'react';
import ReactDOM from 'react-dom';

import {
RegionalPartnerMiniContact,
RegionalPartnerMiniContactPopupLink,
Expand Down
7 changes: 5 additions & 2 deletions apps/src/standaloneVideo/StandaloneVideo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@

import React, {useEffect} from 'react';
import {useSelector} from 'react-redux';
import {useAppDispatch} from '@cdo/apps/util/reduxHooks';
import Video from './Video';

import {
sendSuccessReport,
navigateToNextLevel,
} from '@cdo/apps/code-studio/progressRedux';
import {LabState} from '@cdo/apps/lab2/lab2Redux';
import {VideoLevelData} from '@cdo/apps/lab2/types';
import {useAppDispatch} from '@cdo/apps/util/reduxHooks';

import standaloneVideoLocale from './locale';
import Video from './Video';

import styles from './video.module.scss';

const StandaloneVideo: React.FunctionComponent = () => {
Expand Down
2 changes: 2 additions & 0 deletions apps/src/standaloneVideo/Video.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React, {useLayoutEffect, useState} from 'react';

import standaloneVideoLocale from './locale';

import styles from './video.module.scss';

interface VideoProps {
Expand Down
2 changes: 1 addition & 1 deletion apps/src/standaloneVideo/locale-do-not-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* which is important for making locale setup work seamlessly in tests.
*/

import safeLoadLocale from '@cdo/apps/util/safeLoadLocale';
import localeWithI18nStringTracker from '@cdo/apps/util/i18nStringTracker';
import safeLoadLocale from '@cdo/apps/util/safeLoadLocale';

let locale = safeLoadLocale('standaloneVideo_locale');
locale = localeWithI18nStringTracker(locale, 'standaloneVideo');
Expand Down
1 change: 1 addition & 0 deletions apps/src/standaloneVideo/locale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* it to the {@link StandaloneVideoLocale} type.
*/
import {StandaloneVideoLocale} from './types';

const standaloneVideoLocale = require('@cdo/standaloneVideo/locale');

export default standaloneVideoLocale as StandaloneVideoLocale;
9 changes: 6 additions & 3 deletions apps/src/storage/GetColumnParamPicker.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import PropTypes from 'prop-types';
import React from 'react';
import msg from '@cdo/locale';
import color from '../util/color';

import fontConstants from '@cdo/apps/fontConstants';
import {getStore} from '@cdo/apps/redux';
import BaseDialog from '@cdo/apps/templates/BaseDialog.jsx';
import fontConstants from '@cdo/apps/fontConstants';
import msg from '@cdo/locale';

import color from '../util/color';

import {isFirebaseStorage} from './storage';

export const ParamType = {
Expand Down
16 changes: 10 additions & 6 deletions apps/src/storage/dataBrowser/AddKeyRow.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
/** @overview Component for adding a key/value pair row. */
import PendingButton from '../../templates/PendingButton';
import classNames from 'classnames';
import PropTypes from 'prop-types';
import React from 'react';
import {castValue} from './dataUtils';
import dataStyles from './data-styles.module.scss';
import classNames from 'classnames';
import {WarningType} from '../constants';

import msg from '@cdo/locale';
import {refreshCurrentDataView} from './loadDataForView';

import PendingButton from '../../templates/PendingButton';
import {WarningType} from '../constants';
import {storageBackend} from '../storage';

import {castValue} from './dataUtils';
import {refreshCurrentDataView} from './loadDataForView';

import dataStyles from './data-styles.module.scss';

const INITIAL_STATE = {
isAdding: false,
key: '',
Expand Down
4 changes: 3 additions & 1 deletion apps/src/storage/dataBrowser/AddTableListRow.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import classNames from 'classnames';
import PropTypes from 'prop-types';
import React from 'react';

import msg from '@cdo/locale';

import dataStyles from './data-styles.module.scss';
import classNames from 'classnames';

const INITIAL_STATE = {
newTableName: '',
Expand Down
16 changes: 10 additions & 6 deletions apps/src/storage/dataBrowser/AddTableRow.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import {storageBackend} from '../storage';
import {refreshCurrentDataView} from './loadDataForView';
import PendingButton from '../../templates/PendingButton';
import classNames from 'classnames';
import _ from 'lodash';
import PropTypes from 'prop-types';
import React from 'react';

import msg from '@cdo/locale';

import PendingButton from '../../templates/PendingButton';
import {storageBackend} from '../storage';

import {castValue} from './dataUtils';
import {refreshCurrentDataView} from './loadDataForView';

import dataStyles from './data-styles.module.scss';
import classNames from 'classnames';
import _ from 'lodash';
import msg from '@cdo/locale';

const INITIAL_STATE = {
isAdding: false,
Expand Down
13 changes: 8 additions & 5 deletions apps/src/storage/dataBrowser/ColumnHeader.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
/**
* @overview Component for adding a new column to the specified table.
*/
import ColumnMenu from './ColumnMenu';
import Dialog from '../../templates/Dialog';
import FontAwesome from '../../templates/FontAwesome';
import classNames from 'classnames';
import PropTypes from 'prop-types';
import React from 'react';

import Dialog from '../../templates/Dialog';
import FontAwesome from '../../templates/FontAwesome';
import color from '../../util/color';
import dataStyles from './data-styles.module.scss';
import {valueOr} from '../../utils';
import classNames from 'classnames';

import ColumnMenu from './ColumnMenu';

import style from './column-header.module.scss';
import dataStyles from './data-styles.module.scss';

const INITIAL_STATE = {
newName: undefined,
Expand Down
7 changes: 5 additions & 2 deletions apps/src/storage/dataBrowser/ColumnMenu.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
/**
* @overview Component for the dropdown menu and icon in the column header.
*/
import {ColumnType} from './dataUtils';
import FontAwesome from '../../templates/FontAwesome';
import PropTypes from 'prop-types';
import React from 'react';

import msg from '@cdo/locale';

import FontAwesome from '../../templates/FontAwesome';

import {ColumnType} from './dataUtils';

export default class ColumnMenu extends React.Component {
static propTypes = {
coerceColumn: PropTypes.func.isRequired,
Expand Down
9 changes: 6 additions & 3 deletions apps/src/storage/dataBrowser/ConfirmDeleteButton.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import React from 'react';
import classNames from 'classnames';
import PropTypes from 'prop-types';
import React from 'react';

import msg from '@cdo/locale';

import Dialog from '../../templates/Dialog';

import dataStyles from './data-styles.module.scss';
import classNames from 'classnames';
import msg from '@cdo/locale';

class ConfirmDeleteButton extends React.Component {
static propTypes = {
Expand Down
3 changes: 2 additions & 1 deletion apps/src/storage/dataBrowser/ConfirmDeleteButton.story.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {action} from '@storybook/addon-actions';
import React from 'react';

import ConfirmDeleteButton from './ConfirmDeleteButton';
import {action} from '@storybook/addon-actions';

export default {
component: ConfirmDeleteButton,
Expand Down
11 changes: 7 additions & 4 deletions apps/src/storage/dataBrowser/ConfirmImportButton.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import Dialog from '../../templates/Dialog';
import PendingButton from '../../templates/PendingButton';
import React from 'react';
import classNames from 'classnames';
import PropTypes from 'prop-types';
import React from 'react';

import msg from '@cdo/locale';

import Dialog from '../../templates/Dialog';
import PendingButton from '../../templates/PendingButton';

import dataStyles from './data-styles.module.scss';
import classNames from 'classnames';

const INITIAL_STATE = {
isConfirmDialogOpen: false,
Expand Down
14 changes: 9 additions & 5 deletions apps/src/storage/dataBrowser/DataBrowser.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
import classNames from 'classnames';
import PropTypes from 'prop-types';
import React from 'react';
import {connect} from 'react-redux';

import msg from '@cdo/locale';

import {DataView} from '../constants';
import {changeView, showWarning} from '../redux/data';

import AddTableListRow from './AddTableListRow';
import EditTableListRow from './EditTableListRow';
import KVPairs from './KVPairs';
import dataStyles from './data-styles.module.scss';
import {connect} from 'react-redux';
import {changeView, showWarning} from '../redux/data';
import {DataView} from '../constants';

import style from './data-browser.module.scss';
import classNames from 'classnames';
import dataStyles from './data-styles.module.scss';

const tableWidth = 400;
const buttonColumnWidth = 124;
Expand Down
4 changes: 3 additions & 1 deletion apps/src/storage/dataBrowser/DataEntryError.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import PropTypes from 'prop-types';
import React from 'react';

import msg from '@cdo/locale';
import color from '../../util/color';

import SafeMarkdown from '../../templates/SafeMarkdown';
import color from '../../util/color';

class DataEntryError extends React.Component {
static propTypes = {
Expand Down
22 changes: 13 additions & 9 deletions apps/src/storage/dataBrowser/DataLibraryPane.jsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
import React from 'react';
import _ from 'lodash';
import PropTypes from 'prop-types';
import React from 'react';
import {connect} from 'react-redux';
import {showWarning} from '../redux/data';

import SafeMarkdown from '@cdo/apps/templates/SafeMarkdown';
import LibraryCategory from './LibraryCategory';
import SearchBar from '@cdo/apps/templates/SearchBar';
import {getDatasetInfo} from './dataUtils';
import msg from '@cdo/locale';
import PreviewModal from './PreviewModal';
import {isFirebaseStorage, storageBackend} from '../storage';
import {WarningType} from '../constants';

import experiments from '../../util/experiments';
import _ from 'lodash';
import style from './data-library-pane.module.scss';
import {WarningType} from '../constants';
import {showWarning} from '../redux/data';
import {isFirebaseStorage, storageBackend} from '../storage';

import {getDatasetInfo} from './dataUtils';
import LibraryCategory from './LibraryCategory';
import {refreshCurrentDataView} from './loadDataForView';
import PreviewModal from './PreviewModal';

import style from './data-library-pane.module.scss';

class DataLibraryPane extends React.Component {
static propTypes = {
Expand Down
13 changes: 8 additions & 5 deletions apps/src/storage/dataBrowser/DataOverview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@
* existing data tables with controls to edit/delete, and a control to add
* a new data table.
*/
import {DataView, WarningType} from '../constants';
import {storageBackend} from '../storage';
import {refreshCurrentDataView} from './loadDataForView';
import classNames from 'classnames';
import PropTypes from 'prop-types';
import React from 'react';
import {changeView, showWarning} from '../redux/data';
import {connect} from 'react-redux';

import {DataView, WarningType} from '../constants';
import {changeView, showWarning} from '../redux/data';
import {storageBackend} from '../storage';

import DataBrowser from './DataBrowser';
import DataLibraryPane from './DataLibraryPane';
import {refreshCurrentDataView} from './loadDataForView';

import style from './data-overview.module.scss';
import classNames from 'classnames';

class DataOverview extends React.Component {
static propTypes = {
Expand Down
26 changes: 15 additions & 11 deletions apps/src/storage/dataBrowser/DataTable.jsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
/**
* @overview Component for displaying a data table.
*/
import AddTableRow from './AddTableRow';
import EditTableRow from './EditTableRow';
import ColumnHeader from './ColumnHeader';
import DataEntryError from './DataEntryError';
import {storageBackend} from '../storage';
import FontAwesome from '../../templates/FontAwesome';
import classNames from 'classnames';
import PropTypes from 'prop-types';
import React from 'react';
import {showWarning} from '../redux/data';
import dataStyles from './data-styles.module.scss';
import {connect} from 'react-redux';
import PaginationWrapper from '../../templates/PaginationWrapper';

import msg from '@cdo/locale';

import FontAwesome from '../../templates/FontAwesome';
import PaginationWrapper from '../../templates/PaginationWrapper';
import {WarningType} from '../constants';
import style from './data-table.module.scss';
import classNames from 'classnames';
import {showWarning} from '../redux/data';
import {storageBackend} from '../storage';

import AddTableRow from './AddTableRow';
import ColumnHeader from './ColumnHeader';
import DataEntryError from './DataEntryError';
import EditTableRow from './EditTableRow';
import {refreshCurrentDataView} from './loadDataForView';

import dataStyles from './data-styles.module.scss';
import style from './data-table.module.scss';

const MAX_ROWS_PER_PAGE = 500;

const INITIAL_STATE = {
Expand Down
Loading