Skip to content

Commit

Permalink
Update import sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
cwhuang29 committed May 5, 2023
1 parent 54bcca1 commit 88e83c9
Show file tree
Hide file tree
Showing 16 changed files with 21 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@
"groups": [
// Side effect imports
["^\\u0000"],
["^react", "^redux", "^prop-types", "^styled-components", "^formik", "^yup", "^@mui", "^webextension-polyfill"],
["^(@|@pages|@components|@shared|@actions|@constants|@hooks|@reducers|@selectors|@services|@utils|@home)"],
["^react", "^webextension-polyfill", "^prop-types", "^formik", "^yup", "^buffer", "^jwt"],
["^@mui", "^styled-components"],
["^(@|@background|@popup|@content|@pages|@components|@shared|@actions|@constants|@hooks|@oauth|@services|@utils)"],
// Style imports
['^.+\.s?css$'],
// Absolute imports and other imports such as Vue-style `@/foo`. Anything not matched in another group
Expand Down Expand Up @@ -86,7 +87,6 @@
"@constants": "./src/shared/constants",
"@hooks": "./src/shared/hooks",
"@oauth": "./src/shared/oauth",
"@selectors": "./src/shared/selectors",
"@services": "./src/shared/services",
"@utils": "./src/shared/utils"
}
Expand Down
1 change: 0 additions & 1 deletion jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"@constants/*": ["shared/constants/*"],
"@hooks/*": ["shared/hooks/*"],
"@oauth/*": ["shared/oauth/*"],
"@selectors/*": ["shared/selectors/*"],
"@services/*": ["shared/services/*"],
"@utils/*": ["shared/utils/*"]
}
Expand Down
3 changes: 2 additions & 1 deletion src/content/Highlighter/Detail.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from 'react';
import Browser from 'webextension-polyfill';
import PropTypes from 'prop-types';

import { Box } from '@mui/material';
import Browser from 'webextension-polyfill';

import menuBookIcon from '@/../assets/svgs/menu_book.svg';
import speakerIcon from '@/../assets/svgs/speaker.svg';
Expand Down
3 changes: 2 additions & 1 deletion src/popup/PopupManager/index.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import Browser from 'webextension-polyfill';
import PropTypes from 'prop-types';

import { getStorage, setStorage } from '@browsers/storage';
import { EXT_MSG_TYPE_COLLECTED_WORD_LIST_UPDATE, EXT_MSG_TYPE_CONFIG_UPDATE, EXT_MSG_TYPE_GET_WORD_LIST, EXT_MSG_TYPE_INIT_SETUP } from '@constants/messages';
Expand Down Expand Up @@ -42,6 +42,7 @@ const PopupManager = ({ children }) => {
* Since this function is registered to the listener in the beginning, the setExtMessageValue becomes a "stale" version
* Even if using the callback function syntax cannot let us get the latest value
*/
// eslint-disable-next-line no-unused-vars
const onMessageListener = (message, sender, sendResponse) => {
const sdr = sender.tab ? `from a content script :${sender.tab.url}` : 'from the extension';
logger(`[popup] message received: ${message.type}. Sender: ${sdr}`);
Expand Down
1 change: 1 addition & 0 deletions src/popup/PopupView/BaseWrapper.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';

import { Box } from '@mui/material';

const BaseWrapper = ({ children }) => (
Expand Down
1 change: 1 addition & 0 deletions src/popup/PopupView/CollectedWords.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useEffect, useMemo, useState } from 'react';
import PropTypes from 'prop-types';

import MenuBookIcon from '@mui/icons-material/MenuBook';
import StarIcon from '@mui/icons-material/Star';
import VolumeUpIcon from '@mui/icons-material/VolumeUp';
Expand Down
1 change: 1 addition & 0 deletions src/popup/PopupView/DailyWord.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';

import MenuBookIcon from '@mui/icons-material/MenuBook';
import { Box, Typography } from '@mui/material';

Expand Down
1 change: 1 addition & 0 deletions src/popup/PopupView/Palette.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';

import { Box, Skeleton } from '@mui/material';

import { HIGHLIGHTER_BG_COLORS_CODE } from '@constants/styles';
Expand Down
1 change: 1 addition & 0 deletions src/popup/PopupView/Profile.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useEffect, useState } from 'react';
import PropTypes from 'prop-types';

import GoogleIcon from '@mui/icons-material/Google';
import LogoutIcon from '@mui/icons-material/Logout';
import SentimentSatisfiedAltIcon from '@mui/icons-material/SentimentSatisfiedAlt';
Expand Down
1 change: 1 addition & 0 deletions src/popup/PopupView/Section.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';

import { Box } from '@mui/material';

const Section = ({ children }) => (
Expand Down
1 change: 1 addition & 0 deletions src/popup/PopupView/SectionTitle.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';

import { FormHelperText } from '@mui/material';

const SectionTitle = ({ children }) => <FormHelperText style={{ margin: '-3px 0 8px 0', lineHeight: '7px' }}>{children}</FormHelperText>;
Expand Down
1 change: 1 addition & 0 deletions src/popup/PopupView/Setting.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useState } from 'react';
import PropTypes from 'prop-types';

import { Box, Checkbox as MuiCheckBox, FormControlLabel, MenuItem, TextField } from '@mui/material';

import { LANGS_DISPLAY, LANGS_SUPPORTED } from '@constants/i18n';
Expand Down
1 change: 1 addition & 0 deletions src/popup/PopupView/index.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useEffect, useReducer, useState } from 'react';

import { Stack } from '@mui/material';

import { getCurrentTab, sendMessage, sendMessageToTab } from '@browsers/message';
Expand Down
2 changes: 2 additions & 0 deletions src/shared/constants/words/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable */

import { LANGS_SUPPORTED } from '@constants/i18n';

import GRE_en from './gre/en';
Expand Down
6 changes: 3 additions & 3 deletions src/shared/oauth/azure.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Buffer } from 'buffer';
import jwtDecode from 'jwt-decode';

import config from '@/config.js';
import { getOauthRedirectUrl, getOauthScopes, launchWebAuthFlow } from '@browsers/identity';
import oauthService from '@services/oauth.service';
import { logger } from '@utils/logger';
import { genShortRandomString } from '@utils/misc';

import { Buffer } from 'buffer';
import jwtDecode from 'jwt-decode';

const AZURE_OAUTH_ENDPOINT = 'https://login.microsoftonline.com';

const AZURE_OAUTH_AUTH_PATH = '/common/oauth2/v2.0/authorize';
Expand Down
1 change: 0 additions & 1 deletion vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export default defineConfig({
{ find: '@constants', replacement: path.resolve(__dirname, 'src/shared/constants') },
{ find: '@hooks', replacement: path.resolve(__dirname, 'src/shared/hooks') },
{ find: '@oauth', replacement: path.resolve(__dirname, 'src/shared/oauth') },
{ find: '@selectors', replacement: path.resolve(__dirname, 'src/shared/selectors') },
{ find: '@services', replacement: path.resolve(__dirname, 'src/shared/services') },
{ find: '@utils', replacement: path.resolve(__dirname, 'src/shared/utils') },
],
Expand Down

0 comments on commit 88e83c9

Please sign in to comment.