Skip to content

Commit

Permalink
chore: update ts and enable noUnusedLocals
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanHotsiy committed Jul 17, 2018
1 parent bab3e7d commit edc77a2
Show file tree
Hide file tree
Showing 28 changed files with 19 additions and 57 deletions.
12 changes: 7 additions & 5 deletions demo/webpack.config.ts
@@ -1,9 +1,9 @@
import * as webpack from 'webpack';
import * as HtmlWebpackPlugin from 'html-webpack-plugin';
import * as ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
import * as CopyWebpackPlugin from 'copy-webpack-plugin';
import { resolve } from 'path';
import * as ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
import * as HtmlWebpackPlugin from 'html-webpack-plugin';
import { compact } from 'lodash';
import { resolve } from 'path';
import * as webpack from 'webpack';

const VERSION = JSON.stringify(require('../package.json').version);
const REVISION = JSON.stringify(
Expand Down Expand Up @@ -51,7 +51,9 @@ export default (env: { playground?: boolean; bench?: boolean } = {}, { mode }) =
root(
env.playground
? 'playground/hmr-playground.tsx'
: env.bench ? '../benchmark/index.tsx' : 'index.tsx',
: env.bench
? '../benchmark/index.tsx'
: 'index.tsx',
),
],
output: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -110,7 +110,7 @@
"ts-node": "^7.0.0",
"tslint": "^5.7.0",
"tslint-react": "^3.4.0",
"typescript": "2.9.1",
"typescript": "^3.0.0-dev.20180712",
"webpack": "^4.16.1",
"webpack-cli": "^3.0.8",
"webpack-dev-server": "^3.1.1",
Expand Down
4 changes: 1 addition & 3 deletions src/__tests__/standalone.test.tsx
Expand Up @@ -6,9 +6,7 @@ import * as yaml from 'yaml-js';
import { readFileSync } from 'fs';
import { resolve } from 'path';

// import { filterPropsDeep } from '../../../utils/test-utils';

import { ErrorBoundary, Loading, RedocStandalone, StoreProvider } from '../components/';
import { Loading, RedocStandalone } from '../components/';

