diff --git a/.circleci/config.yml b/.circleci/config.yml index 1c16fe79b..fc8c99a04 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -41,10 +41,10 @@ save_cache_settings: &save_cache_settings paths: - node_modules -running_yarn_tslint: &running_yarn_tslint - name: Running Yarn tslint +running_yarn_eslint: &running_yarn_eslint + name: Running Yarn eslint command: | - yarn add tslint -g + yarn add eslint -g yarn lint running_yarn_build: &running_yarn_build @@ -81,7 +81,7 @@ lint_steps: &lint_steps # Initialization. - checkout - setup_remote_docker - - run: *running_yarn_tslint + - run: *running_yarn_eslint build_steps: &build_steps # Initialization. @@ -239,4 +239,4 @@ workflows: - master - test-dev: - context : org-global \ No newline at end of file + context : org-global diff --git a/.gitignore b/.gitignore index 6d23f4087..cd627c984 100644 --- a/.gitignore +++ b/.gitignore @@ -29,4 +29,3 @@ yarn-error.log* # Editors .editorconfig -.prettierrc diff --git a/README.md b/README.md index 1cd487a54..40693f457 100644 --- a/README.md +++ b/README.md @@ -190,10 +190,12 @@ Each [Tool](#tools) can have its own setup requirements. Please see each tool's | `yarn start:` | Serve dev mode build with dev's personal config | | `yarn build` | Build dev mode build with the default config and outputs static files in /builds | | `yarn build:prod` | Build prod mode build with the prod config and outputs static files in /builds | -| `yarn lint` | Run tslint against ts/x files and outputs report | -| `yarn lint:fix` | Run tslint against ts/x files, fixes auto-fixable issues, and outputs report | -| `yarn eslint` | Run eslint against js/x files and outputs report | -| `yarn eslint:fix` | Run eslint against js/x files, fixes auto-fixable issues, and outputs report | +| `yarn lint:ts` | Run eslint against ts/x files and outputs report | +| `yarn lint:ts:fix` | Run eslint against ts/x files, fixes auto-fixable issues, and outputs report | +| `yarn lint:js` | Run eslint against js/x files and outputs report | +| `yarn lint:js:fix` | Run eslint against js/x files, fixes auto-fixable issues, and outputs report | +| `yarn lint` | Run eslint against js/x and ts/x files and outputs report | +| `yarn lint:fix` | Run eslint against js/x and ts/x files, fixes auto-fixable issues, and outputs report | | `yarn test` | Run unit tests, watching for changes and re-running per your specifications | | `yarn test:no-watch` | Run unit tests once, without watching for changes or re-running | | `yarn cy:run` | Run e2e tests once in local command with the site is running | @@ -370,11 +372,11 @@ The PlatformRoute model has several useful options: ## Linting ### Rules -While [TSLint](https://palantir.github.io/tslint/) is technically deprecated in favor of [Typescript ESLint](https://typescript-eslint.io/), TSLint is still far better at linting Typescript files than ESLint. So, for the time being, TSLint will be the primary linter, but ESLint remains configured for JS/X files. -The following command will install TSLint globally: +Javascript rules: [src/.eslintrc.js](src/.eslintrc.js) + +Typescript rules: [src-ts/.eslintrc.js](src-ts/.eslintrc.js) ->% yarn global add tslint typescript ### Command Line @@ -386,9 +388,7 @@ The following command will install TSLint globally: >% yarn lint:fix -OR - ->% yarn eslint:fix +See the [yarn commmands](#yarn-commands) for further options. ### VS Code @@ -411,16 +411,16 @@ The most useful feature is to automatically apply all lint rules any time you sa ... "editor.formatOnSave": true, "editor.codeActionsOnSave": { - "source.fixAll.tslint": true, + "source.fixAll.eslint": true, }, } ``` -#### TSLint Plugin +#### ESLint Plugin Created by Microsoft, this plugin will allow you to see lint errors in the Problems panel. ->**WARNING:** Other lint plugins can interfere with TSLint, so it is recommended that you uninstall/disable all other lint plugins (e.g. ESLint, Prettier, etc). +>**WARNING:** Other lint plugins can interfere with ESLint, so it is recommended that you uninstall/disable all other lint plugins (e.g. TSLint, Prettier, etc). ## Styling diff --git a/cypress.config.ts b/cypress.config.ts index fc55f43d8..b6188278f 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -1,4 +1,3 @@ -// tslint:disable-next-line: no-submodule-imports This is the way cypress does it import task from '@cypress/code-coverage/task' import { defineConfig } from 'cypress' diff --git a/package.json b/package.json index 24f8ae7da..4eed6b0ae 100644 --- a/package.json +++ b/package.json @@ -13,9 +13,6 @@ "lint:js:fix": "eslint -c ./src/.eslintrc.js 'src/**/*.{js,jsx}' --fix", "lint": "npm run lint:js && npm run lint:ts", "lint:fix": "npm run lint:js:fix && npm run lint:ts:fix", - "prettier": "prettier ./src-ts/**/*.{ts,tsx} --check", - "prettier:fix": "prettier ./src-ts/**/*.{ts,tsx} --write", - "format:all": "npm run prettier:fix && npm run lint:fix", "test": "react-scripts test --watchAll", "test:no-watch": "react-scripts test --watchAll=false --passWithNoTests", "cy:run": "cypress run --reporter junit", @@ -120,14 +117,14 @@ "cypress": "^10.10.0", "eslint": "^8.25.0", "eslint-config-airbnb": "^19.0.4", - "eslint-config-prettier": "^8.5.0", "eslint-config-react-app": "^7.0.1", "eslint-config-react-important-stuff": "^3.0.0", "eslint-import-resolver-typescript": "^3.2.5", "eslint-plugin-cypress": "^2.12.1", "eslint-plugin-import": "^2.25.3", "eslint-plugin-jsx-a11y": "^6.5.1", - "eslint-plugin-prettier": "^4.2.1", + "eslint-plugin-no-null": "^1.0.2", + "eslint-plugin-ordered-imports": "^0.6.0", "eslint-plugin-react": "^7.28.0", "eslint-plugin-react-hooks": "^4.3.0", "file-loader": "^6.2.0", @@ -140,7 +137,6 @@ "nyc": "^15.1.0", "postcss-loader": "^4.0.4", "postcss-scss": "^3.0.2", - "prettier": "^2.7.1", "pretty-quick": "^3.1.3", "resolve-url-loader": "^5.0.0", "sass-loader": "^13.1.0", @@ -148,7 +144,6 @@ "start-server-and-test": "^1.14.0", "style-loader": "^3.3.1", "systemjs-webpack-interop": "^2.3.7", - "tslint": "^6.1.3", "webpack": "^4.41.2", "webpack-cli": "^4.10.0", "webpack-config-single-spa-react": "^4.0.3", diff --git a/src-ts/.eslintrc.js b/src-ts/.eslintrc.js index 9315f381b..fc05be142 100644 --- a/src-ts/.eslintrc.js +++ b/src-ts/.eslintrc.js @@ -8,37 +8,39 @@ module.exports = { 'plugin:react/recommended', 'airbnb', 'plugin:@typescript-eslint/recommended', - 'prettier' + 'plugin:ordered-imports/recommended' ], parser: '@typescript-eslint/parser', parserOptions: { useJSXTextNode: true, - project: "./tsconfig.json", - tsconfigRootDir: ".", + project: './tsconfig.json', + tsconfigRootDir: '.', tsx: true, jsx: true, sourceType: 'module', }, plugins: [ - 'react', '@typescript-eslint', - 'react-hooks', + 'no-null', + 'ordered-imports', + 'react', + 'react-hooks' ], settings: { react: { - "version": "detect" + 'version': 'detect' }, - "import/resolver": { + 'import/resolver': { typescript: {}, } }, rules: { - "@typescript-eslint/ban-types": [ - "error", + '@typescript-eslint/ban-types': [ + 'error', { - "extendDefaults": true, - "types": { - "{}": false + 'extendDefaults': true, + 'types': { + '{}': false } } ], @@ -46,15 +48,25 @@ module.exports = { '@typescript-eslint/no-explicit-any': 'error', '@typescript-eslint/no-inferrable-types': 'off', '@typescript-eslint/no-shadow': 'error', + '@typescript-eslint/no-unused-vars': 'error', '@typescript-eslint/strict-boolean-expressions': [ 'error', { + allowAny: true, allowNullableBoolean: true, allowNullableObject: true, allowNullableNumber: true, allowNullableString: true } ], + 'arrow-parens': [ + 'error', + 'as-needed' + ], + 'complexity': [ + 'error', + 7 + ], 'import/extensions': 'off', 'import/prefer-default-export': 'off', 'indent': [ @@ -64,10 +76,15 @@ module.exports = { SwitchCase: 1, }, ], + 'jsx-quotes': [ + 'error', + 'prefer-single' + ], 'jsx-a11y/tabindex-no-positive': [ 'warn' ], - 'no-extra-boolean-cast': "off", + 'no-extra-boolean-cast': 'off', + 'no-null/no-null': 'error', 'no-plusplus': [ 'error', { @@ -87,7 +104,56 @@ module.exports = { functions: false, } ], - "padding-line-between-statements": [ + 'object-curly-newline': 'off', + 'operator-linebreak': [ + 'error', + 'before' + ], + 'ordered-imports/ordered-imports': [ + 'error', + { + 'symbols-first': true, + 'declaration-ordering': [ + 'type', { + ordering: [ + 'namespace', + 'destructured', + 'default', + 'side-effect', + ], + secondaryOrdering: [ + 'name', + 'lowercase-last' + ], + } + ], + 'specifier-ordering': 'case-insensitive', + 'group-ordering': [ + { + name: 'project root', + match: '^@', + order: 20 + }, + { + name: 'parent directories', + match: '^\\.\\.', + order: 30 + }, + { + name: 'current directory', + match: '^\\.', + order: 40 + }, + { + name: 'third-party', + match: '.*', + order: 10 + }, + ], + }, + ], + 'padded-blocks': 'off', + 'padding-line-between-statements': [ 'error', { blankLine: 'always', prev: 'directive', next: '*' }, { blankLine: 'any', prev: 'directive', next: 'directive' }, @@ -139,5 +205,6 @@ module.exports = { 'error', 'never', ], + 'sort-keys': 'error' }, }; diff --git a/src-ts/.prettierrc.js b/src-ts/.prettierrc.js deleted file mode 100755 index 41ad4bd7c..000000000 --- a/src-ts/.prettierrc.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = { - arrowParens: 'avoid', - bracketSpacing: true, - jsxSingleQuote: true, - printWidth: 100, - semi: false, - singleQuote: true, - trailingComma: 'all', -} diff --git a/src-ts/header/Header.tsx b/src-ts/header/Header.tsx index bbdc7dd89..6957a7c05 100644 --- a/src-ts/header/Header.tsx +++ b/src-ts/header/Header.tsx @@ -1,9 +1,9 @@ import { FC } from 'react' -import styles from './Header.module.scss' import { Logo } from './logo' import { ToolSelectors } from './tool-selectors' import { UtilitySelectors } from './utility-selectors' +import styles from './Header.module.scss' const Header: FC<{}> = () => (
diff --git a/src-ts/header/tool-selectors/ToolSelectors.tsx b/src-ts/header/tool-selectors/ToolSelectors.tsx index 1af86631f..12280cf7f 100644 --- a/src-ts/header/tool-selectors/ToolSelectors.tsx +++ b/src-ts/header/tool-selectors/ToolSelectors.tsx @@ -7,6 +7,9 @@ interface ToolSelectorsProps { isWide: boolean } -const ToolSelectors: FC = (props: ToolSelectorsProps) => props.isWide ? : +const ToolSelectors: FC + = (props: ToolSelectorsProps) => (props.isWide + ? + : ) export default ToolSelectors diff --git a/src-ts/header/tool-selectors/tool-selectors-narrow/ToolSelectorsNarrow.tsx b/src-ts/header/tool-selectors/tool-selectors-narrow/ToolSelectorsNarrow.tsx index 0e7c67021..318c6dd7e 100644 --- a/src-ts/header/tool-selectors/tool-selectors-narrow/ToolSelectorsNarrow.tsx +++ b/src-ts/header/tool-selectors/tool-selectors-narrow/ToolSelectorsNarrow.tsx @@ -1,5 +1,5 @@ -import classNames from 'classnames' import { Dispatch, FC, SetStateAction, useContext, useState } from 'react' +import classNames from 'classnames' import { IconOutline, routeContext, RouteContextData } from '../../../lib' diff --git a/src-ts/header/tool-selectors/tool-selectors-narrow/tool-selector-narrow/ToolSelectorNarrow.tsx b/src-ts/header/tool-selectors/tool-selectors-narrow/tool-selector-narrow/ToolSelectorNarrow.tsx index ea6454925..502af89cc 100644 --- a/src-ts/header/tool-selectors/tool-selectors-narrow/tool-selector-narrow/ToolSelectorNarrow.tsx +++ b/src-ts/header/tool-selectors/tool-selectors-narrow/tool-selector-narrow/ToolSelectorNarrow.tsx @@ -1,6 +1,6 @@ -import classNames from 'classnames' import { FC, useContext } from 'react' import { Link, useLocation } from 'react-router-dom' +import classNames from 'classnames' import { IconOutline, PlatformRoute, routeContext, RouteContextData, routeIsActiveTool } from '../../../../lib' diff --git a/src-ts/header/tool-selectors/tool-selectors-wide/tool-selector-wide/ToolSelectorWide.tsx b/src-ts/header/tool-selectors/tool-selectors-wide/tool-selector-wide/ToolSelectorWide.tsx index f87c68723..33ec2ae48 100644 --- a/src-ts/header/tool-selectors/tool-selectors-wide/tool-selector-wide/ToolSelectorWide.tsx +++ b/src-ts/header/tool-selectors/tool-selectors-wide/tool-selector-wide/ToolSelectorWide.tsx @@ -1,6 +1,6 @@ -import classNames from 'classnames' import { FC, useContext } from 'react' import { Link, useLocation } from 'react-router-dom' +import classNames from 'classnames' import { PlatformRoute, @@ -37,8 +37,9 @@ const ToolSelectorWide: FC = (props: ToolSelectorWideProp
+ isLink ? styles['tool-selector-wide-is-link'] : undefined, + )} + > = (props: BreadcrumbProps) => { return <> } - return createPortal(( -
- +
+ ), portalRootEl, + ) } export default Breadcrumb diff --git a/src-ts/lib/breadcrumb/breadcrumb-item/BreadcrumbItem.tsx b/src-ts/lib/breadcrumb/breadcrumb-item/BreadcrumbItem.tsx index 41401ddb3..43e43a236 100644 --- a/src-ts/lib/breadcrumb/breadcrumb-item/BreadcrumbItem.tsx +++ b/src-ts/lib/breadcrumb/breadcrumb-item/BreadcrumbItem.tsx @@ -1,7 +1,8 @@ import { FC } from 'react' import { Link } from 'react-router-dom' -import styles from "../Breadcrumb.module.scss" +import styles from '../Breadcrumb.module.scss' + import { BreadcrumbItemModel } from './breadcrumb-item.model' interface BreadcrumbItemProps { diff --git a/src-ts/lib/button/Button.tsx b/src-ts/lib/button/Button.tsx index 8703cd7d4..e465f0696 100644 --- a/src-ts/lib/button/Button.tsx +++ b/src-ts/lib/button/Button.tsx @@ -1,9 +1,9 @@ -import classNames from 'classnames' import { FC, SVGProps } from 'react' import { Link } from 'react-router-dom' +import classNames from 'classnames' -import '../styles/index.scss' import { IconOutline } from '../svgs' +import '../styles/index.scss' export type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' export type ButtonStyle = 'icon' | 'icon-bordered' | 'link' | 'primary' | 'secondary' | 'tertiary' | 'text' diff --git a/src-ts/lib/button/index.ts b/src-ts/lib/button/index.ts index 4d9c7c186..6d350516a 100644 --- a/src-ts/lib/button/index.ts +++ b/src-ts/lib/button/index.ts @@ -1,11 +1,5 @@ export { default as Button } from './Button' export { type ButtonProps } from './Button' -export -// tslint:disable-next-line: no-unused-expression -type { ButtonSize } from './Button' -export -// tslint:disable-next-line: no-unused-expression -type { ButtonStyle } from './Button' -export -// tslint:disable-next-line: no-unused-expression -type { ButtonType } from './Button' +export { type ButtonSize } from './Button' +export { type ButtonStyle } from './Button' +export { type ButtonType } from './Button' diff --git a/src-ts/lib/card/Card.tsx b/src-ts/lib/card/Card.tsx index b8333d8a3..c765dec0e 100644 --- a/src-ts/lib/card/Card.tsx +++ b/src-ts/lib/card/Card.tsx @@ -1,5 +1,5 @@ -import classNames from 'classnames' import { FC, ReactNode, SVGProps } from 'react' +import classNames from 'classnames' import { ButtonStyle } from '../button' import '../styles/index.scss' diff --git a/src-ts/lib/contact-support-form/ContactSupportForm.tsx b/src-ts/lib/contact-support-form/ContactSupportForm.tsx index 68a8cac0f..6a4c92470 100644 --- a/src-ts/lib/contact-support-form/ContactSupportForm.tsx +++ b/src-ts/lib/contact-support-form/ContactSupportForm.tsx @@ -54,7 +54,9 @@ const ContactSupportForm: FC = (props: ContactSupportFo const emailElement: JSX.Element | undefined = !!profile?.email ? ( <> -  at {profile.email} +  at + {' '} + {profile.email} ) : undefined @@ -64,7 +66,10 @@ const ContactSupportForm: FC = (props: ContactSupportFo

- Hi {profile?.firstName || 'there'}, we're here to help. + Hi + {' '} + {profile?.firstName || 'there'} + , we're here to help.

Please describe what you'd like to discuss, and a diff --git a/src-ts/lib/content-layout/ContentLayout.tsx b/src-ts/lib/content-layout/ContentLayout.tsx index 0a56dcd51..2bedc0ac1 100644 --- a/src-ts/lib/content-layout/ContentLayout.tsx +++ b/src-ts/lib/content-layout/ContentLayout.tsx @@ -1,5 +1,5 @@ -import classNames from 'classnames' import { FC, ReactNode } from 'react' +import classNames from 'classnames' import { Button, ButtonProps } from '../button' import '../styles/index.scss' diff --git a/src-ts/lib/form/Form.tsx b/src-ts/lib/form/Form.tsx index afbc7b36e..857c9b766 100644 --- a/src-ts/lib/form/Form.tsx +++ b/src-ts/lib/form/Form.tsx @@ -1,4 +1,3 @@ -import classNames from 'classnames' import { ChangeEvent, createRef, @@ -10,10 +9,11 @@ import { useEffect, useState, } from 'react' +import classNames from 'classnames' import { Button } from '../button' -import '../styles/index.scss' import { IconOutline } from '../svgs' +import '../styles/index.scss' import { FormAction, FormButton, FormDefinition, FormInputModel } from '.' import { @@ -145,7 +145,7 @@ const Form: (props: FormProps FormButton = (button) => { + const setOnClickOnReset: (button: FormButton) => FormButton = button => { // if this is a reset button, set its onclick to reset if (!!button.isReset) { button = { @@ -193,7 +193,7 @@ const Form: (props: FormProps( formValue: T, save: (value: T) => Promise, onSuccess?: () => void, - customValidateForm?: (formElements: HTMLFormControlsCollection, event: ValidationEvent, inputs: ReadonlyArray) => boolean + customValidateForm?: (formElements: HTMLFormControlsCollection, event: ValidationEvent, inputs: ReadonlyArray) => boolean, ): Promise { event.preventDefault() @@ -94,7 +94,7 @@ export async function onSubmitAsync( // set the properties for the updated T value inputs - .forEach((field) => { + .forEach(field => { (formValue as any)[field.name] = field.value }) @@ -186,7 +186,7 @@ function validateField(formInputDef: FormInputModel, formElements: HTMLFormContr }) } -export type ValidationEvent = 'blur' | 'change' | 'submit' | 'initial' +export type ValidationEvent = 'blur' | 'change' | 'submit' | 'initial' export function validateForm(formElements: HTMLFormControlsCollection, event: ValidationEvent, inputs: ReadonlyArray): boolean { const errors: ReadonlyArray = inputs?.filter(formInputDef => { diff --git a/src-ts/lib/form/form-groups/FormGroups.tsx b/src-ts/lib/form/form-groups/FormGroups.tsx index 89172f939..00a23d054 100644 --- a/src-ts/lib/form/form-groups/FormGroups.tsx +++ b/src-ts/lib/form/form-groups/FormGroups.tsx @@ -6,10 +6,10 @@ import { FormGroup } from '../form-group.model' import { FormInputModel } from '../form-input.model' import { FormCardSet } from './form-card-set' -import FormGroupItem from './form-group-item/FormGroupItem' import { InputImagePicker, InputRating, InputText, InputTextarea } from './form-input' import { FormInputRow } from './form-input-row' import { InputTextTypes } from './form-input/input-text/InputText' +import FormGroupItem from './form-group-item/FormGroupItem' import FormRadio from './form-radio' import styles from './FormGroups.module.scss' @@ -35,7 +35,6 @@ const FormGroups: (props: FormGroupsProps) => JSX.Element = (props: FormGroupsPr let inputElement: JSX.Element - /* tslint:disable:cyclomatic-complexity */ switch (input.type) { case 'rating': diff --git a/src-ts/lib/form/form-groups/form-card-set/FormCardSet.tsx b/src-ts/lib/form/form-groups/form-card-set/FormCardSet.tsx index f0bbaad1f..9da8a4824 100644 --- a/src-ts/lib/form/form-groups/form-card-set/FormCardSet.tsx +++ b/src-ts/lib/form/form-groups/form-card-set/FormCardSet.tsx @@ -1,7 +1,7 @@ -import cn from 'classnames' import React, { FocusEvent, SVGProps } from 'react' +import cn from 'classnames' -import { Button, IconCheck, IconOutline, IconSolid, textFormatMoneyLocaleString, Tooltip, useCheckIsMobile } from "../../.." +import { Button, IconCheck, IconOutline, IconSolid, textFormatMoneyLocaleString, Tooltip, useCheckIsMobile } from '../../..' import { FormCard, FormInputModel } from '../../form-input.model' import styles from './FormCardSet.module.scss' @@ -25,7 +25,7 @@ const FormCardSet: React.FC = ({ name, cards, onChange, value const getButton: (card: FormCard, selected: boolean) => JSX.Element = (card, selected) => (

-) - -export default GetStartedCardsContainer +import { FC } from 'react' + +import { Button } from '../../../../../../../lib' +import { ApiCornerIcon, ApiIcon, CommunityAppCornerIcon, CommunityAppIcon } from '../../../../../assets/i' +import { DevCenterCard } from '../../dev-center-card' + +import styles from './GetStartedCardsContainer.module.scss' + +const GetStartedCardsContainer: FC = () => ( +
+ } + icon={} + title='Community App' + titleClass={styles.communityTitle} + description='Learn about Topcoder Community App and run started code.' + button={
+) + +export default GetStartedCardsContainer diff --git a/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-get-started/GetStartedCardsContainer/index.tsx b/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-get-started/GetStartedCardsContainer/index.tsx index 046aded7b..e56ed178a 100644 --- a/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-get-started/GetStartedCardsContainer/index.tsx +++ b/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-get-started/GetStartedCardsContainer/index.tsx @@ -1 +1 @@ -export { default as GetStartedCardsContainer } from './GetStartedCardsContainer' +export { default as GetStartedCardsContainer } from './GetStartedCardsContainer' diff --git a/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-get-started/index.tsx b/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-get-started/index.tsx index 7d7e5a09a..4bf7e5464 100644 --- a/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-get-started/index.tsx +++ b/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-get-started/index.tsx @@ -1 +1 @@ -export { default as DevCenterGetStarted } from './DevCenterGetStarted' +export { default as DevCenterGetStarted } from './DevCenterGetStarted' diff --git a/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-header/DevCenterCarousel/DevCenterCarousel.tsx b/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-header/DevCenterCarousel/DevCenterCarousel.tsx index 97480191d..7a5c4efd6 100644 --- a/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-header/DevCenterCarousel/DevCenterCarousel.tsx +++ b/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-header/DevCenterCarousel/DevCenterCarousel.tsx @@ -1,22 +1,22 @@ -import { FC } from 'react' -import Carousel from 'react-elastic-carousel' - -import { CarouselContent } from '../carousel-content.config' -import { DevCenterCarouselItem } from '../DevCenterCarouselItem' - -import './carouselStyle.css' -import styles from './DevCenterCarousel.module.scss' - -const DevCenterCarousel: FC = () => ( -
- - {CarouselContent.map((item, key) => )} - -
-) - -export default DevCenterCarousel +import { FC } from 'react' +import Carousel from 'react-elastic-carousel' + +import { CarouselContent } from '../carousel-content.config' +import { DevCenterCarouselItem } from '../DevCenterCarouselItem' + +import styles from './DevCenterCarousel.module.scss' +import './carouselStyle.css' + +const DevCenterCarousel: FC = () => ( +
+ + {CarouselContent.map((item, key) => )} + +
+) + +export default DevCenterCarousel diff --git a/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-header/DevCenterCarousel/index.tsx b/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-header/DevCenterCarousel/index.tsx index d71748fa1..51e7f3f46 100644 --- a/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-header/DevCenterCarousel/index.tsx +++ b/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-header/DevCenterCarousel/index.tsx @@ -1 +1 @@ -export { default as DevCenterCarousel } from './DevCenterCarousel' +export { default as DevCenterCarousel } from './DevCenterCarousel' diff --git a/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-header/DevCenterCarouselItem/DevCenterCarouselItem.tsx b/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-header/DevCenterCarouselItem/DevCenterCarouselItem.tsx index 9db235e7d..cc1843386 100644 --- a/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-header/DevCenterCarouselItem/DevCenterCarouselItem.tsx +++ b/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-header/DevCenterCarouselItem/DevCenterCarouselItem.tsx @@ -1,20 +1,20 @@ -import classNames from 'classnames' -import React, {FC} from 'react' - -import { DevCenterTag } from '../../dev-center-tag' -import { CarouselItem } from '../carousel-content.config' - -import styles from './DevCenterCarouselItem.module.scss' - -const DevCenterCarouselItem: FC<{ item: CarouselItem }> = ({item}) => ( -
-
- {item.isNewFeature && } -

{item.headline}

- {item.summary} -
- -
-) - -export default DevCenterCarouselItem +import React, { FC } from 'react' +import classNames from 'classnames' + +import { DevCenterTag } from '../../dev-center-tag' +import { CarouselItem } from '../carousel-content.config' + +import styles from './DevCenterCarouselItem.module.scss' + +const DevCenterCarouselItem: FC<{ item: CarouselItem }> = ({ item }) => ( +
+
+ {item.isNewFeature && } +

{item.headline}

+ {item.summary} +
+ +
+) + +export default DevCenterCarouselItem diff --git a/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-header/DevCenterCarouselItem/index.tsx b/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-header/DevCenterCarouselItem/index.tsx index a3575ed8a..5a5c2b01f 100644 --- a/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-header/DevCenterCarouselItem/index.tsx +++ b/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-header/DevCenterCarouselItem/index.tsx @@ -1 +1 @@ -export {default as DevCenterCarouselItem} from './DevCenterCarouselItem' +export { default as DevCenterCarouselItem } from './DevCenterCarouselItem' diff --git a/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-header/DevCenterHeader.tsx b/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-header/DevCenterHeader.tsx index e5103b0f0..1ccdf3fbe 100644 --- a/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-header/DevCenterHeader.tsx +++ b/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-header/DevCenterHeader.tsx @@ -1,5 +1,5 @@ -import classNames from 'classnames' import { FC } from 'react' +import classNames from 'classnames' import { ContentLayout } from '../../../../../../lib' @@ -12,16 +12,19 @@ const DevCenterHeader: FC<{}> = () => (

- TopCoder
+ TopCoder + {' '} +
Developer Center

Let's build together with millions of Topcoder developers around the world.
- +
-
) +
+) export default DevCenterHeader diff --git a/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-header/index.tsx b/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-header/index.tsx index d9a2d51dc..0a7fb9ee1 100644 --- a/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-header/index.tsx +++ b/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-header/index.tsx @@ -1 +1 @@ -export { default as DevCenterHeader } from './DevCenterHeader' +export { default as DevCenterHeader } from './DevCenterHeader' diff --git a/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-tag/DevCenterTag.tsx b/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-tag/DevCenterTag.tsx index 498729c1c..fd220293c 100644 --- a/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-tag/DevCenterTag.tsx +++ b/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-tag/DevCenterTag.tsx @@ -1,16 +1,16 @@ -import classNames from 'classnames' -import { FC } from 'react' - -import styles from './DevCenterTag.module.scss' - -interface TagProps { - text: string -} - -const DevCenterTag: FC = ({ text }) => ( -
- {text} -
-) - -export default DevCenterTag +import { FC } from 'react' +import classNames from 'classnames' + +import styles from './DevCenterTag.module.scss' + +interface TagProps { + text: string +} + +const DevCenterTag: FC = ({ text }) => ( +
+ {text} +
+) + +export default DevCenterTag diff --git a/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-tag/index.tsx b/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-tag/index.tsx index b421408d9..db27f6da0 100644 --- a/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-tag/index.tsx +++ b/src-ts/tools/dev-center/dev-center-pages/community-app/landing-page/dev-center-tag/index.tsx @@ -1 +1 @@ -export { default as DevCenterTag } from './DevCenterTag' +export { default as DevCenterTag } from './DevCenterTag' diff --git a/src-ts/tools/gamification-admin/GamificationAdmin.tsx b/src-ts/tools/gamification-admin/GamificationAdmin.tsx index 3d85c3598..841ebb412 100644 --- a/src-ts/tools/gamification-admin/GamificationAdmin.tsx +++ b/src-ts/tools/gamification-admin/GamificationAdmin.tsx @@ -17,7 +17,7 @@ const GamificationAdmin: FC<{}> = () => { return ( xhrGetAsync(resource), + fetcher: resource => xhrGetAsync(resource), refreshInterval: 60000, // 1 min }} > diff --git a/src-ts/tools/gamification-admin/game-lib/modals/badge-activated-modal/BadgeActivatedModal.tsx b/src-ts/tools/gamification-admin/game-lib/modals/badge-activated-modal/BadgeActivatedModal.tsx index 123e04da9..7c670c8dd 100644 --- a/src-ts/tools/gamification-admin/game-lib/modals/badge-activated-modal/BadgeActivatedModal.tsx +++ b/src-ts/tools/gamification-admin/game-lib/modals/badge-activated-modal/BadgeActivatedModal.tsx @@ -24,7 +24,7 @@ const BadgeActivatedModal: FC = (props: BadgeActivated onClose={onClose} open={props.isOpen} size='md' - title="Badge updated" + title='Badge updated' closeOnOverlayClick={false} >
@@ -34,7 +34,14 @@ const BadgeActivatedModal: FC = (props: BadgeActivated className={styles[props.badge.active ? 'badge-image' : 'badge-image-disabled']} src={props.badge.badge_image_url} /> -

{props.badge.badge_name} badge has been sucessfully {props.badge.active ? 'activated' : 'deactivated'}.

+

+ {props.badge.badge_name} + {' '} + badge has been sucessfully + {' '} + {props.badge.active ? 'activated' : 'deactivated'} + . +

{ diff --git a/src-ts/tools/gamification-admin/game-lib/modals/badge-assigned-modal/BadgeAssignedModal.tsx b/src-ts/tools/gamification-admin/game-lib/modals/badge-assigned-modal/BadgeAssignedModal.tsx index 3e65d3ce6..b05a0a075 100644 --- a/src-ts/tools/gamification-admin/game-lib/modals/badge-assigned-modal/BadgeAssignedModal.tsx +++ b/src-ts/tools/gamification-admin/game-lib/modals/badge-assigned-modal/BadgeAssignedModal.tsx @@ -24,7 +24,7 @@ const BadgeAssignedModal: FC = (props: BadgeAssignedMod onClose={onClose} open={props.isOpen} size='md' - title="Badge awarded" + title='Badge awarded' closeOnOverlayClick={false} >
@@ -34,7 +34,11 @@ const BadgeAssignedModal: FC = (props: BadgeAssignedMod className={styles[props.badge.active ? 'badge-image' : 'badge-image-disabled']} src={props.badge.badge_image_url} /> -

{props.badge.badge_name} badge has been sucessfully awarded.

+

+ {props.badge.badge_name} + {' '} + badge has been sucessfully awarded. +

{ diff --git a/src-ts/tools/gamification-admin/game-lib/modals/badge-created-modal/BadgeCreatedModal.tsx b/src-ts/tools/gamification-admin/game-lib/modals/badge-created-modal/BadgeCreatedModal.tsx index caf749c73..fb72f0070 100644 --- a/src-ts/tools/gamification-admin/game-lib/modals/badge-created-modal/BadgeCreatedModal.tsx +++ b/src-ts/tools/gamification-admin/game-lib/modals/badge-created-modal/BadgeCreatedModal.tsx @@ -25,7 +25,7 @@ const BadgeCreatedModal: FC = (props: BadgeCreatedModalP onClose={onClose} open={props.isOpen} size='md' - title="Badge created" + title='Badge created' closeOnOverlayClick={false} >
@@ -35,7 +35,11 @@ const BadgeCreatedModal: FC = (props: BadgeCreatedModalP className={styles[props.badge.active ? 'badge-image' : 'badge-image-disabled']} src={props.badge.badge_image_url} /> -

{props.badge.badge_name} badge has been sucessfully created.

+

+ {props.badge.badge_name} + {' '} + badge has been sucessfully created. +

{ diff --git a/src-ts/tools/gamification-admin/pages/badge-detail/AwardedMembersTab/awarded-members-table/member-action-renderer/MemberActionRenderer.tsx b/src-ts/tools/gamification-admin/pages/badge-detail/AwardedMembersTab/awarded-members-table/member-action-renderer/MemberActionRenderer.tsx index dd096fb31..7ad6a4543 100644 --- a/src-ts/tools/gamification-admin/pages/badge-detail/AwardedMembersTab/awarded-members-table/member-action-renderer/MemberActionRenderer.tsx +++ b/src-ts/tools/gamification-admin/pages/badge-detail/AwardedMembersTab/awarded-members-table/member-action-renderer/MemberActionRenderer.tsx @@ -4,7 +4,7 @@ import { MemberBadgeAward } from '../../../../../game-lib' import styles from './MemberActionRenderer.module.scss' -const MemberActionRenderer = (memberAward: MemberBadgeAward): JSX.Element => +const MemberActionRenderer = (memberAward: MemberBadgeAward): JSX.Element => // const isMobile: boolean = useCheckIsMobile() @@ -40,5 +40,4 @@ const MemberActionRenderer = (memberAward: MemberBadgeAward): JSX.Element =>
) - export default MemberActionRenderer diff --git a/src-ts/tools/gamification-admin/pages/badge-detail/BadgeDetailPage.tsx b/src-ts/tools/gamification-admin/pages/badge-detail/BadgeDetailPage.tsx index 042f93e17..0cef271f7 100644 --- a/src-ts/tools/gamification-admin/pages/badge-detail/BadgeDetailPage.tsx +++ b/src-ts/tools/gamification-admin/pages/badge-detail/BadgeDetailPage.tsx @@ -1,13 +1,12 @@ import { noop, trim } from 'lodash' -import MarkdownIt from 'markdown-it' import { ChangeEvent, createRef, Dispatch, FC, KeyboardEvent, RefObject, SetStateAction, useEffect, useState } from 'react' -import ContentEditable from 'react-contenteditable' import { Params, useLocation, useParams } from 'react-router-dom' import { toast } from 'react-toastify' -import sanitizeHtml from 'sanitize-html' import { KeyedMutator, useSWRConfig } from 'swr' -// tslint:disable-next-line: no-submodule-imports import { FullConfiguration } from 'swr/dist/types' +import ContentEditable from 'react-contenteditable' +import MarkdownIt from 'markdown-it' +import sanitizeHtml from 'sanitize-html' import { Breadcrumb, BreadcrumbItemModel, Button, ButtonProps, ContentLayout, IconOutline, IconSolid, LoadingSpinner, PageDivider, Sort, tableGetDefaultSort, TabsNavbar, TabsNavItem } from '../../../../lib' import { GamificationConfig } from '../../game-config' @@ -15,12 +14,12 @@ import { BadgeDetailPageHandler, GameBadge, useGamificationBreadcrumb, useGetGam import { BadgeActivatedModal } from '../../game-lib/modals/badge-activated-modal' import { badgeListingColumns } from '../badge-listing/badge-listing-table' -import AwardedMembersTab from './AwardedMembersTab/AwardedMembersTab' import { badgeDetailsTabs, BadgeDetailsTabViews } from './badge-details-tabs.config' import { submitRequestAsync as updateBadgeAsync } from './badge-details.functions' -import styles from './BadgeDetailPage.module.scss' +import AwardedMembersTab from './AwardedMembersTab/AwardedMembersTab' import BatchAwardTab from './BatchAwardTab/BatchAwardTab' import ManualAwardTab from './ManualAwardTab/ManualAwardTab' +import styles from './BadgeDetailPage.module.scss' const md: MarkdownIt = new MarkdownIt({ html: true, @@ -29,7 +28,6 @@ const md: MarkdownIt = new MarkdownIt({ // typographer: true, }) -/* tslint:disable:cyclomatic-complexity */ const BadgeDetailPage: FC = () => { const [headerButtonConfig, setHeaderButtonConfig]: [ ButtonProps | undefined, @@ -49,7 +47,7 @@ const BadgeDetailPage: FC = () => { const { hash }: { hash: string } = useLocation() const [activeTab, setActiveTab]: [string, Dispatch>] = useState( - hash === '#award' ? BadgeDetailsTabViews.manualAward : BadgeDetailsTabViews.awardedMembers + hash === '#award' ? BadgeDetailsTabViews.manualAward : BadgeDetailsTabViews.awardedMembers, ) const [tabs]: [ @@ -66,7 +64,7 @@ const BadgeDetailPage: FC = () => { const fileInputRef: RefObject = createRef() - // tslint:disable-next-line:no-null-keyword + // eslint-disable-next-line no-null/no-null const [newImageFile, setNewImageFile]: [FileList | null, Dispatch>] = useState(null) const [fileDataURL, setFileDataURL]: [string | undefined, Dispatch>] = useState() @@ -164,7 +162,7 @@ const BadgeDetailPage: FC = () => { setShowActivatedModal(true) onBadgeUpdated() }) - .catch((e) => alert(`onActivateBadge error: ${e.message}`)) + .catch(e => alert(`onActivateBadge error: ${e.message}`)) } function onDisableBadge(): void { @@ -180,7 +178,7 @@ const BadgeDetailPage: FC = () => { setShowActivatedModal(true) onBadgeUpdated() }) - .catch((e) => alert(`onDisableBadge error: ${e.message}`)) + .catch(e => alert(`onDisableBadge error: ${e.message}`)) } function onNameEditKeyDown(e: KeyboardEvent): void { @@ -280,21 +278,27 @@ const BadgeDetailPage: FC = () => { // default tab let activeTabElement: JSX.Element - = + = ( + + ) if (activeTab === BadgeDetailsTabViews.manualAward) { - activeTabElement = + activeTabElement = ( + + ) } if (activeTab === BadgeDetailsTabViews.batchAward) { - activeTabElement = + activeTabElement = ( + + ) } // show page loader if we fetching results @@ -322,10 +326,11 @@ const BadgeDetailPage: FC = () => { buttonStyle='icon' icon={IconOutline.PencilIcon} className={styles.filePickerPencil} - onClick={() => fileInputRef.current?.click()} /> + onClick={() => fileInputRef.current?.click()} + /> badge media preview { badgeNameErrorText ? setBadgeNameErrorText(undefined) : ''} + onChange={() => (badgeNameErrorText ? setBadgeNameErrorText(undefined) : '')} onKeyDown={onNameEditKeyDown} onBlur={onSaveBadgeName} onFocus={onBadgeNameEditFocus} className={styles.badgeName} /> { - badgeNameErrorText &&
- - {badgeNameErrorText} -
+ badgeNameErrorText && ( +
+ + {badgeNameErrorText} +
+ ) }
@@ -363,19 +370,21 @@ const BadgeDetailPage: FC = () => { className={isBadgeDescEditingMode ? styles.badgeEditableMode : styles.badgeEditable} /> { - isBadgeDescEditingMode &&
-
+ isBadgeDescEditingMode && ( +
+
+ ) }
@@ -391,12 +400,14 @@ const BadgeDetailPage: FC = () => { }
{ - badgeDetailsHandler.data && - setShowActivatedModal(false)} - badge={badgeDetailsHandler.data} - /> + badgeDetailsHandler.data + && ( + setShowActivatedModal(false)} + badge={badgeDetailsHandler.data} + /> + ) } ) diff --git a/src-ts/tools/gamification-admin/pages/badge-detail/BatchAwardTab/BatchAwardTab.tsx b/src-ts/tools/gamification-admin/pages/badge-detail/BatchAwardTab/BatchAwardTab.tsx index d2034f7a9..3e7284213 100644 --- a/src-ts/tools/gamification-admin/pages/badge-detail/BatchAwardTab/BatchAwardTab.tsx +++ b/src-ts/tools/gamification-admin/pages/badge-detail/BatchAwardTab/BatchAwardTab.tsx @@ -1,4 +1,3 @@ -// tslint:disable:no-null-keyword import { Dispatch, FC, SetStateAction, useState } from 'react' import { Button, IconSolid, InputFilePicker } from '../../../../../lib' @@ -17,6 +16,7 @@ const BatchAwardTab: FC = (props: BatchAwardTabProps) => { const [showBadgeAssigned, setShowBadgeAssigned]: [boolean, Dispatch>] = useState(false) + // eslint-disable-next-line no-null/no-null const [files, setFiles]: [FileList | null, Dispatch>] = useState(null) const [errorText, setErrorText]: [string, Dispatch>] = useState('') @@ -39,7 +39,7 @@ const BatchAwardTab: FC = (props: BatchAwardTabProps) => { .catch(e => { let message: string = e.message if (e.errors && e.errors[0] && e.errors[0].path === 'user_id') { - message = `CSV file contains duplicate data. There are members included already owning this badge.` + message = 'CSV file contains duplicate data. There are members included already owning this badge.' } setErrorText(message) @@ -52,7 +52,7 @@ const BatchAwardTab: FC = (props: BatchAwardTabProps) => {

If you would like to assign multiple people to multiple badges, this area is for you. Download the template below, populate the file with your data, and upload that file to the right once completed.

- Download template CSV + Download template CSV
= (props: BatchAwardTabProps) => {
{ - showBadgeAssigned && { - setShowBadgeAssigned(false) - props.onBatchAssign() - }} - /> + showBadgeAssigned && ( + { + setShowBadgeAssigned(false) + props.onBatchAssign() + }} + /> + ) }
) diff --git a/src-ts/tools/gamification-admin/pages/badge-detail/ManualAwardTab/ManualAwardTab.tsx b/src-ts/tools/gamification-admin/pages/badge-detail/ManualAwardTab/ManualAwardTab.tsx index 07b231680..1746ab419 100644 --- a/src-ts/tools/gamification-admin/pages/badge-detail/ManualAwardTab/ManualAwardTab.tsx +++ b/src-ts/tools/gamification-admin/pages/badge-detail/ManualAwardTab/ManualAwardTab.tsx @@ -26,7 +26,7 @@ const ManualAwardTab: FC = (props: ManualAwardTabProps) => function onAward(): void { const csv: string = generateCSV( - selectedMembers.map(m => [m.handle, props.badge?.id as string]) + selectedMembers.map(m => [m.handle, props.badge?.id as string]), ) setBadgeAssignError(undefined) manualAssignRequestAsync(csv) @@ -52,7 +52,7 @@ const ManualAwardTab: FC = (props: ManualAwardTabProps) =>

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Neque ullamcorper neque sed orci, enim amet, sed.

= (props: ManualAwardTabProps) =>
{ - showBadgeAssigned && { - setShowBadgeAssigned(false) - props.onManualAssign() - }} - /> + showBadgeAssigned && ( + { + setShowBadgeAssigned(false) + props.onManualAssign() + }} + /> + ) } ) diff --git a/src-ts/tools/gamification-admin/pages/badge-detail/update-badge.store.ts b/src-ts/tools/gamification-admin/pages/badge-detail/update-badge.store.ts index 1018837da..901871f13 100644 --- a/src-ts/tools/gamification-admin/pages/badge-detail/update-badge.store.ts +++ b/src-ts/tools/gamification-admin/pages/badge-detail/update-badge.store.ts @@ -18,9 +18,10 @@ export async function submitRequestAsync(request: UpdateBadgeRequest): Promise { /> { - createdBadge && { - setCreatedBadge(undefined) - setShowBadgeCreatedModal(false) - }} - /> + createdBadge && ( + { + setCreatedBadge(undefined) + setShowBadgeCreatedModal(false) + }} + /> + ) } ) diff --git a/src-ts/tools/gamification-admin/pages/create-badge/create-badge-form/create-badge-form.config.tsx b/src-ts/tools/gamification-admin/pages/create-badge/create-badge-form/create-badge-form.config.tsx index 6621857d8..caf809f86 100644 --- a/src-ts/tools/gamification-admin/pages/create-badge/create-badge-form/create-badge-form.config.tsx +++ b/src-ts/tools/gamification-admin/pages/create-badge/create-badge-form/create-badge-form.config.tsx @@ -15,7 +15,7 @@ export const createBadgeFormDef: FormDefinition = { buttonStyle: 'primary', isSubmit: true, label: 'Save Badge', - onClick: (e) => { }, + onClick: e => { }, size: 'lg', type: 'submit', }, diff --git a/src-ts/tools/index.ts b/src-ts/tools/index.ts index bf19d7574..720b2aeba 100644 --- a/src-ts/tools/index.ts +++ b/src-ts/tools/index.ts @@ -2,7 +2,7 @@ // EVENTUALLY, THE ONLY THINGS THAT SHOULD BE EXPORTED FROM THE // TOOLS ARE THE toolsRoutes and routeRoot*. export { learnRootRoute as routeRootMember } from './learn' -export { default as toolsRoutes, } from './tools.routes' +export { default as toolsRoutes } from './tools.routes' export { ChallengeMetadataName, dashboardRoute as routeRootCustomer, @@ -28,5 +28,5 @@ export { WorkTypeCategoryUnknownIcon, WorkTypeConfigs, BugHuntIntakeForm, - bugHuntRoute + bugHuntRoute, } from './work' diff --git a/src-ts/tools/learn/course-certificate/certificate-view/CertificateView.tsx b/src-ts/tools/learn/course-certificate/certificate-view/CertificateView.tsx index c849bded6..4961984bc 100644 --- a/src-ts/tools/learn/course-certificate/certificate-view/CertificateView.tsx +++ b/src-ts/tools/learn/course-certificate/certificate-view/CertificateView.tsx @@ -1,7 +1,7 @@ -import classNames from 'classnames' -import html2canvas from 'html2canvas' import { FC, MutableRefObject, useEffect, useMemo, useRef } from 'react' import { NavigateFunction, useNavigate } from 'react-router-dom' +import classNames from 'classnames' +import html2canvas from 'html2canvas' import { FacebookSocialShareBtn, @@ -10,7 +10,7 @@ import { LinkedinSocialShareBtn, LoadingSpinner, TwitterSocialShareBtn, - UserProfile + UserProfile, } from '../../../../lib' import { AllCertificationsProviderData, @@ -24,8 +24,8 @@ import { getCoursePath, getUserCertificateSsr } from '../../learn.routes' import { ActionButton } from './action-button' import { Certificate } from './certificate' -import styles from './CertificateView.module.scss' import { useCertificateScaling } from './use-certificate-scaling.hook' +import styles from './CertificateView.module.scss' export type CertificateViewStyle = 'large-container' | undefined @@ -47,8 +47,8 @@ const CertificateView: FC = (props: CertificateViewProps) const certificateWrapRef: MutableRefObject = useRef() const userName: string = useMemo(() => ( - [props.profile.firstName, props.profile.lastName].filter(Boolean).join(' ') || - props.profile.handle + [props.profile.firstName, props.profile.lastName].filter(Boolean).join(' ') + || props.profile.handle ), [props.profile.firstName, props.profile.handle, props.profile.lastName]) const { @@ -75,7 +75,7 @@ const CertificateView: FC = (props: CertificateViewProps) }: UserCompletedCertificationsProviderData = useUserCompletedCertifications( props.profile.userId, props.provider, - props.certification + props.certification, ) const hasCompletedTheCertification: boolean = !!completedCertificate @@ -85,7 +85,7 @@ const CertificateView: FC = (props: CertificateViewProps) }: AllCertificationsProviderData = useAllCertifications( props.provider, course?.certificationId, - { enabled: !!course?.certificationId } + { enabled: !!course?.certificationId }, ) const ready: boolean = useMemo(() => ( diff --git a/src-ts/tools/learn/course-certificate/certificate-view/certificate/Certificate.tsx b/src-ts/tools/learn/course-certificate/certificate-view/certificate/Certificate.tsx index f044c3995..2071dff61 100644 --- a/src-ts/tools/learn/course-certificate/certificate-view/certificate/Certificate.tsx +++ b/src-ts/tools/learn/course-certificate/certificate-view/certificate/Certificate.tsx @@ -1,15 +1,15 @@ -import classNames from 'classnames' import { FC, MutableRefObject } from 'react' +import classNames from 'classnames' import { LearnConfig } from '../../../learn-config' import { LearnCertificateTrackType } from '../../../learn-lib' import { CertificateBgPattern } from './certificate-bg-pattern' -import styles from './Certificate.module.scss' import { CourseCard } from './course-card' import { ReactComponent as TcAcademyLogoSvg } from './tc-academy-logo.svg' import { ReactComponent as TcLogoSvg } from './tc-logo.svg' import { ReactComponent as FccLogoSvg } from './vendor-fcc-logo.svg' +import styles from './Certificate.module.scss' interface CertificateProps { completedDate?: string @@ -71,7 +71,9 @@ const Certificate: FC = (props: CertificateProps) => {
- Course content provided by {props.provider} + Course content provided by + {' '} + {props.provider}
diff --git a/src-ts/tools/learn/course-certificate/certificate-view/certificate/certificate-bg-pattern/CertificateBgPattern.tsx b/src-ts/tools/learn/course-certificate/certificate-view/certificate/certificate-bg-pattern/CertificateBgPattern.tsx index 801a3c8d2..61c86af60 100644 --- a/src-ts/tools/learn/course-certificate/certificate-view/certificate/certificate-bg-pattern/CertificateBgPattern.tsx +++ b/src-ts/tools/learn/course-certificate/certificate-view/certificate/certificate-bg-pattern/CertificateBgPattern.tsx @@ -1,5 +1,5 @@ -import classNames from 'classnames' import { FC } from 'react' +import classNames from 'classnames' import { LearnCertificateTrackType } from '../../../../learn-lib' diff --git a/src-ts/tools/learn/course-certificate/certificate-view/certificate/course-card/CourseCard.tsx b/src-ts/tools/learn/course-certificate/certificate-view/certificate/course-card/CourseCard.tsx index 5cb12df83..75b93db0e 100644 --- a/src-ts/tools/learn/course-certificate/certificate-view/certificate/course-card/CourseCard.tsx +++ b/src-ts/tools/learn/course-certificate/certificate-view/certificate/course-card/CourseCard.tsx @@ -1,5 +1,5 @@ -import classNames from 'classnames' import { FC } from 'react' +import classNames from 'classnames' import { IconOutline, textFormatDateLocaleShortString } from '../../../../../../lib' import { CourseBadge, LearnCertificateTrackType } from '../../../../learn-lib' diff --git a/src-ts/tools/learn/course-certificate/certificate-view/use-certificate-scaling.hook.tsx b/src-ts/tools/learn/course-certificate/certificate-view/use-certificate-scaling.hook.tsx index f15ae3386..ac55ec2fc 100644 --- a/src-ts/tools/learn/course-certificate/certificate-view/use-certificate-scaling.hook.tsx +++ b/src-ts/tools/learn/course-certificate/certificate-view/use-certificate-scaling.hook.tsx @@ -14,7 +14,7 @@ export function useCertificateScaling(certificateRef?: MutableRefObject = () => { useEffect(() => { if (routeParams.memberHandle) { profileGetAsync(routeParams.memberHandle) - .then((userProfile) => { + .then(userProfile => { setProfile(userProfile) setProfileReady(true) }) diff --git a/src-ts/tools/learn/course-completed/CourseCompletedPage.tsx b/src-ts/tools/learn/course-completed/CourseCompletedPage.tsx index cfb81ec4d..884326bf8 100755 --- a/src-ts/tools/learn/course-completed/CourseCompletedPage.tsx +++ b/src-ts/tools/learn/course-completed/CourseCompletedPage.tsx @@ -8,7 +8,7 @@ import { Button, LoadingSpinner, profileContext, - ProfileContextData + ProfileContextData, } from '../../../lib' import { AllCertificationsProviderData, @@ -19,12 +19,12 @@ import { useLearnBreadcrumb, UserCertificationProgressProviderData, UserCertificationProgressStatus, - useUserCertificationProgress + useUserCertificationProgress, } from '../learn-lib' import { getCertificatePath, getCoursePath, LEARN_PATHS, rootRoute } from '../learn.routes' -import styles from './CourseCompletedPage.module.scss' import { ReactComponent as StarsSvg } from './stars.svg' +import styles from './CourseCompletedPage.module.scss' const CourseCompletedPage: FC<{}> = () => { @@ -46,7 +46,7 @@ const CourseCompletedPage: FC<{}> = () => { }: UserCertificationProgressProviderData = useUserCertificationProgress( profile?.userId, routeParams.provider, - routeParams.certification + routeParams.certification, ) const { @@ -56,7 +56,6 @@ const CourseCompletedPage: FC<{}> = () => { enabled: progressReady && !!progress, }) - /* tslint:disable:cyclomatic-complexity */ const isLoggedIn: boolean = profileReady && !!profile const certificatesDataReady: boolean = progressReady && certifReady const ready: boolean = profileReady && courseDataReady && (!isLoggedIn || certificatesDataReady) @@ -109,7 +108,10 @@ const CourseCompletedPage: FC<{}> = () => {

- Now that you have completed the {courseData.title}, + Now that you have completed the + {' '} + {courseData.title} + , take a look at our other Topcoder Academy courses. To view other courses, press the "Start a new course" button below.

diff --git a/src-ts/tools/learn/course-details/CourseDetailsPage.tsx b/src-ts/tools/learn/course-details/CourseDetailsPage.tsx index 6f2474bc7..356254c3b 100644 --- a/src-ts/tools/learn/course-details/CourseDetailsPage.tsx +++ b/src-ts/tools/learn/course-details/CourseDetailsPage.tsx @@ -21,13 +21,13 @@ import { UserCertificationProgressProviderData, UserCertificationProgressStatus, useResourceProvider, - useUserCertificationProgress + useUserCertificationProgress, } from '../learn-lib' import { getCoursePath } from '../learn.routes' import { CourseCurriculum } from './course-curriculum' -import styles from './CourseDetailsPage.module.scss' import { PromoCourse } from './promo-course' +import styles from './CourseDetailsPage.module.scss' const CourseDetailsPage: FC<{}> = () => { @@ -59,8 +59,6 @@ const CourseDetailsPage: FC<{}> = () => { enabled: courseReady, }) - // this looks better than finding workarounds for cyclomatic-complexity - /* tslint:disable:cyclomatic-complexity */ const ready: boolean = profileReady && courseReady && certificateReady && (!profile || progressReady) const breadcrumb: Array = useLearnBreadcrumb([ @@ -81,7 +79,10 @@ const CourseDetailsPage: FC<{}> = () => {

- Now that you have completed the {course.title}, + Now that you have completed the + {' '} + {course.title} + , we'd recommend you enroll in another course to continue your learning. You can view our other courses from the Topcoder Academy course page.

@@ -149,7 +150,11 @@ const CourseDetailsPage: FC<{}> = () => { return ( diff --git a/src-ts/tools/learn/course-details/course-curriculum/CourseCurriculum.tsx b/src-ts/tools/learn/course-details/course-curriculum/CourseCurriculum.tsx index ad8f795d9..1b8e80b6a 100644 --- a/src-ts/tools/learn/course-details/course-curriculum/CourseCurriculum.tsx +++ b/src-ts/tools/learn/course-details/course-curriculum/CourseCurriculum.tsx @@ -1,6 +1,6 @@ -import classNames from 'classnames' import { Dispatch, FC, SetStateAction, useCallback, useEffect, useState } from 'react' import { NavigateFunction, useNavigate, useSearchParams } from 'react-router-dom' +import classNames from 'classnames' import { Button, UserProfile } from '../../../../lib' import { @@ -13,7 +13,7 @@ import { userCertificationProgressStartAsync, UserCertificationProgressStatus, userCertificationProgressUpdateAsync, - UserCertificationUpdateProgressActions + UserCertificationUpdateProgressActions, } from '../../learn-lib' import { getAuthenticateAndStartCourseRoute, @@ -22,9 +22,9 @@ import { LEARN_PATHS, } from '../../learn.routes' -import styles from './CourseCurriculum.module.scss' import { CurriculumSummary } from './curriculum-summary' import { TcAcademyPolicyModal } from './tc-academy-policy-modal' +import styles from './CourseCurriculum.module.scss' interface CourseCurriculumProps { course: LearnCourse @@ -115,13 +115,13 @@ const CourseCurriculum: FC = (props: CourseCurriculumProp { lesson: props.course.modules[0].lessons[0].dashedName, module: props.course.modules[0].meta.dashedName, - } + }, ) } else { await userCertificationProgressUpdateAsync( props.progress.id, UserCertificationUpdateProgressActions.acceptHonestyPolicy, - {} + {}, ) } diff --git a/src-ts/tools/learn/course-details/course-curriculum/curriculum-summary/CurriculumSummary.tsx b/src-ts/tools/learn/course-details/course-curriculum/curriculum-summary/CurriculumSummary.tsx index db0febe9c..451ed3919 100644 --- a/src-ts/tools/learn/course-details/course-curriculum/curriculum-summary/CurriculumSummary.tsx +++ b/src-ts/tools/learn/course-details/course-curriculum/curriculum-summary/CurriculumSummary.tsx @@ -35,7 +35,8 @@ const CurriculumSummary: FC = (props: CurriculumSummaryP return ( <> - Completed{' '} + Completed + {' '} {textFormatDateLocaleShortString(new Date(props.completedDate))}

diff --git a/src-ts/tools/work/work-detail-solutions/work-solutions-list/WorkSolutionsList.tsx b/src-ts/tools/work/work-detail-solutions/work-solutions-list/WorkSolutionsList.tsx index 16ea0c9e3..6f4aa2ad6 100644 --- a/src-ts/tools/work/work-detail-solutions/work-solutions-list/WorkSolutionsList.tsx +++ b/src-ts/tools/work/work-detail-solutions/work-solutions-list/WorkSolutionsList.tsx @@ -1,5 +1,5 @@ -import moment from 'moment' import { FC } from 'react' +import moment from 'moment' import { Work, WorkSolution } from '../../work-lib' @@ -31,7 +31,7 @@ const WorkSolutionsList: FC = (props: WorkSolutionsListP return (
- {props.solutions.map((solution) => ( + {props.solutions.map(solution => ( ))}
diff --git a/src-ts/tools/work/work-detail-summary/WorkDetailProgress/WorkDetailProgress.tsx b/src-ts/tools/work/work-detail-summary/WorkDetailProgress/WorkDetailProgress.tsx index bf67e1c37..8e7853d4d 100644 --- a/src-ts/tools/work/work-detail-summary/WorkDetailProgress/WorkDetailProgress.tsx +++ b/src-ts/tools/work/work-detail-summary/WorkDetailProgress/WorkDetailProgress.tsx @@ -1,24 +1,24 @@ import { FC } from 'react' -import '../../../../lib/styles/index.scss' import { WorkProgress } from '../../work-lib' +import '../../../../lib/styles/index.scss' -import styles from './WorkDetailProgress.module.scss' import { WorkDetailProgressItem } from './WorkDetailProgressItem' +import styles from './WorkDetailProgress.module.scss' const WorkDetailProgress: FC = (props: WorkProgress) => { const { steps, activeStepIndex }: WorkProgress = props const progressItems: Array = steps - .map((item, index) => + .map((item, index) => ( - ) + )) return (
diff --git a/src-ts/tools/work/work-detail-summary/WorkDetailProgress/WorkDetailProgressItem/WorkDetailProgressItem.tsx b/src-ts/tools/work/work-detail-summary/WorkDetailProgress/WorkDetailProgressItem/WorkDetailProgressItem.tsx index b8cbdd68e..78d975f5a 100644 --- a/src-ts/tools/work/work-detail-summary/WorkDetailProgress/WorkDetailProgressItem/WorkDetailProgressItem.tsx +++ b/src-ts/tools/work/work-detail-summary/WorkDetailProgress/WorkDetailProgressItem/WorkDetailProgressItem.tsx @@ -1,5 +1,5 @@ -import classNames from 'classnames' import { FC } from 'react' +import classNames from 'classnames' import { textFormatDateLocaleShortString } from '../../../../../lib' import { WorkProgressStep } from '../../../work-lib' @@ -16,12 +16,12 @@ const WorkDetailProgressItem: FC = (props: WorkDeta function getClasses(): string { return classNames( props.currentIndex === props.activeStepIndex ? styles.select : undefined, - props.currentIndex < props.activeStepIndex ? styles.active : undefined + props.currentIndex < props.activeStepIndex ? styles.active : undefined, ) } return ( -
+
{props.currentIndex + 1} diff --git a/src-ts/tools/work/work-detail-summary/WorkTransferredStatus/WorkTransferredStatus.tsx b/src-ts/tools/work/work-detail-summary/WorkTransferredStatus/WorkTransferredStatus.tsx index 2bf989bbd..cd493e440 100644 --- a/src-ts/tools/work/work-detail-summary/WorkTransferredStatus/WorkTransferredStatus.tsx +++ b/src-ts/tools/work/work-detail-summary/WorkTransferredStatus/WorkTransferredStatus.tsx @@ -21,7 +21,8 @@ const WorkTransferredStatus: FC<{}> = () => (
- Thank you!
+ Thank you! +
The Topcoder Team

diff --git a/src-ts/tools/work/work-lib/work-provider/work-functions/work-factory/work-solution.model.ts b/src-ts/tools/work/work-lib/work-provider/work-functions/work-factory/work-solution.model.ts index 1b55f254f..0d54c37b4 100644 --- a/src-ts/tools/work/work-lib/work-provider/work-functions/work-factory/work-solution.model.ts +++ b/src-ts/tools/work/work-lib/work-provider/work-functions/work-factory/work-solution.model.ts @@ -1,4 +1,3 @@ - export interface WorkSolution { challengeId: number created: Date diff --git a/src-ts/tools/work/work-lib/work-provider/work-functions/work-factory/work.factory.ts b/src-ts/tools/work/work-lib/work-provider/work-functions/work-factory/work.factory.ts index fb872ca2b..83c41215a 100644 --- a/src-ts/tools/work/work-lib/work-provider/work-functions/work-factory/work.factory.ts +++ b/src-ts/tools/work/work-lib/work-provider/work-functions/work-factory/work.factory.ts @@ -146,7 +146,7 @@ export function buildUpdateRequest(workTypeConfig: WorkTypeConfig, challenge: Ch }, ] - Object.keys(formData).forEach((key) => { + Object.keys(formData).forEach(key => { intakeMetadata.push({ name: ChallengeMetadataName[key as keyof typeof ChallengeMetadataName], value: formData[key] || '', @@ -159,10 +159,10 @@ export function buildUpdateRequest(workTypeConfig: WorkTypeConfig, challenge: Ch const data: ReadonlyArray = mapFormData( type, - formData + formData, ) - data.forEach((formDetail) => { + data.forEach(formDetail => { if (Object.keys(formDetail).length <= 0) { return } const formattedValue: string = formatFormDataOption(formDetail.value) @@ -171,14 +171,14 @@ export function buildUpdateRequest(workTypeConfig: WorkTypeConfig, challenge: Ch if (getTypeCategory(type) === WorkTypeCategory.data) { templateString.push( - WorkStrings.MARKDOWN_SUBMISSION_GUIDELINES + WorkStrings.MARKDOWN_SUBMISSION_GUIDELINES, ) } // ---- End Build Markdown string ---- // // If the duration of the Submission phase depends on the package selected (i.e.: Bug Hunt), // then update the duration for that phase to the correct value - const timeline: Array = workTypeConfig.timeline.map((phase) => { + const timeline: Array = workTypeConfig.timeline.map(phase => { if (workTypeConfig.submissionPhaseDuration && phase.phaseId === WorkConfigConstants.PHASE_ID_SUBMISSION) { phase.duration = workTypeConfig.submissionPhaseDuration[formData[ChallengeMetadataName.packageType] as PricePackageName] || 0 } @@ -293,7 +293,7 @@ function buildFormDataBugHunt(formData: any): ReadonlyArray { { key: ChallengeMetadataName.deliveryType, title: ChallengeMetadataTitle.bugDeliveryType, - value: `${formData.deliveryType}${formData.repositoryLink ? `: ${ formData.repositoryLink}` : ''}`, + value: `${formData.deliveryType}${formData.repositoryLink ? `: ${formData.repositoryLink}` : ''}`, }, { key: ChallengeMetadataName.additionalInformation, @@ -331,11 +331,12 @@ function buildFormDataDesign(formData: any): ReadonlyArray { const styleInfo: {} = { Like: formData.likedStyles?.value?.join(', '), // Disabling lint error to maintain order for display - // tslint:disable-next-line: object-literal-sort-keys + /* eslint-disable sort-keys */ Dislike: formData.dislikedStyles?.value?.join(', '), 'Additional Details': formData.stylePreferences?.value, 'Color Selections': formData.colorOption?.value.join(', '), 'Specific Colors': formData.specificColor?.value, + /* eslint-enable sort-keys */ } return [ @@ -428,11 +429,11 @@ function buildFormDataProblem(formData: any): ReadonlyArray { */ function checkFormDataOptionEmpty(detail: any): boolean { return ( - !detail || - (typeof detail === 'string' && detail.trim().length === 0) || - (Array.isArray(detail) && detail.length === 0) || - (typeof detail === 'object' && - Object.values(detail).filter((val: any) => val && val.trim().length !== 0) + !detail + || (typeof detail === 'string' && detail.trim().length === 0) + || (Array.isArray(detail) && detail.length === 0) + || (typeof detail === 'object' + && Object.values(detail).filter((val: any) => val && val.trim().length !== 0) .length === 0) ) } diff --git a/src-ts/tools/work/work-lib/work-provider/work-functions/work-store/index.ts b/src-ts/tools/work/work-lib/work-provider/work-functions/work-store/index.ts index 7cb4aaa17..c1eb0294d 100644 --- a/src-ts/tools/work/work-lib/work-provider/work-functions/work-store/index.ts +++ b/src-ts/tools/work/work-lib/work-provider/work-functions/work-store/index.ts @@ -29,7 +29,7 @@ export * from './work-status.enum' export * from './work-timeline-phase.model' export { bugHuntConfig as workBugHuntConfig, - WorkTypeConfigs + WorkTypeConfigs, } from './work-type.config' export * from './work-type.enum' export * from './work-type.model' diff --git a/src-ts/tools/work/work-lib/work-provider/work-functions/work-store/work-prices.config.ts b/src-ts/tools/work/work-lib/work-provider/work-functions/work-store/work-prices.config.ts index 1c315b521..5934fc1ad 100644 --- a/src-ts/tools/work/work-lib/work-provider/work-functions/work-store/work-prices.config.ts +++ b/src-ts/tools/work/work-lib/work-provider/work-functions/work-store/work-prices.config.ts @@ -172,7 +172,7 @@ function getPrizeSets(priceConfig: WorkPrice, packageName?: PricePackageName | u const prizeSets: Array = [ { description: 'Challenge Prizes', - prizes: pricePackage.placementDistributions.map((percentage) => ({ + prizes: pricePackage.placementDistributions.map(percentage => ({ type: 'USD', value: Math.round(percentage * pricePackage.price), })), @@ -181,7 +181,7 @@ function getPrizeSets(priceConfig: WorkPrice, packageName?: PricePackageName | u { description: 'Reviewer Payment', prizes: - pricePackage.reviewerDistributions.map((percentage) => ({ + pricePackage.reviewerDistributions.map(percentage => ({ type: 'USD', value: Math.round(percentage * pricePackage.price), })), @@ -189,7 +189,7 @@ function getPrizeSets(priceConfig: WorkPrice, packageName?: PricePackageName | u }, { description: 'Copilot Prizes', - prizes: pricePackage.copilotDistributions?.map((percentage) => ({ + prizes: pricePackage.copilotDistributions?.map(percentage => ({ type: 'USD', value: Math.round(percentage * pricePackage.price), })), @@ -197,5 +197,5 @@ function getPrizeSets(priceConfig: WorkPrice, packageName?: PricePackageName | u }, ] - return prizeSets.filter((set) => set.prizes.length) + return prizeSets.filter(set => set.prizes.length) } diff --git a/src-ts/tools/work/work-lib/work-provider/work-functions/work-store/work-progress.model.ts b/src-ts/tools/work/work-lib/work-provider/work-functions/work-store/work-progress.model.ts index 9cd10de19..537d30ce9 100644 --- a/src-ts/tools/work/work-lib/work-provider/work-functions/work-store/work-progress.model.ts +++ b/src-ts/tools/work/work-lib/work-provider/work-functions/work-store/work-progress.model.ts @@ -1,6 +1,6 @@ import { WorkProgressStep } from './work-progress-step.model' -export interface WorkProgress { +export interface WorkProgress { activeStepIndex: number steps: ReadonlyArray } diff --git a/src-ts/tools/work/work-lib/work-provider/work-functions/work-store/work-type.config.ts b/src-ts/tools/work/work-lib/work-provider/work-functions/work-store/work-type.config.ts index eddfb209a..f330d6fe2 100644 --- a/src-ts/tools/work/work-lib/work-provider/work-functions/work-store/work-type.config.ts +++ b/src-ts/tools/work/work-lib/work-provider/work-functions/work-store/work-type.config.ts @@ -10,21 +10,21 @@ import { WorkTypeConfig } from './work-type.model' export const WorkTypeConfigs: { [workType: string]: WorkTypeConfig } = { // TODO: Verify timelineTemplateId, trackId, typeId [WorkType.bugHunt]: { - about: `Expert QA testers will verify that all of the pages on your website are working correctly from the end-user perspective. The testing will stress functional issues, but also includes security issues, user interface issues, usability issues and more. Test on desktop, tablet, and mobile, to uncover bugs before your customers encounter them.`, + about: 'Expert QA testers will verify that all of the pages on your website are working correctly from the end-user perspective. The testing will stress functional issues, but also includes security issues, user interface issues, usability issues and more. Test on desktop, tablet, and mobile, to uncover bugs before your customers encounter them.', bgImage: bugHuntTileImg, deliverablesDescription: `You will receive thorough testing of your website, and at the conclusion will be provided a detailed report of bugs which have steps to reproduce, screenshots / videos if applicable, details of the bug, and severity of the issue.`, description: 'Execute thorough bug hunts exceptionally fast. Receive a detailed list of bugs and instructions on exactly how to fix them.', duration: { - 'advanced': 6, - 'premium': 7, - 'standard': 5, + advanced: 6, + premium: 7, + standard: 5, }, featured: false, intakeFormRoutes: WorkIntakeFormRoutes[WorkType.bugHunt], priceConfig: workPriceBugHunt, - results: `You will receive thorough testing of your website by QA experts, and an actionable report extremely quickly. Our experts will deliver a detailed list of bugs found, with steps to reproduce, including screenshots, videos, and the information you need to fix them.`, + results: 'You will receive thorough testing of your website by QA experts, and an actionable report extremely quickly. Our experts will deliver a detailed list of bugs found, with steps to reproduce, including screenshots, videos, and the information you need to fix them.', review: { aboutYourProjectTitle: 'Important things to know about your project', subtitle: 'Website Bug Hunt', @@ -34,9 +34,9 @@ export const WorkTypeConfigs: { [workType: string]: WorkTypeConfig } = { shortDescription: 'Find bugs quickly and vigorously', startRoute: WorkIntakeFormRoutes[WorkType.bugHunt].basicInfo, submissionPhaseDuration: { - 'advanced': 172800, // 2 days - 'premium': 259200, // 3 days - 'standard': 86400, // 1 day + advanced: 172800, // 2 days + premium: 259200, // 3 days + standard: 86400, // 1 day }, subtitle: 'Execute thorough bug hunts exceptionally fast. Receive a detailed list of bugs and instructions on exactly how to fix them.', tags: [ChallengeTag.qa], diff --git a/src-ts/tools/work/work-lib/work-provider/work-functions/work.functions.ts b/src-ts/tools/work/work-lib/work-provider/work-functions/work.functions.ts index ddf6a24f3..a51918444 100644 --- a/src-ts/tools/work/work-lib/work-provider/work-functions/work.functions.ts +++ b/src-ts/tools/work/work-lib/work-provider/work-functions/work.functions.ts @@ -8,7 +8,7 @@ import { workFactoryBuildCreateReqeuest, workFactoryBuildCustomerPaymentRequest, workFactoryBuildUpdateRequest, - workFactoryCreate + workFactoryCreate, } from './work-factory' import { ActivateWorkRequest, diff --git a/src-ts/tools/work/work-lib/work-provider/work.provider.tsx b/src-ts/tools/work/work-lib/work-provider/work.provider.tsx index 4da398d67..bb3956f45 100644 --- a/src-ts/tools/work/work-lib/work-provider/work.provider.tsx +++ b/src-ts/tools/work/work-lib/work-provider/work.provider.tsx @@ -4,7 +4,7 @@ import { logError, profileContext, ProfileContextData, UserProfile } from '../.. import { messageGetUnreadCountAsync } from './message-functions' import { WorkContextData } from './work-context-data.model' -import { Work, workGetAllAsync, } from './work-functions' +import { Work, workGetAllAsync } from './work-functions' import { default as workContext, defaultWorkContextData } from './work.context' export const WorkProvider: FC<{ children: ReactNode }> = ({ children }: { children: ReactNode }) => { diff --git a/src-ts/tools/work/work-login-prompt/WorkLoginPrompt.tsx b/src-ts/tools/work/work-login-prompt/WorkLoginPrompt.tsx index e0b6fd94e..266932068 100644 --- a/src-ts/tools/work/work-login-prompt/WorkLoginPrompt.tsx +++ b/src-ts/tools/work/work-login-prompt/WorkLoginPrompt.tsx @@ -16,7 +16,7 @@ interface WorkLoginPromptProps { previousPageUrl: string } -const WorkLoginPrompt: FC = ({ previousPageUrl }: WorkLoginPromptProps) => { +const WorkLoginPrompt: FC = ({ previousPageUrl }: WorkLoginPromptProps) => { const routeData: RouteContextData = useContext(routeContext) const location: Location = useLocation() @@ -30,7 +30,7 @@ const WorkLoginPrompt: FC = ({ previousPageUrl }: WorkLogi const onBack: () => void = () => { navigate( - previousPageUrl + previousPageUrl, ) } diff --git a/src-ts/tools/work/work-not-logged-in/WorkNotLoggedIn.tsx b/src-ts/tools/work/work-not-logged-in/WorkNotLoggedIn.tsx index cd74ce723..bd7abbd22 100644 --- a/src-ts/tools/work/work-not-logged-in/WorkNotLoggedIn.tsx +++ b/src-ts/tools/work/work-not-logged-in/WorkNotLoggedIn.tsx @@ -51,7 +51,7 @@ const WorkNotLoggedIn: FC<{}> = () => { } return ( - +
diff --git a/src-ts/tools/work/work-self-service/intake-forms/bug-hunt/BugHuntIntakeForm.tsx b/src-ts/tools/work/work-self-service/intake-forms/bug-hunt/BugHuntIntakeForm.tsx index 349ca078b..7ceff9680 100644 --- a/src-ts/tools/work/work-self-service/intake-forms/bug-hunt/BugHuntIntakeForm.tsx +++ b/src-ts/tools/work/work-self-service/intake-forms/bug-hunt/BugHuntIntakeForm.tsx @@ -1,5 +1,5 @@ -import React, { Dispatch, SetStateAction, useContext, useEffect, useState } from 'react' import { NavigateFunction, useNavigate, useParams } from 'react-router-dom' +import React, { Dispatch, SetStateAction, useContext, useEffect, useState } from 'react' import { Form, @@ -14,7 +14,7 @@ import { profileContext, ProfileContextData, SaveForLaterIcon, - useCheckIsMobile + useCheckIsMobile, } from '../../../../../lib' import { Challenge, @@ -26,7 +26,7 @@ import { workGetByWorkIdAsync, WorkIntakeFormRoutes, WorkType, - workUpdateAsync + workUpdateAsync, } from '../../../work-lib' import { WorkServicePrice } from '../../../work-service-price' import { WorkTypeBanner } from '../../../work-type-banner' @@ -34,8 +34,8 @@ import { dashboardRoute, selfServiceStartRoute } from '../../../work.routes' import { IntakeFormsBreadcrumb } from '../intake-forms-breadcrumb' import { BugHuntFormConfig } from './bug-hunt.form.config' -import styles from './BugHunt.module.scss' import { DeliverablesInfoCard } from './deliverables-info-card' +import styles from './BugHunt.module.scss' const BugHuntIntakeForm: React.FC = () => { @@ -127,7 +127,7 @@ const BugHuntIntakeForm: React.FC = () => { } }, [loading, saveSuccess]) - const requestGenerator: (inputs: ReadonlyArray) => void = (inputs) => { + const requestGenerator: (inputs: ReadonlyArray) => void = inputs => { const projectTitle: string = formGetInputModel(inputs, ChallengeMetadataName.projectTitle).value as string const featuresToTest: string = formGetInputModel(inputs, ChallengeMetadataName.featuresToTest).value as string const deliveryType: string = formGetInputModel(inputs, ChallengeMetadataName.deliveryType).value as string @@ -146,7 +146,7 @@ const BugHuntIntakeForm: React.FC = () => { } } - const onChange: (inputs: ReadonlyArray) => void = (inputs) => { + const onChange: (inputs: ReadonlyArray) => void = inputs => { const packageType: PricePackageName = formGetInputModel(inputs, ChallengeMetadataName.packageType).value as PricePackageName if (packageType !== selectedPackage) { @@ -158,7 +158,7 @@ const BugHuntIntakeForm: React.FC = () => { setDisableSaveForLater(!title?.trim()) } - const onSave: (val: any) => Promise = (val) => { + const onSave: (val: any) => Promise = val => { if (!isLoggedIn) { goToLoginStep(val) return Promise.reject() diff --git a/src-ts/tools/work/work-self-service/intake-forms/bug-hunt/bug-hunt.form.config.tsx b/src-ts/tools/work/work-self-service/intake-forms/bug-hunt/bug-hunt.form.config.tsx index cd58728bb..8023c8b45 100644 --- a/src-ts/tools/work/work-self-service/intake-forms/bug-hunt/bug-hunt.form.config.tsx +++ b/src-ts/tools/work/work-self-service/intake-forms/bug-hunt/bug-hunt.form.config.tsx @@ -119,12 +119,12 @@ export const BugHuntFormConfig: FormDefinition = { options: [ { checked: false, - children: } isRecommended />, + children: } isRecommended />, id: 'GitHub', }, { checked: false, - children: } />, + children: } />, id: 'GitLab', }, ], diff --git a/src-ts/tools/work/work-self-service/intake-forms/intake-forms-breadcrumb/IntakeFormsBreadcrumb.tsx b/src-ts/tools/work/work-self-service/intake-forms/intake-forms-breadcrumb/IntakeFormsBreadcrumb.tsx index ae956d74e..fa776a244 100644 --- a/src-ts/tools/work/work-self-service/intake-forms/intake-forms-breadcrumb/IntakeFormsBreadcrumb.tsx +++ b/src-ts/tools/work/work-self-service/intake-forms/intake-forms-breadcrumb/IntakeFormsBreadcrumb.tsx @@ -19,7 +19,7 @@ const IntakeFormsBreadcrumb: FC = ({ basicInfoRoute, if (reviewRoute) { breadcrumbs.push( - { url: reviewRoute, name: 'Review & Payment' } + { url: reviewRoute, name: 'Review & Payment' }, ) } diff --git a/src-ts/tools/work/work-service-price/WorkServicePrice.tsx b/src-ts/tools/work/work-service-price/WorkServicePrice.tsx index 854f78d55..2a54e0cc7 100644 --- a/src-ts/tools/work/work-service-price/WorkServicePrice.tsx +++ b/src-ts/tools/work/work-service-price/WorkServicePrice.tsx @@ -26,9 +26,11 @@ const ServicePrice: FC = (props: WorkServicePriceProps) = )}
{!hideTitle && ( -

- {serviceType} -

+

+

+ {serviceType} +

+

)}

@@ -39,7 +41,10 @@ const ServicePrice: FC = (props: WorkServicePriceProps) = )} {textFormatMoneyLocaleString(price)} | - {duration} Days + + {duration} + Days + , setStatusGroups: Dispatch>, tabs: ReadonlyArray, - setTabs: Dispatch>> + setTabs: Dispatch>>, ): void { // if we're not initialized, nothing else to do diff --git a/src-ts/tools/work/work-table/work-delete-button-renderer/WorkDeleteButtonRenderer.tsx b/src-ts/tools/work/work-table/work-delete-button-renderer/WorkDeleteButtonRenderer.tsx index 1a598bcca..53bd78bc2 100644 --- a/src-ts/tools/work/work-table/work-delete-button-renderer/WorkDeleteButtonRenderer.tsx +++ b/src-ts/tools/work/work-table/work-delete-button-renderer/WorkDeleteButtonRenderer.tsx @@ -7,8 +7,8 @@ import { IconOutline, Tooltip, } from '../../../../lib' -import '../../../../lib/styles/index.scss' import { Work, workContext, WorkContextData, workDeleteAsync, WorkStatus } from '../../work-lib' +import '../../../../lib/styles/index.scss' const WorkDeleteButtonRenderer = (work: Work): JSX.Element | undefined => { diff --git a/src-ts/tools/work/work-table/work-no-results/WorkNoResults.tsx b/src-ts/tools/work/work-table/work-no-results/WorkNoResults.tsx index f3b02eb0f..af3e1abed 100644 --- a/src-ts/tools/work/work-table/work-no-results/WorkNoResults.tsx +++ b/src-ts/tools/work/work-table/work-no-results/WorkNoResults.tsx @@ -10,7 +10,7 @@ interface WorkNoResultsProps { const WorkNoResults: FC = (props: WorkNoResultsProps) => { - const message: string = props.filtered ? 'No items available' : `Your future work will live here. Let's go!` + const message: string = props.filtered ? 'No items available' : 'Your future work will live here. Let\'s go!' return (
diff --git a/src-ts/tools/work/work.routes.tsx b/src-ts/tools/work/work.routes.tsx index 70fe89534..9fb63e965 100644 --- a/src-ts/tools/work/work.routes.tsx +++ b/src-ts/tools/work/work.routes.tsx @@ -104,11 +104,11 @@ export const workRoutes: Array = [ // General { element: , - route: `:workType/save-after-login`, + route: ':workType/save-after-login', }, { element: , - route: `:workType/thank-you`, + route: ':workType/thank-you', }, ], element: , diff --git a/src-ts/utils/contact-support/ContactSupport.tsx b/src-ts/utils/contact-support/ContactSupport.tsx index 1cbdb5c74..2bd846335 100644 --- a/src-ts/utils/contact-support/ContactSupport.tsx +++ b/src-ts/utils/contact-support/ContactSupport.tsx @@ -6,7 +6,7 @@ import { ContentLayout, FormDefinition, formGetInputFields, - formOnReset + formOnReset, } from '../../lib' import { toolTitle } from './contact-support.routes' diff --git a/src-ts/utils/home/index.ts b/src-ts/utils/home/index.ts index 5ae887136..d1f730df5 100644 --- a/src-ts/utils/home/index.ts +++ b/src-ts/utils/home/index.ts @@ -1 +1 @@ -export * from './home.routes' +export * from './home.routes' diff --git a/src-ts/utils/settings/account/Account.tsx b/src-ts/utils/settings/account/Account.tsx index 35eb48ed5..326c8ba19 100644 --- a/src-ts/utils/settings/account/Account.tsx +++ b/src-ts/utils/settings/account/Account.tsx @@ -11,9 +11,9 @@ import { ProfileContextData, } from '../../../lib' -import styles from './Account.module.scss' import { ChangePassword } from './change-password' import { EditName, editNameFormDef } from './edit-name' +import styles from './Account.module.scss' const Account: FC<{}> = () => { @@ -44,8 +44,16 @@ const Account: FC<{}> = () => {
-

Email: {profile.email}

-

Username: {profile.handle}

+

+ Email: + {' '} + {profile.email} +

+

+ Username: + {' '} + {profile.handle} +

= () => { onClick={toggleEditName} >

- {profile.firstName} {profile.lastName} + {profile.firstName} + {' '} + {profile.lastName}