From 5e564afb3a971bcdbdfdf4ef68cb6559828519b9 Mon Sep 17 00:00:00 2001 From: ido Date: Mon, 26 Oct 2015 10:38:28 +0200 Subject: [PATCH] fix eslint --- src/reactTemplates.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/reactTemplates.js b/src/reactTemplates.js index 5104c63..8a28350 100644 --- a/src/reactTemplates.js +++ b/src/reactTemplates.js @@ -60,7 +60,7 @@ function getOptions(options) { force: false, format: 'stylish', targetVersion: reactDOMSupport.default, - reactImportPath: options.native ? 'react-native' : (options.targetVersion === '0.14.0' ? 'react' : 'react/addons'), + reactImportPath: reactImport(options), lodashImportPath: 'lodash', native: false, nativeTargetVersion: reactNativeSupport.default, @@ -77,6 +77,16 @@ function getOptions(options) { return finalOptions; } +function reactImport(options) { + if (options.native) { + return 'react-native'; + } + if (options.targetVersion === '0.14.0') { + return 'react'; + } + return 'react/addons'; +} + /** * @const */