diff options
Diffstat (limited to 'packages/react-docs')
-rw-r--r-- | packages/react-docs/package.json | 2 | ||||
-rw-r--r-- | packages/react-docs/src/components/badge.tsx | 1 | ||||
-rw-r--r-- | packages/react-docs/src/components/comment.tsx | 1 | ||||
-rw-r--r-- | packages/react-docs/src/components/custom_enum.tsx | 1 | ||||
-rw-r--r-- | packages/react-docs/src/components/documentation.tsx | 10 | ||||
-rw-r--r-- | packages/react-docs/src/components/enum.tsx | 2 | ||||
-rw-r--r-- | packages/react-docs/src/components/signature.tsx | 1 | ||||
-rw-r--r-- | packages/react-docs/src/components/source_link.tsx | 1 | ||||
-rw-r--r-- | packages/react-docs/src/components/type.tsx | 15 | ||||
-rw-r--r-- | packages/react-docs/src/components/type_definition.tsx | 6 | ||||
-rw-r--r-- | packages/react-docs/src/utils/typedoc_utils.ts | 4 | ||||
-rw-r--r-- | packages/react-docs/src/utils/utils.ts | 5 |
12 files changed, 12 insertions, 37 deletions
diff --git a/packages/react-docs/package.json b/packages/react-docs/package.json index 3d9ef08e8..5e8492d25 100644 --- a/packages/react-docs/package.json +++ b/packages/react-docs/package.json @@ -10,7 +10,7 @@ "scripts": { "lint": "tslint --project .", "build": "tsc && copyfiles -u 2 './lib/monorepo_scripts/**/*' ./scripts", - "watch": "tsc -w", + "watch_without_deps": "tsc -w", "clean": "shx rm -rf lib scripts", "manual:postpublish": "yarn build; node ./scripts/postpublish.js" }, diff --git a/packages/react-docs/src/components/badge.tsx b/packages/react-docs/src/components/badge.tsx index 0137b153b..d34f8a0fc 100644 --- a/packages/react-docs/src/components/badge.tsx +++ b/packages/react-docs/src/components/badge.tsx @@ -1,5 +1,4 @@ import { Styles } from '@0xproject/react-shared'; -import * as _ from 'lodash'; import * as React from 'react'; const styles: Styles = { diff --git a/packages/react-docs/src/components/comment.tsx b/packages/react-docs/src/components/comment.tsx index 0d63d4d31..c3687c510 100644 --- a/packages/react-docs/src/components/comment.tsx +++ b/packages/react-docs/src/components/comment.tsx @@ -1,5 +1,4 @@ import { MarkdownCodeBlock } from '@0xproject/react-shared'; -import * as _ from 'lodash'; import * as React from 'react'; import * as ReactMarkdown from 'react-markdown'; diff --git a/packages/react-docs/src/components/custom_enum.tsx b/packages/react-docs/src/components/custom_enum.tsx index 797372f35..c4252d9e2 100644 --- a/packages/react-docs/src/components/custom_enum.tsx +++ b/packages/react-docs/src/components/custom_enum.tsx @@ -3,7 +3,6 @@ import * as _ from 'lodash'; import * as React from 'react'; import { CustomType } from '../types'; -import { utils } from '../utils/utils'; const STRING_ENUM_CODE_PREFIX = ' strEnum('; diff --git a/packages/react-docs/src/components/documentation.tsx b/packages/react-docs/src/components/documentation.tsx index 25687db67..a4e6f4f6e 100644 --- a/packages/react-docs/src/components/documentation.tsx +++ b/packages/react-docs/src/components/documentation.tsx @@ -3,7 +3,6 @@ import { constants as sharedConstants, EtherscanLinkSuffixes, MarkdownSection, - MenuSubsectionsBySection, NestedSidebarMenu, Networks, SectionHeader, @@ -13,13 +12,11 @@ import { import * as _ from 'lodash'; import CircularProgress from 'material-ui/CircularProgress'; import * as React from 'react'; -import { scroller } from 'react-scroll'; import { DocsInfo } from '../docs_info'; import { AddressByContractName, DocAgnosticFormat, - DoxityDocObj, Event, Property, SolidityMethod, @@ -29,7 +26,6 @@ import { TypescriptMethod, } from '../types'; import { constants } from '../utils/constants'; -import { utils } from '../utils/utils'; import { Badge } from './badge'; import { Comment } from './comment'; @@ -77,7 +73,7 @@ export class Documentation extends React.Component<DocumentationProps, Documenta public componentWillUnmount(): void { window.removeEventListener('hashchange', this._onHashChanged.bind(this), false); } - public componentDidUpdate(prevProps: DocumentationProps, prevState: DocumentationState): void { + public componentDidUpdate(prevProps: DocumentationProps, _prevState: DocumentationState): void { if (!_.isEqual(prevProps.docAgnosticFormat, this.props.docAgnosticFormat)) { const hash = window.location.hash.slice(1); sharedUtils.scrollToHash(hash, sharedConstants.SCROLL_CONTAINER_ID); @@ -368,7 +364,7 @@ export class Documentation extends React.Component<DocumentationProps, Documenta /> ); } - private _onSidebarHover(event: React.FormEvent<HTMLInputElement>): void { + private _onSidebarHover(_event: React.FormEvent<HTMLInputElement>): void { this.setState({ isHoveringSidebar: true, }); @@ -378,7 +374,7 @@ export class Documentation extends React.Component<DocumentationProps, Documenta isHoveringSidebar: false, }); } - private _onHashChanged(event: any): void { + private _onHashChanged(_event: any): void { const hash = window.location.hash.slice(1); sharedUtils.scrollToHash(hash, sharedConstants.SCROLL_CONTAINER_ID); } diff --git a/packages/react-docs/src/components/enum.tsx b/packages/react-docs/src/components/enum.tsx index 536385d90..dee866790 100644 --- a/packages/react-docs/src/components/enum.tsx +++ b/packages/react-docs/src/components/enum.tsx @@ -8,7 +8,7 @@ export interface EnumProps { } export const Enum = (props: EnumProps) => { - const values = _.map(props.values, (value, i) => { + const values = _.map(props.values, value => { const defaultValueIfAny = !_.isUndefined(value.defaultValue) ? ` = ${value.defaultValue}` : ''; return `\n\t${value.name}${defaultValueIfAny},`; }); diff --git a/packages/react-docs/src/components/signature.tsx b/packages/react-docs/src/components/signature.tsx index c4a6394fa..77e9cc909 100644 --- a/packages/react-docs/src/components/signature.tsx +++ b/packages/react-docs/src/components/signature.tsx @@ -1,6 +1,5 @@ import * as _ from 'lodash'; import * as React from 'react'; -import * as ReactDOM from 'react-dom'; import { DocsInfo } from '../docs_info'; import { Parameter, Type as TypeDef, TypeDefinitionByName, TypeParameter } from '../types'; diff --git a/packages/react-docs/src/components/source_link.tsx b/packages/react-docs/src/components/source_link.tsx index 58a9ba6a7..c60435ea6 100644 --- a/packages/react-docs/src/components/source_link.tsx +++ b/packages/react-docs/src/components/source_link.tsx @@ -1,5 +1,4 @@ import { colors } from '@0xproject/react-shared'; -import * as _ from 'lodash'; import * as React from 'react'; import { Source } from '../types'; diff --git a/packages/react-docs/src/components/type.tsx b/packages/react-docs/src/components/type.tsx index 2b7b49672..e453349ef 100644 --- a/packages/react-docs/src/components/type.tsx +++ b/packages/react-docs/src/components/type.tsx @@ -1,4 +1,5 @@ import { colors, constants as sharedConstants, utils as sharedUtils } from '@0xproject/react-shared'; +import { errorUtils } from '@0xproject/utils'; import * as _ from 'lodash'; import * as React from 'react'; import { Link as ScrollLink } from 'react-scroll'; @@ -6,22 +7,10 @@ import * as ReactTooltip from 'react-tooltip'; import { DocsInfo } from '../docs_info'; import { Type as TypeDef, TypeDefinitionByName, TypeDocTypes } from '../types'; -import { constants } from '../utils/constants'; -import { utils } from '../utils/utils'; import { Signature } from './signature'; import { TypeDefinition } from './type_definition'; -const typeToSection: { [typeName: string]: string } = { - ExchangeWrapper: 'exchange', - TokenWrapper: 'token', - TokenRegistryWrapper: 'tokenRegistry', - EtherTokenWrapper: 'etherToken', - ProxyWrapper: 'proxy', - TokenTransferProxyWrapper: 'proxy', - OrderStateWatcher: 'orderWatcher', -}; - export interface TypeProps { type: TypeDef; docsInfo: DocsInfo; @@ -140,7 +129,7 @@ export function Type(props: TypeProps): any { break; default: - throw utils.spawnSwitchErr('type.typeDocType', type.typeDocType); + throw errorUtils.spawnSwitchErr('type.typeDocType', type.typeDocType); } // HACK: Normalize BigNumber to simply BigNumber. For some reason the type // name is unpredictably one or the other. diff --git a/packages/react-docs/src/components/type_definition.tsx b/packages/react-docs/src/components/type_definition.tsx index a8e601ac2..c4bd7359a 100644 --- a/packages/react-docs/src/components/type_definition.tsx +++ b/packages/react-docs/src/components/type_definition.tsx @@ -1,11 +1,11 @@ import { AnchorTitle, colors, HeaderSizes } from '@0xproject/react-shared'; +import { errorUtils } from '@0xproject/utils'; import * as _ from 'lodash'; import * as React from 'react'; import { DocsInfo } from '../docs_info'; -import { CustomType, CustomTypeChild, EnumValue, KindString, TypeDocTypes } from '../types'; +import { CustomType, CustomTypeChild, KindString, TypeDocTypes } from '../types'; import { constants } from '../utils/constants'; -import { utils } from '../utils/utils'; import { Comment } from './comment'; import { CustomEnum } from './custom_enum'; @@ -96,7 +96,7 @@ export class TypeDefinition extends React.Component<TypeDefinitionProps, TypeDef break; default: - throw utils.spawnSwitchErr('type.kindString', customType.kindString); + throw errorUtils.spawnSwitchErr('type.kindString', customType.kindString); } const typeDefinitionAnchorId = `${this.props.sectionName}-${customType.name}`; diff --git a/packages/react-docs/src/utils/typedoc_utils.ts b/packages/react-docs/src/utils/typedoc_utils.ts index 5a672f10f..5633d9040 100644 --- a/packages/react-docs/src/utils/typedoc_utils.ts +++ b/packages/react-docs/src/utils/typedoc_utils.ts @@ -1,3 +1,4 @@ +import { errorUtils } from '@0xproject/utils'; import * as _ from 'lodash'; import { DocsInfo } from '../docs_info'; @@ -19,7 +20,6 @@ import { TypescriptFunction, TypescriptMethod, } from '../types'; -import { utils } from '../utils/utils'; export const typeDocUtils = { isType(entity: TypeDocNode): boolean { @@ -197,7 +197,7 @@ export const typeDocUtils = { break; default: - throw utils.spawnSwitchErr('kindString', entity.kindString); + throw errorUtils.spawnSwitchErr('kindString', entity.kindString); } }); return docSection; diff --git a/packages/react-docs/src/utils/utils.ts b/packages/react-docs/src/utils/utils.ts deleted file mode 100644 index e3dd1fc62..000000000 --- a/packages/react-docs/src/utils/utils.ts +++ /dev/null @@ -1,5 +0,0 @@ -export const utils = { - spawnSwitchErr(name: string, value: any): Error { - return new Error(`Unexpected switch value: ${value} encountered for ${name}`); - }, -}; |