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

Upgrade prettier. #743

Merged
merged 2 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 additions & 3 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@
"eslint": "^8",
"eslint-config-prettier": "^8",
"eslint-plugin-import": "^2",
"eslint-plugin-prettier": "^4",
"eslint-plugin-prettier": "^5",
"eslint-plugin-react": "^7",
"eslint-plugin-react-hooks": "^4",
"eslint-plugin-storybook": "^0",
"prettier": "2.7.1",
"prettier": "^3",
"prop-types": "^15",
"react-i18next": "^12",
"react-scripts": "5.0.1",
"react-scripts": "^5",
"sass": "^1",
"stylelint": "^15",
"stylelint-config-prettier": "^9",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Components/AdminBox/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const TYPE = {

export type Type = typeof TYPE;
export type TypeKey = keyof Type;
export type TypeValue = typeof TYPE[TypeKey];
export type TypeValue = (typeof TYPE)[TypeKey];

export type Options = {
text: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,5 @@ type ShortcutProps = {
export function Shortcut({ keys }: ShortcutProps) {
if (!keys) return null;

return (
<div className="command-menu__shortcut">
{keys?.map((item, i) => (
<kbd key={i}>{item}</kbd>
))}
</div>
);
return <div className="command-menu__shortcut">{keys?.map((item, i) => <kbd key={i}>{item}</kbd>)}</div>;
}
3 changes: 1 addition & 2 deletions frontend/src/Pages/LoginPage/LoginPage.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { Link, useLocation, useNavigate } from 'react-router-dom';
import { toast } from 'react-toastify';
import { useAuthContext } from '~/AuthContext';
import { Alert, Page } from '~/Components';
import { Page } from '~/Components';
import { SamfForm } from '~/Forms/SamfForm';
import { SamfFormField } from '~/Forms/SamfFormField';
import { getUser, login } from '~/api';
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/constants/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const MIRROR_CLASS = 'mirror-dimension';
export const CURSOR_TRAIL_CLASS = 'trail';

export type ThemeKey = keyof typeof THEME;
export type ThemeValue = typeof THEME[ThemeKey];
export type ThemeValue = (typeof THEME)[ThemeKey];

export const XCSRFTOKEN = 'X-CSRFToken';

Expand Down
4 changes: 2 additions & 2 deletions frontend/src/i18n/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,12 @@ export const KEY = {
* Reveals errors in translations.ts if some keys are not translated.
*/
export type KeyKeys = keyof typeof KEY;
export type KeyValues = typeof KEY[KeyKeys];
export type KeyValues = (typeof KEY)[KeyKeys];

export const LANGUAGES = {
NB: 'nb',
EN: 'en',
} as const;

export type LanguageKey = keyof typeof LANGUAGES;
export type LanguageValue = typeof LANGUAGES[LanguageKey];
export type LanguageValue = (typeof LANGUAGES)[LanguageKey];
6 changes: 3 additions & 3 deletions frontend/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export type ButtonType = 'submit' | 'reset' | 'button';
export type KeyValueMap = Map<string, string>;

/** Type for the constant of KeyValue keys in the database. */
export type Key = typeof KV[keyof typeof KV];
export type Key = (typeof KV)[keyof typeof KV];

/** Synonym for ReactNode, but easier to remember. */
export type Children = ReactNode;
Expand Down Expand Up @@ -73,7 +73,7 @@ export const COLORS = {

export type Color = typeof COLORS;
export type ColorKey = keyof Color;
export type ColorValue = typeof COLORS[ColorKey];
export type ColorValue = (typeof COLORS)[ColorKey];

/** Easy type when adding setStates to Context. */
export type SetState<T> = Dispatch<SetStateAction<T>>;
Expand All @@ -95,7 +95,7 @@ export const EventTicketType = {
CUSTOM: 'custom',
} as const;

export type EventTicketTypeValue = typeof EventTicketType[keyof typeof EventTicketType];
export type EventTicketTypeValue = (typeof EventTicketType)[keyof typeof EventTicketType];

export const ALL_TICKET_TYPES: EventTicketTypeValue[] = [
EventTicketType.FREE,
Expand Down
Loading
Loading