Skip to content

Commit

Permalink
Merge pull request #835 from CruGlobal/next-import-order
Browse files Browse the repository at this point in the history
[no-Jira] Move NextJS subimports to the top
  • Loading branch information
canac authored Dec 8, 2023
2 parents d5f5dd9 + fd220c9 commit b1de61f
Show file tree
Hide file tree
Showing 77 changed files with 89 additions and 89 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.exports = {
'newlines-between': 'never',
pathGroups: [
{
pattern: '{next,react}',
pattern: '{next,next/**,react}',
group: 'external',
position: 'before',
},
Expand Down
4 changes: 2 additions & 2 deletions __tests__/util/TestRouter.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { ReactElement, ReactNode } from 'react';
import { RouterContext } from 'next/dist/shared/lib/router-context';
import Router, { Router as IRouter, NextRouter } from 'next/router'; // eslint-disable-line import/no-named-as-default
import Router, { Router as IRouter, NextRouter } from 'next/router';
import React, { ReactElement, ReactNode } from 'react';

interface Props {
children: ReactNode;
Expand Down
2 changes: 1 addition & 1 deletion pages/404.page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Head from 'next/head';
import React, { ReactElement } from 'react';
import DisabledByDefaultOutlinedIcon from '@mui/icons-material/DisabledByDefaultOutlined';
import { Box, Button, Typography } from '@mui/material';
import { styled } from '@mui/material/styles';
import Head from 'next/head';
import { useTranslation } from 'react-i18next';
import useGetAppSettings from '../src/hooks/useGetAppSettings';

Expand Down
2 changes: 1 addition & 1 deletion pages/500.page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Head from 'next/head';
import React, { ReactElement } from 'react';
import DisabledByDefaultOutlinedIcon from '@mui/icons-material/DisabledByDefaultOutlined';
import { Box, Button, Typography } from '@mui/material';
import { styled } from '@mui/material/styles';
import Head from 'next/head';
import { useTranslation } from 'react-i18next';
import useGetAppSettings from '../src/hooks/useGetAppSettings';

Expand Down
4 changes: 2 additions & 2 deletions pages/_app.page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { NextPage } from 'next';
import type { AppProps } from 'next/app';
import Head from 'next/head';
import React, { ReactElement } from 'react';
import { ApolloProvider } from '@apollo/client';
import { Box } from '@mui/material';
Expand All @@ -12,7 +14,6 @@ import { ErrorBoundary, Provider } from '@rollbar/react';
import { AnimatePresence } from 'framer-motion';
import { Session } from 'next-auth';
import { SessionProvider } from 'next-auth/react';
import Head from 'next/head';
import { SnackbarProvider } from 'notistack';
import { I18nextProvider, useTranslation } from 'react-i18next';
import Rollbar from 'rollbar';
Expand All @@ -32,7 +33,6 @@ import client from '../src/lib/client';
import i18n from '../src/lib/i18n';
import theme from '../src/theme';
import { AdapterLuxon } from './api/utils/AdapterLuxon';
import type { AppProps } from 'next/app';
import './helpscout.css';
import './print.css';

Expand Down
4 changes: 2 additions & 2 deletions pages/_document.page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React, { ReactElement } from 'react';
import { ServerStyleSheets } from '@mui/styles';
import { RenderPageResult } from 'next/dist/shared/lib/utils';
import Document, {
DocumentContext,
Expand All @@ -10,6 +8,8 @@ import Document, {
NextScript,
} from 'next/document';
import Script from 'next/script';
import React, { ReactElement } from 'react';
import { ServerStyleSheets } from '@mui/styles';
import theme from '../src/theme';

class MyDocument extends Document {
Expand Down
2 changes: 1 addition & 1 deletion pages/accountLists.page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { GetServerSideProps, GetServerSidePropsResult } from 'next';
import Head from 'next/head';
import React, { ReactElement } from 'react';
import { getToken } from 'next-auth/jwt';
import Head from 'next/head';
import { useTranslation } from 'react-i18next';
import useGetAppSettings from 'src/hooks/useGetAppSettings';
import AccountLists from '../src/components/AccountLists';
Expand Down
2 changes: 1 addition & 1 deletion pages/accountLists/[accountListId].page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { GetServerSideProps } from 'next';
import Head from 'next/head';
import React, { ReactElement, useEffect, useState } from 'react';
import { getToken } from 'next-auth/jwt';
import Head from 'next/head';
import { renderDialog } from 'src/components/Layouts/Primary/TopBar/Items/AddMenu/AddMenu';
import { suggestArticles } from 'src/lib/helpScout';
import Dashboard from '../../src/components/Dashboard';
Expand Down
2 changes: 1 addition & 1 deletion pages/accountLists/[accountListId]/coaching.page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import Head from 'next/head';
import React from 'react';
import { useTranslation } from 'react-i18next';
import { CoachingList } from 'src/components/Coaching/CoachingList';
import Loading from 'src/components/Loading';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import Head from 'next/head';
import { useRouter } from 'next/router';
import React from 'react';
import { useTranslation } from 'react-i18next';
import {
AccountListTypeEnum,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { NextRouter, useRouter } from 'next/router';
import React, {
Dispatch,
SetStateAction,
Expand All @@ -8,7 +9,6 @@ import React, {
useState,
} from 'react';
import _, { debounce } from 'lodash';
import { NextRouter, useRouter } from 'next/router';
import { useGetIdsForMassSelectionQuery } from 'src/hooks/GetIdsForMassSelection.generated';
import { useLocale } from 'src/hooks/useLocale';
import { sanitizeFilters } from 'src/lib/sanitizeFilters';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useRouter } from 'next/router';
import React, { useEffect, useMemo, useState } from 'react';
import _ from 'lodash';
import { useRouter } from 'next/router';
import { suggestArticles } from 'src/lib/helpScout';
import { sanitizeFilters } from 'src/lib/sanitizeFilters';
import { ContactFilterSetInput } from '../../../../graphql/types.generated';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Head from 'next/head';
import React, { useCallback, useEffect, useState } from 'react';
import Box from '@mui/material/Box';
import { styled } from '@mui/material/styles';
import _ from 'lodash';
import Head from 'next/head';
import { useSnackbar } from 'notistack';
import { DndProvider } from 'react-dnd';
import { HTML5Backend } from 'react-dnd-html5-backend';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { ReactElement, useEffect } from 'react';
import Head from 'next/head';
import React, { ReactElement, useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import {
AccountListTypeEnum,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Head from 'next/head';
import React, { useEffect, useState } from 'react';
import Box from '@mui/material/Box';
import { styled } from '@mui/material/styles';
import Head from 'next/head';
import { useTranslation } from 'react-i18next';
import { SidePanelsLayout } from 'src/components/Layouts/SidePanelsLayout';
import Loading from 'src/components/Loading';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Head from 'next/head';
import { useRouter } from 'next/router';
import React, { useEffect, useState } from 'react';
import Box from '@mui/material/Box';
import { styled } from '@mui/material/styles';
import Head from 'next/head';
import { useRouter } from 'next/router';
import { useTranslation } from 'react-i18next';
import { ContactsRightPanel } from 'src/components/Contacts/ContactsRightPanel/ContactsRightPanel';
import { SidePanelsLayout } from 'src/components/Layouts/SidePanelsLayout';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Head from 'next/head';
import React, { ReactElement, useEffect, useState } from 'react';
import { Box } from '@mui/material';
import { styled } from '@mui/material/styles';
import Head from 'next/head';
import { useTranslation } from 'react-i18next';
import { SidePanelsLayout } from 'src/components/Layouts/SidePanelsLayout';
import Loading from 'src/components/Loading';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Head from 'next/head';
import { useRouter } from 'next/router';
import React, { useEffect, useState } from 'react';
import Box from '@mui/material/Box';
import { styled } from '@mui/material/styles';
import Head from 'next/head';
import { useRouter } from 'next/router';
import { useTranslation } from 'react-i18next';
import { ContactsRightPanel } from 'src/components/Contacts/ContactsRightPanel/ContactsRightPanel';
import { SidePanelsLayout } from 'src/components/Layouts/SidePanelsLayout';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Head from 'next/head';
import { useRouter } from 'next/router';
import React, { useEffect, useMemo, useState } from 'react';
import Box from '@mui/material/Box';
import { styled } from '@mui/material/styles';
import { sortBy } from 'lodash';
import Head from 'next/head';
import { useRouter } from 'next/router';
import { useTranslation } from 'react-i18next';
import { ReportContactFilterSetInput } from 'pages/api/graphql-rest.page.generated';
import { ContactsRightPanel } from 'src/components/Contacts/ContactsRightPanel/ContactsRightPanel';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Head from 'next/head';
import React, { useEffect, useState } from 'react';
import Box from '@mui/material/Box';
import { styled } from '@mui/material/styles';
import Head from 'next/head';
import { useTranslation } from 'react-i18next';
import { SidePanelsLayout } from 'src/components/Layouts/SidePanelsLayout';
import Loading from 'src/components/Loading';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Head from 'next/head';
import { useRouter } from 'next/router';
import React, { useEffect, useState } from 'react';
import Box from '@mui/material/Box';
import { styled } from '@mui/material/styles';
import Head from 'next/head';
import { useRouter } from 'next/router';
import { useTranslation } from 'react-i18next';
import { ContactsRightPanel } from 'src/components/Contacts/ContactsRightPanel/ContactsRightPanel';
import { SidePanelsLayout } from 'src/components/Layouts/SidePanelsLayout';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { GetServerSideProps } from 'next';
import { useRouter } from 'next/router';
import React, { ReactElement, useEffect, useState } from 'react';
import { getToken } from 'next-auth/jwt';
import { useRouter } from 'next/router';
import { useTranslation } from 'react-i18next';
import { ChalklineAccordion } from 'src/components/Settings/integrations/Chalkline/ChalklineAccordion';
import { GoogleAccordion } from 'src/components/Settings/integrations/Google/GoogleAccordion';
Expand Down
2 changes: 1 addition & 1 deletion pages/accountLists/[accountListId]/settings/wrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Head from 'next/head';
import React, { useState } from 'react';
import { Box, Container } from '@mui/material';
import { styled } from '@mui/material/styles';
import Head from 'next/head';
import { SidePanelsLayout } from 'src/components/Layouts/SidePanelsLayout';
import {
HeaderTypeEnum,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import Head from 'next/head';
import { useRouter } from 'next/router';
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import AddIcon from '@mui/icons-material/Add';
import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline';
import { Box, Button, ButtonGroup, Hidden } from '@mui/material';
import { styled } from '@mui/material/styles';
import debounce from 'lodash/debounce';
import { DateTime } from 'luxon';
import Head from 'next/head';
import { useRouter } from 'next/router';
import { useTranslation } from 'react-i18next';
import { ContactsRightPanel } from 'src/components/Contacts/ContactsRightPanel/ContactsRightPanel';
import { navBarHeight } from 'src/components/Layouts/Primary/Primary';
Expand Down
2 changes: 1 addition & 1 deletion pages/accountLists/[accountListId]/tools.page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { ReactElement } from 'react';
import Head from 'next/head';
import React, { ReactElement } from 'react';
import { useTranslation } from 'react-i18next';
import ToolHome from 'src/components/Tool/Home/Home';
import useGetAppSettings from 'src/hooks/useGetAppSettings';
Expand Down
2 changes: 1 addition & 1 deletion pages/accountLists/[accountListId]/tools/appeals.page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Head from 'next/head';
import React from 'react';
import { Box, Divider, Grid, Theme, Typography } from '@mui/material';
import { motion } from 'framer-motion';
import Head from 'next/head';
import { useTranslation } from 'react-i18next';
import { makeStyles } from 'tss-react/mui';
import useGetAppSettings from 'src/hooks/useGetAppSettings';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Head from 'next/head';
import React, { ReactElement, useState } from 'react';
import { Box, Container, Theme } from '@mui/material';
import Head from 'next/head';
import { useTranslation } from 'react-i18next';
import { makeStyles } from 'tss-react/mui';
import useGetAppSettings from 'src/hooks/useGetAppSettings';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import Head from 'next/head';
import React from 'react';
import { useTranslation } from 'react-i18next';
import useGetAppSettings from 'src/hooks/useGetAppSettings';
import Loading from '../../../../src/components/Loading';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import Head from 'next/head';
import React from 'react';
import { useTranslation } from 'react-i18next';
import useGetAppSettings from 'src/hooks/useGetAppSettings';
import Loading from '../../../../src/components/Loading';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import Head from 'next/head';
import React from 'react';
import { useTranslation } from 'react-i18next';
import useGetAppSettings from 'src/hooks/useGetAppSettings';
import Loading from '../../../../src/components/Loading';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import Head from 'next/head';
import React from 'react';
import { useTranslation } from 'react-i18next';
import useGetAppSettings from 'src/hooks/useGetAppSettings';
import Loading from '../../../../src/components/Loading';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import Head from 'next/head';
import React from 'react';
import { useTranslation } from 'react-i18next';
import useGetAppSettings from 'src/hooks/useGetAppSettings';
import Loading from '../../../../src/components/Loading';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import Head from 'next/head';
import React from 'react';
import { useTranslation } from 'react-i18next';
import useGetAppSettings from 'src/hooks/useGetAppSettings';
import Loading from '../../../../src/components/Loading';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import Head from 'next/head';
import React from 'react';
import { useTranslation } from 'react-i18next';
import useGetAppSettings from 'src/hooks/useGetAppSettings';
import Loading from '../../../../src/components/Loading';
Expand Down
2 changes: 1 addition & 1 deletion pages/login.page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { GetServerSideProps } from 'next';
import Head from 'next/head';
import React, { ReactElement, useEffect } from 'react';
import SubjectIcon from '@mui/icons-material/Subject';
import { Button } from '@mui/material';
import i18n from 'i18next';
import { getSession, signIn } from 'next-auth/react';
import Head from 'next/head';
import BaseLayout from '../src/components/Layouts/Basic';
import Loading from '../src/components/Loading';
import Welcome from '../src/components/Welcome';
Expand Down
2 changes: 1 addition & 1 deletion pages/logout.page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { GetServerSideProps } from 'next';
import Head from 'next/head';
import React, { ReactElement, useEffect } from 'react';
import ExitToAppRoundedIcon from '@mui/icons-material/ExitToAppRounded';
import { Box, Typography } from '@mui/material';
import { styled } from '@mui/material/styles';
import { signOut } from 'next-auth/react';
import Head from 'next/head';
import { useTranslation } from 'react-i18next';
import { clearDataDogUser } from 'src/hooks/useDataDog';
import useGetAppSettings from 'src/hooks/useGetAppSettings';
Expand Down
2 changes: 1 addition & 1 deletion src/components/AccountLists/AccountLists.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Link from 'next/link';
import React, { ReactElement } from 'react';
import {
Box,
Expand All @@ -9,7 +10,6 @@ import {
Typography,
} from '@mui/material';
import { motion } from 'framer-motion';
import Link from 'next/link';
import { useTranslation } from 'react-i18next';
import { makeStyles } from 'tss-react/mui';
import { useLocale } from 'src/hooks/useLocale';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
import { useRouter } from 'next/router';
import React, { useState } from 'react';
import { TabKey } from './ContactDetails';
import { DonationTabKey } from './ContactDontationsTab/ContactDonationsTab';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import NextLink from 'next/link';
import React, { useState } from 'react';
import Add from '@mui/icons-material/Add';
import ChevronLeft from '@mui/icons-material/ChevronLeft';
import LoadingButton from '@mui/lab/LoadingButton';
import { Box, Button } from '@mui/material';
import { styled } from '@mui/material/styles';
import NextLink from 'next/link';
import { useTranslation } from 'react-i18next';
import { useAccountListId } from '../../../../../hooks/useAccountListId';

Expand Down
2 changes: 1 addition & 1 deletion src/components/Contacts/ContactsContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Head from 'next/head';
import React, { useContext } from 'react';
import Box from '@mui/material/Box';
import { styled } from '@mui/material/styles';
import _ from 'lodash';
import Head from 'next/head';
import { DndProvider } from 'react-dnd';
import { HTML5Backend } from 'react-dnd-html5-backend';
import { useTranslation } from 'react-i18next';
Expand Down
Loading

0 comments on commit b1de61f

Please sign in to comment.