diff --git a/package.json b/package.json index 32e1186..b4af7ab 100644 --- a/package.json +++ b/package.json @@ -23,11 +23,11 @@ "lint-staged": { "src/**/*.{js,jsx,ts,tsx}": [ "eslint --fix", - "prettier --write --tab-width 4", + "prettier --write --tab-width 4 --single-quote", "git add" ], "src/**/*.{json,css,scss,md}": [ - "prettier --write --tab-width 4", + "prettier --write --tab-width 4 --single-quote", "git add" ] }, diff --git a/src/clients/Element.io.ts b/src/clients/Element.io.ts index 015c31d..402f97f 100644 --- a/src/clients/Element.io.ts +++ b/src/clients/Element.io.ts @@ -14,18 +14,18 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { LinkedClient, Maturity, ClientKind } from "./types"; -import { LinkKind } from "../parser/types"; -import logo from "./element.svg"; +import { LinkedClient, Maturity, ClientKind } from './types'; +import { LinkKind } from '../parser/types'; +import logo from './element.svg'; const Element: LinkedClient = { kind: ClientKind.LINKED_CLIENT, - name: "Element", - author: "Element", + name: 'Element', + author: 'Element', logo: logo, - homepage: "https://element.io", + homepage: 'https://element.io', maturity: Maturity.STABLE, - description: "Fully-featured Matrix client for the Web", + description: 'Fully-featured Matrix client for the Web', tags: [], toUrl: (link) => { switch (link.kind) { diff --git a/src/clients/index.ts b/src/clients/index.ts index ac67755..0fc102f 100644 --- a/src/clients/index.ts +++ b/src/clients/index.ts @@ -14,9 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { Client } from "./types"; +import { Client } from './types'; -import Element from "./Element.io"; +import Element from './Element.io'; /* * All the supported clients of matrix.to diff --git a/src/clients/types.ts b/src/clients/types.ts index 4d21ac4..8daea91 100644 --- a/src/clients/types.ts +++ b/src/clients/types.ts @@ -14,35 +14,35 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { SafeLink } from "../parser/types"; +import { SafeLink } from '../parser/types'; /* * A collection of descriptive tags that can be added to * a clients description. */ export enum Tag { - IOS = "IOS", - ANDROID = "ANDROID", - DESKTOP = "DESKTOP", + IOS = 'IOS', + ANDROID = 'ANDROID', + DESKTOP = 'DESKTOP', } /* * A collection of states used for describing a clients maturity. */ export enum Maturity { - ALPHA = "ALPHA", - LATE_ALPHA = "LATE ALPHA", - BETA = "BETA", - LATE_BETA = "LATE_BETA", - STABLE = "STABLE", + ALPHA = 'ALPHA', + LATE_ALPHA = 'LATE ALPHA', + BETA = 'BETA', + LATE_BETA = 'LATE_BETA', + STABLE = 'STABLE', } /* * Used for constructing the discriminated union of all client types. */ export enum ClientKind { - LINKED_CLIENT = "LINKED_CLIENT", - TEXT_CLIENT = "TEXT_CLIENT", + LINKED_CLIENT = 'LINKED_CLIENT', + TEXT_CLIENT = 'TEXT_CLIENT', } /* diff --git a/src/components/Avatar.stories.tsx b/src/components/Avatar.stories.tsx index 2a8de36..1032c18 100644 --- a/src/components/Avatar.stories.tsx +++ b/src/components/Avatar.stories.tsx @@ -14,17 +14,21 @@ See the License for the specific language governing permissions and limitations under the License. */ -import React from "react"; +// disable camelcase check because our object keys come +// from the matrix spec +/* eslint-disable @typescript-eslint/camelcase */ -import { UserAvatar } from "./Avatar"; +import React from 'react'; + +import { UserAvatar } from './Avatar'; export default { - title: "Avatar", + title: 'Avatar', parameters: { design: { - type: "figma", + type: 'figma', url: - "https://www.figma.com/file/WSXjCGc1k6FVI093qhlzOP/04-Recieving-share-link?node-id=143%3A5853", + 'https://www.figma.com/file/WSXjCGc1k6FVI093qhlzOP/04-Recieving-share-link?node-id=143%3A5853', }, }, }; @@ -32,8 +36,8 @@ export default { export const Default: React.FC<{}> = () => ( diff --git a/src/components/Avatar.tsx b/src/components/Avatar.tsx index a3de53b..003d004 100644 --- a/src/components/Avatar.tsx +++ b/src/components/Avatar.tsx @@ -14,14 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. */ -import React, { useEffect, useState } from "react"; -import classNames from "classnames"; -import { Room, User } from "matrix-cypher"; +import React, { useEffect, useState } from 'react'; +import classNames from 'classnames'; +import { Room, User } from 'matrix-cypher'; -import { getMediaQueryFromMCX } from "../utils/cypher-wrapper"; -import logo from "../imgs/matrix-logo.svg"; +import { getMediaQueryFromMCX } from '../utils/cypher-wrapper'; +import logo from '../imgs/matrix-logo.svg'; -import "./Avatar.scss"; +import './Avatar.scss'; interface IProps { className?: string; @@ -40,7 +40,7 @@ const Avatar: React.FC = ({ className, avatarUrl, label }: IProps) => { src={src} onError={(): void => setSrc(logo)} alt={label} - className={classNames("avatar", className)} + className={classNames('avatar', className)} /> ); }; diff --git a/src/components/Button.stories.tsx b/src/components/Button.stories.tsx index 2514b6d..1f5d2e5 100644 --- a/src/components/Button.stories.tsx +++ b/src/components/Button.stories.tsx @@ -14,16 +14,16 @@ See the License for the specific language governing permissions and limitations under the License. */ -import React from "react"; -import { action } from "@storybook/addon-actions"; -import { text } from "@storybook/addon-knobs"; +import React from 'react'; +import { action } from '@storybook/addon-actions'; +import { text } from '@storybook/addon-knobs'; -import Button from "./Button"; +import Button from './Button'; -export default { title: "Button" }; +export default { title: 'Button' }; export const WithText: React.FC = () => ( - ); diff --git a/src/components/Button.tsx b/src/components/Button.tsx index 420bf0b..a347254 100644 --- a/src/components/Button.tsx +++ b/src/components/Button.tsx @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import React from "react"; -import classnames from "classnames"; +import React from 'react'; +import classnames from 'classnames'; -import "./Button.scss"; +import './Button.scss'; interface IProps extends React.ButtonHTMLAttributes { // Briefly display these instead of the children onClick @@ -49,7 +49,7 @@ const Button: React.FC< const content = wasClicked && flashChildren ? flashChildren : children; - const classNames = classnames("button", className, { + const classNames = classnames('button', className, { buttonHighlight: wasClicked, }); diff --git a/src/components/CreateLinkTile.stories.tsx b/src/components/CreateLinkTile.stories.tsx index f247506..48d7e5c 100644 --- a/src/components/CreateLinkTile.stories.tsx +++ b/src/components/CreateLinkTile.stories.tsx @@ -14,17 +14,17 @@ See the License for the specific language governing permissions and limitations under the License. */ -import React from "react"; +import React from 'react'; -import CreateLinkTile from "./CreateLinkTile"; +import CreateLinkTile from './CreateLinkTile'; export default { - title: "CreateLinkTile", + title: 'CreateLinkTile', parameters: { design: { - type: "figma", + type: 'figma', url: - "https://figma.com/file/WSXjCGc1k6FVI093qhlzOP/04-Recieving-share-link?node-id=59%3A1", + 'https://figma.com/file/WSXjCGc1k6FVI093qhlzOP/04-Recieving-share-link?node-id=59%3A1', }, }, }; diff --git a/src/components/CreateLinkTile.tsx b/src/components/CreateLinkTile.tsx index 4d557e7..63a57d3 100644 --- a/src/components/CreateLinkTile.tsx +++ b/src/components/CreateLinkTile.tsx @@ -14,15 +14,15 @@ See the License for the specific language governing permissions and limitations under the License. */ -import React, { useEffect, useRef } from "react"; -import Tile from "./Tile"; -import Button from "./Button"; -import TextButton from "./TextButton"; -import Input from "./Input"; -import { Formik, Form } from "formik"; -import * as Yup from "yup"; +import React, { useEffect, useRef } from 'react'; +import Tile from './Tile'; +import Button from './Button'; +import TextButton from './TextButton'; +import Input from './Input'; +import { Formik, Form } from 'formik'; +import * as Yup from 'yup'; -import "./CreateLinkTile.scss"; +import './CreateLinkTile.scss'; interface ILinkNotCreatedTileProps { setLink: React.Dispatch>; @@ -39,31 +39,31 @@ const LinkNotCreatedTile: React.FC = ( link ) - .required("Required"), + .required('Required'), })} onSubmit={(values): void => { props.setLink( document.location.protocol + - "//" + + '//' + document.location.host + - "/" + + '/' + values.identifier ); }} >
@@ -90,12 +90,12 @@ const LinkCreatedTile: React.FC = (props) => { return ( - props.setLink("")}> + props.setLink('')}> Create another lnk

{props.link}