describe('Components', () => {
describe('RedocStandalone', () => {
Expand Down
1 change: 0 additions & 1 deletion src/common-elements/dropdown.ts
@@ -1,4 +1,3 @@
import * as React from 'react';
import Dropdown from 'react-dropdown';

import { StyledComponentClass } from 'styled-components';
Expand Down
2 changes: 0 additions & 2 deletions src/common-elements/fields-layout.ts
@@ -1,8 +1,6 @@
import { transparentize } from 'polished';
import * as React from 'react';

import styled, { extensionsHook, withProps } from '../styled-components';

import { deprecatedCss } from './mixins';

export const PropertiesTableCaption = styled.caption`
Expand Down
1 change: 0 additions & 1 deletion src/common-elements/fields.ts
@@ -1,5 +1,4 @@
import { transparentize } from 'polished';
import * as React from 'react';

import styled from '../styled-components';
import { PropertyNameCell } from './fields-layout';
Expand Down
2 changes: 0 additions & 2 deletions src/common-elements/headers.ts
@@ -1,5 +1,3 @@
import * as React from 'react';

import styled, { css, extensionsHook } from '../styled-components';

const headerFontSize = {
Expand Down
2 changes: 0 additions & 2 deletions src/common-elements/linkify.ts
@@ -1,5 +1,3 @@
import * as React from 'react';

import styled, { css } from '../styled-components';

// tslint:disable-next-line
Expand Down
1 change: 0 additions & 1 deletion src/common-elements/panels.ts
@@ -1,4 +1,3 @@
import * as React from 'react';
import styled, { media } from '../styled-components';

export const MiddlePanel = styled.div`
Expand Down
2 changes: 0 additions & 2 deletions src/common-elements/samples.tsx
@@ -1,5 +1,3 @@
import * as React from 'react';

import styled from '../styled-components';

export const SampleControls = styled.div`
Expand Down
1 change: 0 additions & 1 deletion src/common-elements/schema.ts
@@ -1,4 +1,3 @@
import * as React from 'react';
import styled, { withProps } from '../styled-components';

export const OneOfList = styled.ul`
Expand Down
2 changes: 1 addition & 1 deletion src/common-elements/tabs.ts
@@ -1,4 +1,4 @@
import { Tabs as ReactTabs, TabsProps } from 'react-tabs';
import { Tabs as ReactTabs } from 'react-tabs';
import styled from '../styled-components';

export { Tab, TabList, TabPanel } from 'react-tabs';
Expand Down
2 changes: 0 additions & 2 deletions src/components/ApiInfo/styled.elements.ts
@@ -1,5 +1,3 @@
import * as React from 'react';

import { H1, MiddlePanel } from '../../common-elements';
import styled, { extensionsHook } from '../../styled-components';

Expand Down
2 changes: 0 additions & 2 deletions src/components/Endpoint/styled.elements.ts
@@ -1,5 +1,3 @@
import * as React from 'react';

import styled, { withProps } from '../../styled-components';

export const OperationEndpointWrap = styled.div`
Expand Down
2 changes: 1 addition & 1 deletion src/components/Markdown/Markdown.tsx
Expand Up @@ -86,7 +86,7 @@ export interface AdvancedMarkdownProps extends BaseMarkdownProps {

export class AdvancedMarkdown extends React.Component<AdvancedMarkdownProps> {
render() {
const { raw, inline, dense, store, parts } = this.props;
const { inline, dense, store, parts } = this.props;

if (!parts.length) {
return null;
Expand Down
2 changes: 0 additions & 2 deletions src/components/Markdown/styled.elements.ts
@@ -1,5 +1,3 @@
import * as React from 'react';

import { headerCommonMixin, linkifyMixin } from '../../common-elements';
import styled, { css, extensionsHook, withProps } from '../../styled-components';

Expand Down
3 changes: 1 addition & 2 deletions src/components/PayloadSamples/styled.elements.ts
@@ -1,7 +1,6 @@
import * as React from 'react';
import styled from '../../styled-components';

import { DropdownProps, StyledDropdown } from '../../common-elements';
import { StyledDropdown } from '../../common-elements';

export const MimeLabel = styled.div`
border-bottom: 1px solid rgba(255, 255, 255, 0.9);
Expand Down
2 changes: 0 additions & 2 deletions src/components/Redoc/styled.elements.tsx
@@ -1,5 +1,3 @@
import * as React from 'react';

import styled, { media } from '../../styled-components';

export const RedocWrap = styled.div`
Expand Down
1 change: 0 additions & 1 deletion src/components/Responses/styled.elements.ts
@@ -1,5 +1,4 @@
import { transparentize } from 'polished';
import * as React from 'react';

import { UnderlinedHeader } from '../../common-elements';
import styled from '../../styled-components';
Expand Down
11 changes: 0 additions & 11 deletions src/components/SecuritySchemes/SecuritySchemes.tsx
Expand Up @@ -3,7 +3,6 @@ import * as React from 'react';
import { SecuritySchemesModel } from '../../services/models';

import { H2, ShareLink } from '../../common-elements';
import styled from '../../styled-components';
import { OpenAPISecurityScheme } from '../../types';
import { Markdown } from '../Markdown/Markdown';
import { StyledMarkdownBlock } from '../Markdown/styled.elements';
Expand All @@ -15,16 +14,6 @@ const AUTH_TYPES = {
openIdConnect: 'Open ID Connect',
};

const AuthTable = styled.table`
ul > li {
margin: 0.5em 0 !important;
}
th {
text-transform: capitalize;
}
`;

export interface OAuthFlowProps {
type: string;
flow: OpenAPISecurityScheme['flows'][keyof OpenAPISecurityScheme['flows']];
Expand Down
1 change: 0 additions & 1 deletion src/components/SideMenu/styled.elements.ts
@@ -1,5 +1,4 @@
import * as classnames from 'classnames';
import * as React from 'react';

import { deprecatedCss } from '../../common-elements';
import styled, { css, withProps } from '../../styled-components';
Expand Down
2 changes: 1 addition & 1 deletion src/components/StoreProvider.ts
Expand Up @@ -66,7 +66,7 @@ export class StoreProvider extends Component<StoreProviderProps, StoreProviderSt
}

async load() {
const { specUrl, spec, options } = this.props;
const { specUrl, spec } = this.props;
try {
const resolvedSpec = await loadAndBundleSpec(spec || specUrl!);
this.setState({ resolvedSpec, loading: false });
Expand Down
3 changes: 0 additions & 3 deletions src/components/__tests__/OneOfSchema.test.tsx
@@ -1,11 +1,8 @@
/* tslint:disable:no-implicit-dependencies */

import { shallow } from 'enzyme';
import toJson from 'enzyme-to-json';
import * as React from 'react';

import { filterPropsDeep } from '../../utils/test-utils';

import { OneOfSchema, Schema } from '../';
import { OpenAPIParser, SchemaModel } from '../../services';
import { RedocNormalizedOptions } from '../../services/RedocNormalizedOptions';
Expand Down
1 change: 0 additions & 1 deletion src/services/models/ApiInfo.ts
@@ -1,7 +1,6 @@
import { OpenAPIContact, OpenAPIInfo, OpenAPILicense } from '../../types';
import { IS_BROWSER } from '../../utils/';
import { OpenAPIParser } from '../OpenAPIParser';
import { RedocNormalizedOptions } from '../RedocNormalizedOptions';

export class ApiInfoModel implements OpenAPIInfo {
title: string;
Expand Down
2 changes: 1 addition & 1 deletion src/theme.ts
@@ -1,4 +1,4 @@
import { adjustHue, desaturate, lighten, transparentize } from 'polished';
import { desaturate, lighten, transparentize } from 'polished';

const defaultTheme: ThemeInterface = {
spacingUnit: 20,
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Expand Up @@ -5,6 +5,7 @@
"target": "es5",
"noImplicitAny": false,
"noUnusedParameters": true,
"noUnusedLocals": true,
"strictNullChecks": true,
"sourceMap": true,
"declaration": true,
Expand Down
1 change: 0 additions & 1 deletion webpack.config.ts
@@ -1,6 +1,5 @@
/* tslint:disable:no-implicit-dependencies */
import * as ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
import * as HtmlWebpackPlugin from 'html-webpack-plugin';
import * as webpack from 'webpack';

import * as path from 'path';
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Expand Up @@ -8496,14 +8496,14 @@ typescript-eslint-parser@^16.0.0:
lodash.unescape "4.0.1"
semver "5.5.0"

typescript@2.9.1:
version "2.9.1"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.1.tgz#fdb19d2c67a15d11995fd15640e373e09ab09961"

typescript@^2.5.1:
version "2.9.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.2.tgz#1cbf61d05d6b96269244eb6a3bce4bd914e0f00c"

typescript@^3.0.0-dev.20180712:
version "3.0.0-dev.20180712"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.0.0-dev.20180712.tgz#ffdadf6a5a108c44d5325e83e2afbd088f2a5f84"

ua-parser-js@^0.7.18:
version "0.7.18"
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.18.tgz#a7bfd92f56edfb117083b69e31d2aa8882d4b1ed"
Expand Down

0 comments on commit edc77a2

Please sign in to comment.