diff --git a/config/webpack.config.flask.js b/config/webpack.config.flask.js index 2659e45..c816c2c 100644 --- a/config/webpack.config.flask.js +++ b/config/webpack.config.flask.js @@ -134,7 +134,10 @@ module.exports = { test: /\.(ts|tsx)$/, loader: require.resolve('tslint-loader'), enforce: 'pre', - include: paths.appSrc + include: paths.appSrc, + options: { + typeCheck:true + } }, { test: /\.js$/, loader: require.resolve('source-map-loader'), diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index 0e801a7..c651a7d 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -83,7 +83,7 @@ module.exports = { // https://github.com/facebookincubator/create-react-app/issues/290 extensions: ['.ts', '.tsx', '.js', '.json', '.jsx'], alias: { - + // Support React Native Web // https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/ 'react-native': 'react-native-web', @@ -111,6 +111,9 @@ module.exports = { loader: require.resolve('tslint-loader'), enforce: 'pre', include: paths.appSrc, + options: { + typeCheck:true + } }, { test: /\.js$/, diff --git a/src/LexEditor.tsx b/src/LexEditor.tsx index 77ae7d3..cb07a31 100644 --- a/src/LexEditor.tsx +++ b/src/LexEditor.tsx @@ -9,66 +9,37 @@ import { } from 'semantic-ui-react'; const { Flex } = require('reflexbox'); -export class LexEditor extends React.Component { - public render() { - let searchMeta = this.props.fieldMetaMap[this.props.searchState.searchType]; - let searchText = this.props.searchState.searchValue; - let matchedEntries = _.chain(this.props.allEntries) - .filter((q: any) => searchMeta.get(q) === searchText) - .take(10) - .value(); - let { fieldMetaMap, save, markDirty, newGuid } = this.props; - return ( -
- - -
- ); - } -} - -class LexSearch extends React.Component { - public render() { - let dropOptions = _.keys(this.props.fieldMetaMap).map((k, i, c) => { - return { key: i, value: k, text: _.capitalize(k) }; - }); - return ( - - this.handleChange(d, true)} - value={this.props.searchState.searchType} - compact={true} - selection={true} - style={{ width: '10em' }} - /> - this.handleChange(d, false)} - /> - - ); - } - - private handleChange(e: any, t: boolean) { +function LexSearch(props: any) { + let dropOptions = _.keys(props.fieldMetaMap).map((k, i, c) => { + return { key: i, value: k, text: _.capitalize(k) }; + }); + function handleChange(e: any, t: boolean) { if (t) { - this.props.searchForType(e.value); + props.searchForType(e.value); } else { - this.props.searchForValue(e.value); + props.searchForValue(e.value); } } + return ( + + handleChange(d, true)} + value={props.searchState.searchType} + compact={true} + selection={true} + style={{ width: '10em' }} + /> + handleChange(d, false)} + /> + + ); } function LexMatches(params: any) { @@ -116,3 +87,27 @@ function LexMatches(params: any) { ); } + +export function LexEditor(props: any) { + let searchMeta = props.fieldMetaMap[props.searchState.searchType]; + let searchText = props.searchState.searchValue; + let matchedEntries = _.chain(props.allEntries) + .filter((q: any) => searchMeta.get(q) === searchText) + .take(10) + .value(); + let { fieldMetaMap, save, markDirty, newGuid } = props; + return ( +
+ + +
+ ); +} diff --git a/src/LexInputContainer.tsx b/src/LexInputContainer.tsx index 578f578..cd0b351 100644 --- a/src/LexInputContainer.tsx +++ b/src/LexInputContainer.tsx @@ -9,23 +9,21 @@ import { } from 'semantic-ui-react'; import PropListInput from './PropListInput'; -class LexInputContainer extends React.Component { - public render() { - return ( -
-
- - - {this.props.label} - - - {this.props.children} - - -
-
- ); - } +function LexInputContainer(props: any) { + return ( +
+
+ + + {props.label} + + + {props.children} + + +
+
+ ); } function changedLabel(changed: boolean, text: string) { diff --git a/tslint.json b/tslint.json index 28941df..b95f97c 100644 --- a/tslint.json +++ b/tslint.json @@ -16,7 +16,6 @@ "curly": true, "eofline": false, "forin": true, - "type-check": true, "indent": [true, "spaces"], "interface-name": [true, "never-prefix"], "jsdoc-format": true,