diff --git a/frontend/app/common/api.ts b/frontend/app/common/api.ts index e8ca2838..0abea9a7 100644 --- a/frontend/app/common/api.ts +++ b/frontend/app/common/api.ts @@ -84,7 +84,7 @@ export const unsubscribeFromEmailUpdates = () => apiFetcher.delete('/email'); export const deleteMe = (): Promise<{ user_id: string; link: string }> => apiFetcher.post('/deleteme'); /* Admin Methods */ -// TODO: move these methods to separate chunk as well as all admin inteface features +// TODO: move these methods to separate chunk as well as all admin interface features export const approveDeleteMe = (token: string): Promise => adminFetcher.get('/deleteme', { token }); export const pinComment = (id: Comment['id']): Promise => adminFetcher.put(`/pin/${id}`, { url, pin: 1 }); diff --git a/frontend/app/common/constants.ts b/frontend/app/common/constants.ts index c4de4645..e02643a6 100644 --- a/frontend/app/common/constants.ts +++ b/frontend/app/common/constants.ts @@ -39,7 +39,7 @@ export const IS_STORAGE_AVAILABLE: boolean = (() => { /** * Defines whether iframe loaded in cross origin environment - * Usefull for checking if some privacy restriction may be applied + * Useful for checking if some privacy restriction may be applied */ export const IS_THIRD_PARTY: boolean = (() => { try { diff --git a/frontend/app/common/fetcher.test.ts b/frontend/app/common/fetcher.test.ts index bab8d02b..b6c4a470 100644 --- a/frontend/app/common/fetcher.test.ts +++ b/frontend/app/common/fetcher.test.ts @@ -6,7 +6,7 @@ import { RequestError } from 'utils/errorUtils'; import { API_BASE, BASE_URL } from './constants.config'; import { apiFetcher, authFetcher, adminFetcher, JWT_HEADER } from './fetcher'; -type FetchImplementaitonProps = { +type FetchImplementationProps = { status?: number; headers?: Record; json?: () => Promise; @@ -14,7 +14,7 @@ type FetchImplementaitonProps = { data?: unknown; }; -function mockFetch({ headers = {}, data = {}, ...props }: FetchImplementaitonProps = {}) { +function mockFetch({ headers = {}, data = {}, ...props }: FetchImplementationProps = {}) { window.fetch = jest.fn().mockImplementation(() => { return { status: 200, @@ -96,7 +96,7 @@ describe('fetcher', () => { }); describe('headers', () => { - it('should set active token and than clean it on unauthorized respose', async () => { + it('should set active token and than clean it on unauthorized response', async () => { expect.assertions(4); const headersWithJwt = { [JWT_HEADER]: 'token', ...headers }; @@ -110,7 +110,7 @@ describe('fetcher', () => { mockFetch({ headers, status: 401 }); await expect( apiFetcher.get(apiUri).then(() => { - throw Error('apiFether shoud throw error on 401 responce'); + throw Error('apiFetcher should throw error on 401 response'); }) ).rejects.toEqual(new Error('Not authorized.')); diff --git a/frontend/app/common/local-storage.test.ts b/frontend/app/common/local-storage.test.ts index 5c633f46..ac0b547f 100644 --- a/frontend/app/common/local-storage.test.ts +++ b/frontend/app/common/local-storage.test.ts @@ -11,7 +11,7 @@ describe('getJsonItem', () => { expect(localStorage.getItem(LS_KEY)).toBe('{}'); }); - it('should update json in localStoeage', () => { + it('should update json in localStorage', () => { setJsonItem(LS_KEY, []); expect(localStorage.getItem(LS_KEY)).toBe('[]'); }); diff --git a/frontend/app/common/static-store.ts b/frontend/app/common/static-store.ts index cb9d8a63..e93fc9cc 100644 --- a/frontend/app/common/static-store.ts +++ b/frontend/app/common/static-store.ts @@ -4,7 +4,7 @@ import { QuerySettingsType, querySettings } from './settings'; interface StaticStoreType { config: Config; query: QuerySettingsType; - /** used in fetcher, fer example to set comment edit temiout */ + /** used in fetcher, fer example to set comment edit timeout */ serverClientTimeDiff?: number; } diff --git a/frontend/app/common/types.ts b/frontend/app/common/types.ts index c9e1ad58..69097e9e 100644 --- a/frontend/app/common/types.ts +++ b/frontend/app/common/types.ts @@ -65,7 +65,7 @@ export interface Comment { /** * @ClientOnly defines whether comments was hidden (deleted) * - * Situatuon may occure for example if user decided to hide someone, + * Situation may occur for example if user decided to hide someone, * in this case we don't use `delete` field because comment with `delete` * still renders, and comment with `hidden` flag completely removed from DOM */ diff --git a/frontend/app/components/auth/auth.spec.tsx b/frontend/app/components/auth/auth.spec.tsx index a7de420d..aa06a512 100644 --- a/frontend/app/components/auth/auth.spec.tsx +++ b/frontend/app/components/auth/auth.spec.tsx @@ -161,7 +161,7 @@ describe('', () => { expect(getByText('Back')).toHaveClass('auth-back-button'); expect(getByTitle('Close sign-in dropdown')).toHaveClass('auth-close-button'); - expect(getByPlaceholderText('Token')).toHaveClass('auth-token-textatea'); + expect(getByPlaceholderText('Token')).toHaveClass('auth-token-textarea'); fireEvent.change(getByPlaceholderText('Token'), { target: { value: 'token' }, @@ -189,7 +189,7 @@ describe('', () => { expect(getByText('Back')).toHaveClass('auth-back-button'); expect(getByTitle('Close sign-in dropdown')).toHaveClass('auth-close-button'); - expect(getByPlaceholderText('Token')).toHaveClass('auth-token-textatea'); + expect(getByPlaceholderText('Token')).toHaveClass('auth-token-textarea'); fireEvent.change(getByPlaceholderText('Token'), { target: { value: 'token' } }); fireEvent.click(getByText('Submit')); @@ -220,7 +220,7 @@ describe('', () => { ${'username '} | ${'username'} ${' username'} | ${'username'} ${' username '} | ${'username'} - `('should remove spaces in the first/last postion in username', async ({ value, expected }) => { + `('should remove spaces in the first/last position in username', async ({ value, expected }) => { StaticStore.config.auth_providers = ['email']; const { getByText, getByPlaceholderText } = render(); diff --git a/frontend/app/components/auth/auth.tsx b/frontend/app/components/auth/auth.tsx index 4a7fd135..4eefbb69 100644 --- a/frontend/app/components/auth/auth.tsx +++ b/frontend/app/components/auth/auth.tsx @@ -22,13 +22,13 @@ import styles from './auth.module.css'; export function Auth() { const intl = useIntl(); - const dispath = useDispatch(); + const dispatch = useDispatch(); const [oauthProviders, formProviders] = getProviders(); // UI State const [isLoading, setLoading] = useState(false); const [view, setView] = useState(formProviders[0]); - const [ref, isDropdownShowed, toggleDropdownState] = useDropdown(view === 'token'); + const [ref, isDropdownShown, toggleDropdownState] = useDropdown(view === 'token'); // Errors const [invalidReason, setInvalidReason] = useState(null); @@ -64,7 +64,7 @@ export function Auth() { const username = data.get('username') as string; const user = await anonymousSignin(username); - dispath(setUser(user)); + dispatch(setUser(user)); break; } case 'email': { @@ -83,7 +83,7 @@ export function Auth() { setInvalidReason(invalidReason); } else { const user = await verifyEmailSignin(token); - dispath(setUser(user)); + dispatch(setUser(user)); } break; @@ -116,10 +116,10 @@ export function Auth() { ); return (
- - {isDropdownShowed && ( + {isDropdownShown && (
{isTokenView ? ( @@ -157,7 +157,7 @@ export function Auth() {
diff --git a/frontend/app/components/auth/components/oauth.tsx b/frontend/app/components/auth/components/oauth.tsx index 21cd3ff5..d48466a7 100644 --- a/frontend/app/components/auth/components/oauth.tsx +++ b/frontend/app/components/auth/components/oauth.tsx @@ -23,10 +23,10 @@ type Props = { export function OAuth({ providers }: Props) { const intl = useIntl(); - const dispath = useDispatch(); + const dispatch = useDispatch(); const theme = useTheme(); const buttonVariant = getButtonVariant(providers.length); - const handleOathClick: JSX.GenericEventHandler = async (evt) => { + const handleOauthClick: JSX.GenericEventHandler = async (evt) => { const { href } = evt.currentTarget as HTMLAnchorElement; evt.preventDefault(); @@ -36,7 +36,7 @@ export function OAuth({ providers }: Props) { return; } - dispath(setUser(user)); + dispatch(setUser(user)); }; return ( @@ -50,7 +50,7 @@ export function OAuth({ providers }: Props) { target="_blank" rel="noopener noreferrer" href={`${BASE_URL}/auth/${p}/login?from=${location}&site=${siteId}`} - onClick={handleOathClick} + onClick={handleOauthClick} className={clsx('oauth-button', styles.button, styles[buttonVariant], styles[p])} data-provider-name={name} title={intl.formatMessage(messages.oauthTitle, { provider: name })} diff --git a/frontend/app/components/comment-form/comment-form.tsx b/frontend/app/components/comment-form/comment-form.tsx index fbc88e0f..efc433d6 100644 --- a/frontend/app/components/comment-form/comment-form.tsx +++ b/frontend/app/components/comment-form/comment-form.tsx @@ -45,7 +45,7 @@ export type CommentFormProps = { export type CommentFormState = { preview: string | null; isErrorShown: boolean; - /** error message, if contains newlines, it will be splitted to multiple errors */ + /** error message, if contains newlines, it will be split to multiple errors */ errorMessage: string | null; /** prevents error hiding on input event */ errorLock: boolean; diff --git a/frontend/app/components/comment/comment.test.tsx b/frontend/app/components/comment/comment.test.tsx index 16b5de0f..8a48fc95 100644 --- a/frontend/app/components/comment/comment.test.tsx +++ b/frontend/app/components/comment/comment.test.tsx @@ -276,7 +276,7 @@ describe('', () => { ); }); - it('shoud not be editable', () => { + it('should not be editable', () => { StaticStore.config.edit_duration = 300; const component = mountComment({ diff --git a/frontend/app/components/comment/connected-comment.tsx b/frontend/app/components/comment/connected-comment.tsx index 75231a47..58677457 100644 --- a/frontend/app/components/comment/connected-comment.tsx +++ b/frontend/app/components/comment/connected-comment.tsx @@ -1,6 +1,6 @@ /* * connected comment is not exported in index.ts to avoid leaking redux import into last-comments - * and should be importded explicitly + * and should be imported explicitly */ import './styles'; diff --git a/frontend/app/components/profile/profile.module.css b/frontend/app/components/profile/profile.module.css index 77d50972..77b79835 100644 --- a/frontend/app/components/profile/profile.module.css +++ b/frontend/app/components/profile/profile.module.css @@ -15,7 +15,7 @@ transform: translateX(0); } -.rootDisapear { +.rootDisappear { transition: transform 0.5s ease-in; } diff --git a/frontend/app/components/profile/profile.tsx b/frontend/app/components/profile/profile.tsx index fe8511cc..f1d58241 100644 --- a/frontend/app/components/profile/profile.tsx +++ b/frontend/app/components/profile/profile.tsx @@ -61,7 +61,7 @@ export function Profile() { const rootElement = rootRef.current; rootElement.classList.remove(styles.rootAppear); - rootElement.classList.add(styles.rootDisapear); + rootElement.classList.add(styles.rootDisappear); // No need to unsubscribe because iframe will be destroyed rootElement.addEventListener('transitionend', () => { postMessageToParent({ profile: null }); @@ -202,7 +202,7 @@ export function Profile() { - ) : // TODO: implement hidding user comments + ) : // TODO: implement hiding user comments null}
diff --git a/frontend/app/components/select/select.spec.tsx b/frontend/app/components/select/select.spec.tsx index 25707bd8..1df54ea4 100644 --- a/frontend/app/components/select/select.spec.tsx +++ b/frontend/app/components/select/select.spec.tsx @@ -34,7 +34,7 @@ describe('); const select = container.querySelector('select'); diff --git a/frontend/app/profile.ts b/frontend/app/profile.ts index 0fe40191..ccdd8fc8 100644 --- a/frontend/app/profile.ts +++ b/frontend/app/profile.ts @@ -30,7 +30,7 @@ function createFragment(params: Profile & Record) { } root.appendChild(iframe); - setStyles(root, styles.rootShowed); + setStyles(root, styles.rootShown); setTimeout(() => iframe?.focus()); } @@ -102,7 +102,7 @@ const styles = { opacity: 0, zIndex: 99999999, }, - rootShowed: { + rootShown: { display: 'block', }, rootHidden: { diff --git a/frontend/app/store/comments/actions.ts b/frontend/app/store/comments/actions.ts index 5e9e7d2a..c5802912 100644 --- a/frontend/app/store/comments/actions.ts +++ b/frontend/app/store/comments/actions.ts @@ -109,15 +109,15 @@ export function unsetCommentMode(mode: StoreState['comments']['activeComment'] = } export function updateSorting(sort: Sorting): StoreAction { - return async (dispath, getState) => { + return async (dispatch, getState) => { const { sort: prevSort } = getState().comments; - dispath({ type: COMMENTS_SET_SORT, payload: sort }); + dispatch({ type: COMMENTS_SET_SORT, payload: sort }); try { - await dispath(fetchComments(sort)); + await dispatch(fetchComments(sort)); setItem(LS_SORT_KEY, sort); } catch (e) { - dispath({ type: COMMENTS_SET_SORT, payload: prevSort }); + dispatch({ type: COMMENTS_SET_SORT, payload: prevSort }); } }; } diff --git a/frontend/app/typings/global.d.ts b/frontend/app/typings/global.d.ts index 8f0ae214..4fdadfac 100644 --- a/frontend/app/typings/global.d.ts +++ b/frontend/app/typings/global.d.ts @@ -41,7 +41,7 @@ declare global { } /** - * Veriable responsive for dynamic setting public path for + * Variable responsive for dynamic setting public path for * assets. Dynamic imports with relative url will be resolved over this path. * * https://webpack.js.org/guides/public-path/#on-the-fly diff --git a/frontend/templates/markdown-help.html b/frontend/templates/markdown-help.html index 135c123b..8d654e3b 100644 --- a/frontend/templates/markdown-help.html +++ b/frontend/templates/markdown-help.html @@ -319,8 +319,8 @@ words italic: surround them with one asterisk *.

- You can even link to Google! using this syntax:
- [link to Google!](http://google.com) + You can even link to Google! using this syntax:
+ [link to Google!](https://google.com)

Lists

diff --git a/frontend/webpack.config.js b/frontend/webpack.config.js index 9dfb8101..7f64a0fb 100644 --- a/frontend/webpack.config.js +++ b/frontend/webpack.config.js @@ -48,7 +48,7 @@ function getLocalIdent(loaderContext, _, localName, options) { * Generates excludes for babel-loader * * Exclude is a module that has >=es6 code and resides in node_modules. - * By defaut babel-loader ignores everything from node_modules, + * By default babel-loader ignores everything from node_modules, * so we have to exclude from ignore these modules */ const exclude = [ @@ -74,11 +74,11 @@ const htmlMinifyOptions = { module.exports = (_, { mode, analyze }) => { const isDev = mode === 'development'; // Use REMARK_URL or predefined host in dev environment - // In development: We use `http://127.0.0.1:9000` for access to backend and backend is accessable via dev server proxy + // In development: We use `http://127.0.0.1:9000` for access to backend and backend is accessible via dev server proxy // In production: {% REMARK_URL %} will be replaced by `sed` on start of prod const REMARK_URL = isDev ? DEVSERVER_BASE_PATH : '{% REMARK_URL %}'; - // Add debug lib only for developmet throw webpack chuncks and keep code clear + // Add debug lib only for development throw webpack chunks and keep code clear const preactDebug = isDev ? ['preact/debug'] : []; const entry = {