From 8d86c52d1c85b817eb7a3801f44bfa42c1b605e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20L=C3=A9p=C3=A9e?= Date: Mon, 20 Feb 2017 12:16:17 +0100 Subject: [PATCH] fix: remove source-map-client support because of warnings (#245) * fix: remove source-map-support client and warns from reducers import * style: eslint imports fix * style: disable some import aslant rules * style: eslint imports rules * style: eslint fix --- src/client/index.jsx | 13 +++++-------- src/server/middlewares/store.js | 8 +++++++- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/client/index.jsx b/src/client/index.jsx index 92d0d60a..de32ee85 100644 --- a/src/client/index.jsx +++ b/src/client/index.jsx @@ -2,24 +2,21 @@ import { unmountComponentAtNode, render as reactRender } from 'react-dom'; import { syncHistoryWithStore } from 'react-router-redux'; import { browserHistory } from 'react-router'; import { useBasename } from 'history'; -import { install as installSourceMapSupport } from 'source-map-support'; import RedBox from 'redbox-react'; import { Resolver } from 'react-resolver'; -/* eslint-disable import/no-extraneous-dependencies */ +/* eslint-disable import/no-extraneous-dependencies,import/newline-after-import,import/first */ +// used require instead of import, because optional default with import cause warnings +const reducers = require('__app_modules__redux_reducers__'); import routes from '__app_modules__routes__'; -import * as reducers from '__app_modules__redux_reducers__'; import middlewares from '__app_modules__redux_middlewares__'; import { parse as stateParser } from '__app_modules__redux_stateSerializer__'; -/* eslint-enable import/no-extraneous-dependencies */ +/* eslint-enable import/no-extraneous-dependencies, import/newline-after-import */ import { create as createStore, createRootReducer } from '../shared/store'; import config from '../../config'; import App from './components/App'; - -if (process.env.NODE_ENV !== 'production') { - installSourceMapSupport({ environment: 'browser' }); -} +/* eslint-enable import/first */ function render(history, store, appRoutes, element) { const insertCss = ({ _insertCss }) => _insertCss(); diff --git a/src/server/middlewares/store.js b/src/server/middlewares/store.js index 6d0c6a9c..f70cbdcb 100644 --- a/src/server/middlewares/store.js +++ b/src/server/middlewares/store.js @@ -1,10 +1,16 @@ import { createMemoryHistory } from 'react-router'; + /* eslint-disable import/no-extraneous-dependencies */ -import * as reducers from '__app_modules__redux_reducers__'; import middlewares from '__app_modules__redux_middlewares__'; +// used require instead of import, because optional default with import cause warnings +const reducers = require('__app_modules__redux_reducers__'); /* eslint-enable import/no-extraneous-dependencies */ + + +/* eslint-disable import/first */ import { create as createStore } from '../../shared/store'; import config from '../../../config'; +/* eslint-enable import/first */ export default () => (ctx, next) => { const history = createMemoryHistory({