From dd59a08be2857c169b45140588737972a6f35357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Sat, 18 May 2019 23:20:28 +0800 Subject: [PATCH] fix code lint error --- .eslintrc.js | 1 + config/config.ts | 34 ++++++++++++++++++++-------------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 53ee2fcf..7372d96b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -11,6 +11,7 @@ module.exports = { }, globals: { page: true, + ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: true, }, rules: { 'react/jsx-filename-extension': [1, { extensions: ['.js'] }], diff --git a/config/config.ts b/config/config.ts index dc4b7175..8a8f9f61 100644 --- a/config/config.ts +++ b/config/config.ts @@ -6,7 +6,8 @@ import defaultSettings from './defaultSettings'; import webpackPlugin from './plugin.config'; const { pwa, primaryColor } = defaultSettings; -// preview.pro.ant.design only do not use in your production ; preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。 +// preview.pro.ant.design only do not use in your production ; +// preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。 const { ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION, TEST, NODE_ENV } = process.env; const plugins: IPlugin[] = [ @@ -18,9 +19,12 @@ const plugins: IPlugin[] = [ hmr: true, }, locale: { - enable: true, // default false - default: 'zh-CN', // default zh-CN - baseNavigator: true, // default true, when it is true, will use `navigator.language` overwrite default + // default false + enable: true, + // default zh-CN + default: 'zh-CN', + // default true, when it is true, will use `navigator.language` overwrite default + baseNavigator: true, }, dynamicImport: { loadingComponent: './components/PageLoading/index', @@ -67,17 +71,19 @@ if (ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION === 'site') { }, ]); } -const uglifyJSOptions = NODE_ENV === 'production' - ? { - uglifyOptions: { - // remove console.* except console.error - compress: { - drop_console: true, - pure_funcs: [ 'console.error' ], + +const uglifyJSOptions = + NODE_ENV === 'production' + ? { + uglifyOptions: { + // remove console.* except console.error + compress: { + drop_console: true, + pure_funcs: ['console.error'], + }, }, - }, - } - : {}; + } + : {}; export default { // add for transfer to umi -- GitLab