chore: update ts and enable noUnusedLocals

This commit is contained in:
Roman Hotsiy 2018-07-17 12:15:22 +03:00
parent bab3e7dfce
commit edc77a2017
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0
28 changed files with 19 additions and 57 deletions

View File

@ -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 * 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 { compact } from 'lodash';
import { resolve } from 'path';
import * as webpack from 'webpack';
const VERSION = JSON.stringify(require('../package.json').version); const VERSION = JSON.stringify(require('../package.json').version);
const REVISION = JSON.stringify( const REVISION = JSON.stringify(
@ -51,7 +51,9 @@ export default (env: { playground?: boolean; bench?: boolean } = {}, { mode }) =
root( root(
env.playground env.playground
? 'playground/hmr-playground.tsx' ? 'playground/hmr-playground.tsx'
: env.bench ? '../benchmark/index.tsx' : 'index.tsx', : env.bench
? '../benchmark/index.tsx'
: 'index.tsx',
), ),
], ],
output: { output: {

View File

@ -110,7 +110,7 @@
"ts-node": "^7.0.0", "ts-node": "^7.0.0",
"tslint": "^5.7.0", "tslint": "^5.7.0",
"tslint-react": "^3.4.0", "tslint-react": "^3.4.0",
"typescript": "2.9.1", "typescript": "^3.0.0-dev.20180712",
"webpack": "^4.16.1", "webpack": "^4.16.1",
"webpack-cli": "^3.0.8", "webpack-cli": "^3.0.8",
"webpack-dev-server": "^3.1.1", "webpack-dev-server": "^3.1.1",

View File

@ -6,9 +6,7 @@ import * as yaml from 'yaml-js';
import { readFileSync } from 'fs'; import { readFileSync } from 'fs';
import { resolve } from 'path'; import { resolve } from 'path';
// import { filterPropsDeep } from '../../../utils/test-utils'; import { Loading, RedocStandalone } from '../components/';
import { ErrorBoundary, Loading, RedocStandalone, StoreProvider } from '../components/';
describe('Components', () => { describe('Components', () => {
describe('RedocStandalone', () => { describe('RedocStandalone', () => {

View File

@ -1,4 +1,3 @@
import * as React from 'react';
import Dropdown from 'react-dropdown'; import Dropdown from 'react-dropdown';
import { StyledComponentClass } from 'styled-components'; import { StyledComponentClass } from 'styled-components';

View File

@ -1,8 +1,6 @@
import { transparentize } from 'polished'; import { transparentize } from 'polished';
import * as React from 'react';
import styled, { extensionsHook, withProps } from '../styled-components'; import styled, { extensionsHook, withProps } from '../styled-components';
import { deprecatedCss } from './mixins'; import { deprecatedCss } from './mixins';
export const PropertiesTableCaption = styled.caption` export const PropertiesTableCaption = styled.caption`

View File

@ -1,5 +1,4 @@
import { transparentize } from 'polished'; import { transparentize } from 'polished';
import * as React from 'react';
import styled from '../styled-components'; import styled from '../styled-components';
import { PropertyNameCell } from './fields-layout'; import { PropertyNameCell } from './fields-layout';

View File

@ -1,5 +1,3 @@
import * as React from 'react';
import styled, { css, extensionsHook } from '../styled-components'; import styled, { css, extensionsHook } from '../styled-components';
const headerFontSize = { const headerFontSize = {

View File

@ -1,5 +1,3 @@
import * as React from 'react';
import styled, { css } from '../styled-components'; import styled, { css } from '../styled-components';
// tslint:disable-next-line // tslint:disable-next-line

View File

@ -1,4 +1,3 @@
import * as React from 'react';
import styled, { media } from '../styled-components'; import styled, { media } from '../styled-components';
export const MiddlePanel = styled.div` export const MiddlePanel = styled.div`

View File

@ -1,5 +1,3 @@
import * as React from 'react';
import styled from '../styled-components'; import styled from '../styled-components';
export const SampleControls = styled.div` export const SampleControls = styled.div`

View File

@ -1,4 +1,3 @@
import * as React from 'react';
import styled, { withProps } from '../styled-components'; import styled, { withProps } from '../styled-components';
export const OneOfList = styled.ul` export const OneOfList = styled.ul`

View File

@ -1,4 +1,4 @@
import { Tabs as ReactTabs, TabsProps } from 'react-tabs'; import { Tabs as ReactTabs } from 'react-tabs';
import styled from '../styled-components'; import styled from '../styled-components';
export { Tab, TabList, TabPanel } from 'react-tabs'; export { Tab, TabList, TabPanel } from 'react-tabs';

View File

@ -1,5 +1,3 @@
import * as React from 'react';
import { H1, MiddlePanel } from '../../common-elements'; import { H1, MiddlePanel } from '../../common-elements';
import styled, { extensionsHook } from '../../styled-components'; import styled, { extensionsHook } from '../../styled-components';

View File

@ -1,5 +1,3 @@
import * as React from 'react';
import styled, { withProps } from '../../styled-components'; import styled, { withProps } from '../../styled-components';
export const OperationEndpointWrap = styled.div` export const OperationEndpointWrap = styled.div`

View File

@ -86,7 +86,7 @@ export interface AdvancedMarkdownProps extends BaseMarkdownProps {
export class AdvancedMarkdown extends React.Component<AdvancedMarkdownProps> { export class AdvancedMarkdown extends React.Component<AdvancedMarkdownProps> {
render() { render() {
const { raw, inline, dense, store, parts } = this.props; const { inline, dense, store, parts } = this.props;
if (!parts.length) { if (!parts.length) {
return null; return null;

View File

@ -1,5 +1,3 @@
import * as React from 'react';
import { headerCommonMixin, linkifyMixin } from '../../common-elements'; import { headerCommonMixin, linkifyMixin } from '../../common-elements';
import styled, { css, extensionsHook, withProps } from '../../styled-components'; import styled, { css, extensionsHook, withProps } from '../../styled-components';

View File

@ -1,7 +1,6 @@
import * as React from 'react';
import styled from '../../styled-components'; import styled from '../../styled-components';
import { DropdownProps, StyledDropdown } from '../../common-elements'; import { StyledDropdown } from '../../common-elements';
export const MimeLabel = styled.div` export const MimeLabel = styled.div`
border-bottom: 1px solid rgba(255, 255, 255, 0.9); border-bottom: 1px solid rgba(255, 255, 255, 0.9);

View File

@ -1,5 +1,3 @@
import * as React from 'react';
import styled, { media } from '../../styled-components'; import styled, { media } from '../../styled-components';
export const RedocWrap = styled.div` export const RedocWrap = styled.div`

View File

@ -1,5 +1,4 @@
import { transparentize } from 'polished'; import { transparentize } from 'polished';
import * as React from 'react';
import { UnderlinedHeader } from '../../common-elements'; import { UnderlinedHeader } from '../../common-elements';
import styled from '../../styled-components'; import styled from '../../styled-components';

View File

@ -3,7 +3,6 @@ import * as React from 'react';
import { SecuritySchemesModel } from '../../services/models'; import { SecuritySchemesModel } from '../../services/models';
import { H2, ShareLink } from '../../common-elements'; import { H2, ShareLink } from '../../common-elements';
import styled from '../../styled-components';
import { OpenAPISecurityScheme } from '../../types'; import { OpenAPISecurityScheme } from '../../types';
import { Markdown } from '../Markdown/Markdown'; import { Markdown } from '../Markdown/Markdown';
import { StyledMarkdownBlock } from '../Markdown/styled.elements'; import { StyledMarkdownBlock } from '../Markdown/styled.elements';
@ -15,16 +14,6 @@ const AUTH_TYPES = {
openIdConnect: 'Open ID Connect', openIdConnect: 'Open ID Connect',
}; };
const AuthTable = styled.table`
ul > li {
margin: 0.5em 0 !important;
}
th {
text-transform: capitalize;
}
`;
export interface OAuthFlowProps { export interface OAuthFlowProps {
type: string; type: string;
flow: OpenAPISecurityScheme['flows'][keyof OpenAPISecurityScheme['flows']]; flow: OpenAPISecurityScheme['flows'][keyof OpenAPISecurityScheme['flows']];

View File

@ -1,5 +1,4 @@
import * as classnames from 'classnames'; import * as classnames from 'classnames';
import * as React from 'react';
import { deprecatedCss } from '../../common-elements'; import { deprecatedCss } from '../../common-elements';
import styled, { css, withProps } from '../../styled-components'; import styled, { css, withProps } from '../../styled-components';

View File

@ -66,7 +66,7 @@ export class StoreProvider extends Component<StoreProviderProps, StoreProviderSt
} }
async load() { async load() {
const { specUrl, spec, options } = this.props; const { specUrl, spec } = this.props;
try { try {
const resolvedSpec = await loadAndBundleSpec(spec || specUrl!); const resolvedSpec = await loadAndBundleSpec(spec || specUrl!);
this.setState({ resolvedSpec, loading: false }); this.setState({ resolvedSpec, loading: false });

View File

@ -1,11 +1,8 @@
/* tslint:disable:no-implicit-dependencies */ /* tslint:disable:no-implicit-dependencies */
import { shallow } from 'enzyme'; import { shallow } from 'enzyme';
import toJson from 'enzyme-to-json';
import * as React from 'react'; import * as React from 'react';
import { filterPropsDeep } from '../../utils/test-utils';
import { OneOfSchema, Schema } from '../'; import { OneOfSchema, Schema } from '../';
import { OpenAPIParser, SchemaModel } from '../../services'; import { OpenAPIParser, SchemaModel } from '../../services';
import { RedocNormalizedOptions } from '../../services/RedocNormalizedOptions'; import { RedocNormalizedOptions } from '../../services/RedocNormalizedOptions';

View File

@ -1,7 +1,6 @@
import { OpenAPIContact, OpenAPIInfo, OpenAPILicense } from '../../types'; import { OpenAPIContact, OpenAPIInfo, OpenAPILicense } from '../../types';
import { IS_BROWSER } from '../../utils/'; import { IS_BROWSER } from '../../utils/';
import { OpenAPIParser } from '../OpenAPIParser'; import { OpenAPIParser } from '../OpenAPIParser';
import { RedocNormalizedOptions } from '../RedocNormalizedOptions';
export class ApiInfoModel implements OpenAPIInfo { export class ApiInfoModel implements OpenAPIInfo {
title: string; title: string;

View File

@ -1,4 +1,4 @@
import { adjustHue, desaturate, lighten, transparentize } from 'polished'; import { desaturate, lighten, transparentize } from 'polished';
const defaultTheme: ThemeInterface = { const defaultTheme: ThemeInterface = {
spacingUnit: 20, spacingUnit: 20,

View File

@ -5,6 +5,7 @@
"target": "es5", "target": "es5",
"noImplicitAny": false, "noImplicitAny": false,
"noUnusedParameters": true, "noUnusedParameters": true,
"noUnusedLocals": true,
"strictNullChecks": true, "strictNullChecks": true,
"sourceMap": true, "sourceMap": true,
"declaration": true, "declaration": true,

View File

@ -1,6 +1,5 @@
/* tslint:disable:no-implicit-dependencies */ /* tslint:disable:no-implicit-dependencies */
import * as ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin'; import * as ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
import * as HtmlWebpackPlugin from 'html-webpack-plugin';
import * as webpack from 'webpack'; import * as webpack from 'webpack';
import * as path from 'path'; import * as path from 'path';

View File

@ -8496,14 +8496,14 @@ typescript-eslint-parser@^16.0.0:
lodash.unescape "4.0.1" lodash.unescape "4.0.1"
semver "5.5.0" 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: typescript@^2.5.1:
version "2.9.2" version "2.9.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.2.tgz#1cbf61d05d6b96269244eb6a3bce4bd914e0f00c" 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: ua-parser-js@^0.7.18:
version "0.7.18" version "0.7.18"
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.18.tgz#a7bfd92f56edfb117083b69e31d2aa8882d4b1ed" resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.18.tgz#a7bfd92f56edfb117083b69e31d2aa8882d4b1ed"