From 32332afb9f04089e74b9bb49890b3e0dc04ab66c Mon Sep 17 00:00:00 2001 From: Thorsten Date: Mon, 4 Mar 2019 20:39:22 +0100 Subject: [PATCH 1/7] feat: add 3rd option 'default' for lintOnSave --- docs/config/README.md | 73 +++++++-------- packages/@vue/cli-plugin-eslint/index.js | 81 +++++++++------- packages/@vue/cli-service/lib/options.js | 112 ++++++++++++----------- 3 files changed, 142 insertions(+), 124 deletions(-) diff --git a/docs/config/README.md b/docs/config/README.md index 96560b8511..c7c355e7a7 100644 --- a/docs/config/README.md +++ b/docs/config/README.md @@ -22,7 +22,7 @@ See the [Browser Compatibility](../guide/browser-compatibility.md#browserslist) The file should export an object containing options: -``` js +```js // vue.config.js module.exports = { // options... @@ -50,15 +50,14 @@ Deprecated since Vue CLI 3.3, please use [`publicPath`](#publicPath) instead. - You are using HTML5 `history.pushState` routing; - You are using the `pages` option to build a multi-paged app. - ::: + ::: This value is also respected during development. If you want your dev server to be served at root instead, you can use a conditional value: - ``` js + ```js module.exports = { - publicPath: process.env.NODE_ENV === 'production' - ? '/production-sub-path/' - : '/' + publicPath: + process.env.NODE_ENV === 'production' ? '/production-sub-path/' : '/', } ``` @@ -108,7 +107,7 @@ Deprecated since Vue CLI 3.3, please use [`publicPath`](#publicPath) instead. - An object that specifies its `entry`, `template`, `filename`, `title` and `chunks` (all optional except `entry`). Any other properties added beside those will also be passed directly to `html-webpack-plugin`, allowing user to customize said plugin; - Or a string specifying its `entry`. - ``` js + ```js module.exports = { pages: { index: { @@ -123,14 +122,14 @@ Deprecated since Vue CLI 3.3, please use [`publicPath`](#publicPath) instead. title: 'Index Page', // chunks to include on this page, by default includes // extracted common chunks and vendor chunks. - chunks: ['chunk-vendors', 'chunk-common', 'index'] + chunks: ['chunk-vendors', 'chunk-common', 'index'], }, // when using the entry-only string format, // template is inferred to be `public/subpage.html` // and falls back to `public/index.html` if not found. // Output filename is inferred to be `subpage.html`. - subpage: 'src/subpage/main.js' - } + subpage: 'src/subpage/main.js', + }, } ``` @@ -138,37 +137,39 @@ Deprecated since Vue CLI 3.3, please use [`publicPath`](#publicPath) instead. When building in multi-page mode, the webpack config will contain different plugins (there will be multiple instances of `html-webpack-plugin` and `preload-webpack-plugin`). Make sure to run `vue inspect` if you are trying to modify the options for those plugins. ::: -### lintOnSave +### ^Save -- Type: `boolean | 'error'` +- Type: `boolean | 'default' | 'error'` - Default: `true` Whether to perform lint-on-save during development using [eslint-loader](https://github.com/webpack-contrib/eslint-loader). This value is respected only when [`@vue/cli-plugin-eslint`](https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint) is installed. - When set to `true`, `eslint-loader` will emit lint errors as warnings. By default, warnings are only logged to the terminal and does not fail the compilation. + When set to `true`, `eslint-loader` will emit lint errors as warnings. By default, warnings are only logged to the terminal and does not fail the compilation, so this is a good default for development. + + To make lint errors show up in the browser overlay, you can use `lintOnSave: 'default'`. This will force `eslint-loader` to actually emit errors. this also means lint errors will now cause the compilation to fail. - To make lint errors show up in the browser overlay, you can use `lintOnSave: 'error'`. This will force `eslint-loader` to always emit errors. this also means lint errors will now cause the compilation to fail. + Setting it to `'errors'` will force eslint-loader to emit warnings as errors as well. Alternatively, you can configure the overlay to display both warnings and errors: - ``` js + ```js // vue.config.js module.exports = { devServer: { overlay: { warnings: true, - errors: true - } - } + errors: true, + }, + }, } ``` When `lintOnSave` is a truthy value, `eslint-loader` will be applied in both development and production. If you want to disable `eslint-loader` during production build, you can use the following config: - ``` js + ```js // vue.config.js module.exports = { - lintOnSave: process.env.NODE_ENV !== 'production' + lintOnSave: process.env.NODE_ENV !== 'production', } ``` @@ -271,7 +272,7 @@ Deprecated since Vue CLI 3.3, please use [`publicPath`](#publicPath) instead. Pass options to CSS-related loaders. For example: - ``` js + ```js module.exports = { css: { loaderOptions: { @@ -280,9 +281,9 @@ Deprecated since Vue CLI 3.3, please use [`publicPath`](#publicPath) instead. }, postcss: { // options here will be passed to postcss-loader - } - } - } + }, + }, + }, } ``` @@ -318,11 +319,11 @@ Deprecated since Vue CLI 3.3, please use [`publicPath`](#publicPath) instead. `devServer.proxy` can be a string pointing to the development API server: - ``` js + ```js module.exports = { devServer: { - proxy: 'http://localhost:4000' - } + proxy: 'http://localhost:4000', + }, } ``` @@ -330,20 +331,20 @@ Deprecated since Vue CLI 3.3, please use [`publicPath`](#publicPath) instead. If you want to have more control over the proxy behavior, you can also use an object with `path: options` pairs. Consult [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware#proxycontext-config) for full options: - ``` js + ```js module.exports = { devServer: { proxy: { '^/api': { target: '', ws: true, - changeOrigin: true + changeOrigin: true, }, '^/foo': { - target: '' - } - } - } + target: '', + }, + }, + }, } ``` @@ -366,14 +367,14 @@ Deprecated since Vue CLI 3.3, please use [`publicPath`](#publicPath) instead. This is an object that doesn't go through any schema validation, so it can be used to pass arbitrary options to 3rd party plugins. For example: - ``` js + ```js module.exports = { pluginOptions: { foo: { // plugins can access these options as // `options.pluginOptions.foo`. - } - } + }, + }, } ``` diff --git a/packages/@vue/cli-plugin-eslint/index.js b/packages/@vue/cli-plugin-eslint/index.js index bd109efe9a..6fa1815ba4 100644 --- a/packages/@vue/cli-plugin-eslint/index.js +++ b/packages/@vue/cli-plugin-eslint/index.js @@ -17,7 +17,7 @@ module.exports = (api, options) => { 'eslint-loader', { 'eslint-loader': require('eslint-loader/package.json').version, - 'eslint': eslintPkg.version + eslint: eslintPkg.version }, [ '.eslintrc.js', @@ -30,44 +30,57 @@ module.exports = (api, options) => { ) api.chainWebpack(webpackConfig => { - webpackConfig.resolveLoader.modules.prepend(path.join(__dirname, 'node_modules')) + webpackConfig.resolveLoader.modules.prepend( + path.join(__dirname, 'node_modules') + ) + + const { lintOnSave } = options + const allWarnings = lintOnSave === true || lintOnSave === 'warnings' + const allErrors = lintOnSave === 'errors' webpackConfig.module .rule('eslint') - .pre() - .exclude - .add(/node_modules/) - .add(require('path').dirname(require.resolve('@vue/cli-service'))) - .end() - .test(/\.(vue|(j|t)sx?)$/) - .use('eslint-loader') - .loader('eslint-loader') - .options({ - extensions, - cache: true, - cacheIdentifier, - emitWarning: options.lintOnSave !== 'error', - emitError: options.lintOnSave === 'error', - eslintPath: resolveModule('eslint', cwd) || require.resolve('eslint'), - formatter: - loadModule('eslint/lib/formatters/codeframe', cwd, true) || - require('eslint/lib/formatters/codeframe') - }) + .pre() + .exclude.add(/node_modules/) + .add(require('path').dirname(require.resolve('@vue/cli-service'))) + .end() + .test(/\.(vue|(j|t)sx?)$/) + .use('eslint-loader') + .loader('eslint-loader') + .options({ + extensions, + cache: true, + cacheIdentifier, + emitWarning: allWarnings, + // only emit errors in production mode. + emitError: allErrors, + eslintPath: resolveModule('eslint', cwd) || require.resolve('eslint'), + formatter: + loadModule('eslint/lib/formatters/codeframe', cwd, true) || + require('eslint/lib/formatters/codeframe') + }) }) } - api.registerCommand('lint', { - description: 'lint and fix source files', - usage: 'vue-cli-service lint [options] [...files]', - options: { - '--format [formatter]': 'specify formatter (default: codeframe)', - '--no-fix': 'do not fix errors or warnings', - '--no-fix-warnings': 'fix errors, but do not fix warnings', - '--max-errors [limit]': 'specify number of errors to make build failed (default: 0)', - '--max-warnings [limit]': 'specify number of warnings to make build failed (default: Infinity)' + api.registerCommand( + 'lint', + { + description: 'lint and fix source files', + usage: 'vue-cli-service lint [options] [...files]', + options: { + '--format [formatter]': 'specify formatter (default: codeframe)', + '--no-fix': 'do not fix errors or warnings', + '--no-fix-warnings': 'fix errors, but do not fix warnings', + '--max-errors [limit]': + 'specify number of errors to make build failed (default: 0)', + '--max-warnings [limit]': + 'specify number of warnings to make build failed (default: Infinity)' + }, + details: + 'For more options, see https://eslint.org/docs/user-guide/command-line-interface#options' }, - details: 'For more options, see https://eslint.org/docs/user-guide/command-line-interface#options' - }, args => { - require('./lint')(args, api) - }) + args => { + require('./lint')(args, api) + } + ) } diff --git a/packages/@vue/cli-service/lib/options.js b/packages/@vue/cli-service/lib/options.js index 017f1bb677..d448043e24 100644 --- a/packages/@vue/cli-service/lib/options.js +++ b/packages/@vue/cli-service/lib/options.js @@ -1,57 +1,59 @@ const { createSchema, validate } = require('@vue/cli-shared-utils') -const schema = createSchema(joi => joi.object({ - baseUrl: joi.string().allow(''), - publicPath: joi.string().allow(''), - outputDir: joi.string(), - assetsDir: joi.string().allow(''), - indexPath: joi.string(), - filenameHashing: joi.boolean(), - runtimeCompiler: joi.boolean(), - transpileDependencies: joi.array(), - productionSourceMap: joi.boolean(), - parallel: joi.boolean(), - devServer: joi.object(), - pages: joi.object().pattern( - /\w+/, - joi.alternatives().try([ - joi.string(), - joi.object().keys({ - entry: joi.string().required() - }).unknown(true) - ]) - ), - crossorigin: joi.string().valid(['', 'anonymous', 'use-credentials']), - integrity: joi.boolean(), - - // css - css: joi.object({ - modules: joi.boolean(), - extract: joi.alternatives().try(joi.boolean(), joi.object()), - sourceMap: joi.boolean(), - loaderOptions: joi.object({ - css: joi.object(), - sass: joi.object(), - less: joi.object(), - stylus: joi.object(), - postcss: joi.object() - }) - }), - - // webpack - chainWebpack: joi.func(), - configureWebpack: joi.alternatives().try( - joi.object(), - joi.func() - ), - - // known runtime options for built-in plugins - lintOnSave: joi.any().valid([true, false, 'error']), - pwa: joi.object(), - - // 3rd party plugin options - pluginOptions: joi.object() -})) +const schema = createSchema(joi => + joi.object({ + baseUrl: joi.string().allow(''), + publicPath: joi.string().allow(''), + outputDir: joi.string(), + assetsDir: joi.string().allow(''), + indexPath: joi.string(), + filenameHashing: joi.boolean(), + runtimeCompiler: joi.boolean(), + transpileDependencies: joi.array(), + productionSourceMap: joi.boolean(), + parallel: joi.boolean(), + devServer: joi.object(), + pages: joi.object().pattern( + /\w+/, + joi.alternatives().try([ + joi.string(), + joi + .object() + .keys({ + entry: joi.string().required() + }) + .unknown(true) + ]) + ), + crossorigin: joi.string().valid(['', 'anonymous', 'use-credentials']), + integrity: joi.boolean(), + + // css + css: joi.object({ + modules: joi.boolean(), + extract: joi.alternatives().try(joi.boolean(), joi.object()), + sourceMap: joi.boolean(), + loaderOptions: joi.object({ + css: joi.object(), + sass: joi.object(), + less: joi.object(), + stylus: joi.object(), + postcss: joi.object() + }) + }), + + // webpack + chainWebpack: joi.func(), + configureWebpack: joi.alternatives().try(joi.object(), joi.func()), + + // known runtime options for built-in plugins + lintOnSave: joi.any().valid([true, false, 'error', 'normal']), + pwa: joi.object(), + + // 3rd party plugin options + pluginOptions: joi.object() + }) +) exports.validate = (options, cb) => { validate(options, schema, cb) @@ -90,7 +92,9 @@ exports.defaults = () => ({ runtimeCompiler: false, // deps to transpile - transpileDependencies: [/* string or regex */], + transpileDependencies: [ + /* string or regex */ + ], // sourceMap for production build? productionSourceMap: !process.env.VUE_CLI_TEST, @@ -121,7 +125,7 @@ exports.defaults = () => ({ lintOnSave: true, devServer: { - /* + /* open: process.platform === 'darwin', host: '0.0.0.0', port: 8080, From 8dc0a95a061de0977c0b523136acc80404c04d4f Mon Sep 17 00:00:00 2001 From: Thorsten Date: Mon, 4 Mar 2019 21:45:30 +0100 Subject: [PATCH 2/7] refactor: fix flag names to align with previous singluar flag 'error' --- packages/@vue/cli-plugin-eslint/index.js | 4 ++-- packages/@vue/cli-service/lib/options.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/@vue/cli-plugin-eslint/index.js b/packages/@vue/cli-plugin-eslint/index.js index 6fa1815ba4..71310a8b58 100644 --- a/packages/@vue/cli-plugin-eslint/index.js +++ b/packages/@vue/cli-plugin-eslint/index.js @@ -35,8 +35,8 @@ module.exports = (api, options) => { ) const { lintOnSave } = options - const allWarnings = lintOnSave === true || lintOnSave === 'warnings' - const allErrors = lintOnSave === 'errors' + const allWarnings = lintOnSave === true || lintOnSave === 'warning' + const allErrors = lintOnSave === 'error' webpackConfig.module .rule('eslint') diff --git a/packages/@vue/cli-service/lib/options.js b/packages/@vue/cli-service/lib/options.js index d448043e24..8aca9ee591 100644 --- a/packages/@vue/cli-service/lib/options.js +++ b/packages/@vue/cli-service/lib/options.js @@ -47,7 +47,7 @@ const schema = createSchema(joi => configureWebpack: joi.alternatives().try(joi.object(), joi.func()), // known runtime options for built-in plugins - lintOnSave: joi.any().valid([true, false, 'error', 'normal']), + lintOnSave: joi.any().valid([true, false, 'error', 'warning', 'default']), pwa: joi.object(), // 3rd party plugin options From e312abda27aeabecde5775b1564b7d7b1c59da2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorsten=20L=C3=BCnborg?= Date: Tue, 5 Mar 2019 08:36:28 +0100 Subject: [PATCH 3/7] docs: Fix typo in docs and add missing 'warning' value. --- docs/config/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/config/README.md b/docs/config/README.md index c7c355e7a7..72173b50c7 100644 --- a/docs/config/README.md +++ b/docs/config/README.md @@ -137,18 +137,18 @@ Deprecated since Vue CLI 3.3, please use [`publicPath`](#publicPath) instead. When building in multi-page mode, the webpack config will contain different plugins (there will be multiple instances of `html-webpack-plugin` and `preload-webpack-plugin`). Make sure to run `vue inspect` if you are trying to modify the options for those plugins. ::: -### ^Save +### lintOnSave -- Type: `boolean | 'default' | 'error'` +- Type: `boolean | 'warning' | 'default' | 'error'` - Default: `true` Whether to perform lint-on-save during development using [eslint-loader](https://github.com/webpack-contrib/eslint-loader). This value is respected only when [`@vue/cli-plugin-eslint`](https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint) is installed. - When set to `true`, `eslint-loader` will emit lint errors as warnings. By default, warnings are only logged to the terminal and does not fail the compilation, so this is a good default for development. + When set to `true` or `'warning'`, `eslint-loader` will emit lint errors as warnings. By default, warnings are only logged to the terminal and does not fail the compilation, so this is a good default for development. To make lint errors show up in the browser overlay, you can use `lintOnSave: 'default'`. This will force `eslint-loader` to actually emit errors. this also means lint errors will now cause the compilation to fail. - Setting it to `'errors'` will force eslint-loader to emit warnings as errors as well. + Setting it to `'errors'` will force eslint-loader to emit warnings as errors as well, which means warnings will also show up in the overlay. Alternatively, you can configure the overlay to display both warnings and errors: From 316129df22288b09b63a6339a93d505135ad89fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorsten=20L=C3=BCnborg?= Date: Fri, 8 Mar 2019 09:18:16 +0100 Subject: [PATCH 4/7] revert: undo unnecessary formatting changes --- docs/config/README.md | 63 ++++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/docs/config/README.md b/docs/config/README.md index 72173b50c7..f573b00362 100644 --- a/docs/config/README.md +++ b/docs/config/README.md @@ -22,7 +22,7 @@ See the [Browser Compatibility](../guide/browser-compatibility.md#browserslist) The file should export an object containing options: -```js +``` js // vue.config.js module.exports = { // options... @@ -50,14 +50,15 @@ Deprecated since Vue CLI 3.3, please use [`publicPath`](#publicPath) instead. - You are using HTML5 `history.pushState` routing; - You are using the `pages` option to build a multi-paged app. - ::: + ::: This value is also respected during development. If you want your dev server to be served at root instead, you can use a conditional value: - ```js + ``` js module.exports = { - publicPath: - process.env.NODE_ENV === 'production' ? '/production-sub-path/' : '/', + publicPath: process.env.NODE_ENV === 'production' + ? '/production-sub-path/' + : '/' } ``` @@ -107,7 +108,7 @@ Deprecated since Vue CLI 3.3, please use [`publicPath`](#publicPath) instead. - An object that specifies its `entry`, `template`, `filename`, `title` and `chunks` (all optional except `entry`). Any other properties added beside those will also be passed directly to `html-webpack-plugin`, allowing user to customize said plugin; - Or a string specifying its `entry`. - ```js + ``` js module.exports = { pages: { index: { @@ -122,14 +123,14 @@ Deprecated since Vue CLI 3.3, please use [`publicPath`](#publicPath) instead. title: 'Index Page', // chunks to include on this page, by default includes // extracted common chunks and vendor chunks. - chunks: ['chunk-vendors', 'chunk-common', 'index'], + chunks: ['chunk-vendors', 'chunk-common', 'index'] }, // when using the entry-only string format, // template is inferred to be `public/subpage.html` // and falls back to `public/index.html` if not found. // Output filename is inferred to be `subpage.html`. - subpage: 'src/subpage/main.js', - }, + subpage: 'src/subpage/main.js' + } } ``` @@ -152,24 +153,24 @@ Deprecated since Vue CLI 3.3, please use [`publicPath`](#publicPath) instead. Alternatively, you can configure the overlay to display both warnings and errors: - ```js + ``` js // vue.config.js module.exports = { devServer: { overlay: { warnings: true, - errors: true, - }, - }, + errors: true + } + } } ``` When `lintOnSave` is a truthy value, `eslint-loader` will be applied in both development and production. If you want to disable `eslint-loader` during production build, you can use the following config: - ```js + ``` js // vue.config.js module.exports = { - lintOnSave: process.env.NODE_ENV !== 'production', + lintOnSave: process.env.NODE_ENV !== 'production' } ``` @@ -272,7 +273,7 @@ Deprecated since Vue CLI 3.3, please use [`publicPath`](#publicPath) instead. Pass options to CSS-related loaders. For example: - ```js + ``` js module.exports = { css: { loaderOptions: { @@ -281,9 +282,9 @@ Deprecated since Vue CLI 3.3, please use [`publicPath`](#publicPath) instead. }, postcss: { // options here will be passed to postcss-loader - }, - }, - }, + } + } + } } ``` @@ -319,11 +320,11 @@ Deprecated since Vue CLI 3.3, please use [`publicPath`](#publicPath) instead. `devServer.proxy` can be a string pointing to the development API server: - ```js + ``` js module.exports = { devServer: { - proxy: 'http://localhost:4000', - }, + proxy: 'http://localhost:4000' + } } ``` @@ -331,20 +332,20 @@ Deprecated since Vue CLI 3.3, please use [`publicPath`](#publicPath) instead. If you want to have more control over the proxy behavior, you can also use an object with `path: options` pairs. Consult [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware#proxycontext-config) for full options: - ```js + ``` js module.exports = { devServer: { proxy: { '^/api': { target: '', ws: true, - changeOrigin: true, + changeOrigin: true }, '^/foo': { - target: '', - }, - }, - }, + target: '' + } + } + } } ``` @@ -367,14 +368,14 @@ Deprecated since Vue CLI 3.3, please use [`publicPath`](#publicPath) instead. This is an object that doesn't go through any schema validation, so it can be used to pass arbitrary options to 3rd party plugins. For example: - ```js + ``` js module.exports = { pluginOptions: { foo: { // plugins can access these options as // `options.pluginOptions.foo`. - }, - }, + } + } } ``` From 916c66ba48a3263ce575878d9ad2e1fdfd36f8a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorsten=20L=C3=BCnborg?= Date: Fri, 8 Mar 2019 09:18:50 +0100 Subject: [PATCH 5/7] chore: remove space --- docs/config/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/config/README.md b/docs/config/README.md index f573b00362..35f15f78ef 100644 --- a/docs/config/README.md +++ b/docs/config/README.md @@ -56,7 +56,7 @@ Deprecated since Vue CLI 3.3, please use [`publicPath`](#publicPath) instead. ``` js module.exports = { - publicPath: process.env.NODE_ENV === 'production' + publicPath: process.env.NODE_ENV === 'production' ? '/production-sub-path/' : '/' } From a28060ecbe02e40f10bfb66223060693d93e2680 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Mon, 1 Apr 2019 18:38:20 +0800 Subject: [PATCH 6/7] style: indentation of chaining configuration --- packages/@vue/cli-plugin-eslint/index.js | 39 ++++++++++++------------ 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/packages/@vue/cli-plugin-eslint/index.js b/packages/@vue/cli-plugin-eslint/index.js index 71310a8b58..a93c459d34 100644 --- a/packages/@vue/cli-plugin-eslint/index.js +++ b/packages/@vue/cli-plugin-eslint/index.js @@ -40,25 +40,26 @@ module.exports = (api, options) => { webpackConfig.module .rule('eslint') - .pre() - .exclude.add(/node_modules/) - .add(require('path').dirname(require.resolve('@vue/cli-service'))) - .end() - .test(/\.(vue|(j|t)sx?)$/) - .use('eslint-loader') - .loader('eslint-loader') - .options({ - extensions, - cache: true, - cacheIdentifier, - emitWarning: allWarnings, - // only emit errors in production mode. - emitError: allErrors, - eslintPath: resolveModule('eslint', cwd) || require.resolve('eslint'), - formatter: - loadModule('eslint/lib/formatters/codeframe', cwd, true) || - require('eslint/lib/formatters/codeframe') - }) + .pre() + .exclude + .add(/node_modules/) + .add(require('path').dirname(require.resolve('@vue/cli-service'))) + .end() + .test(/\.(vue|(j|t)sx?)$/) + .use('eslint-loader') + .loader('eslint-loader') + .options({ + extensions, + cache: true, + cacheIdentifier, + emitWarning: allWarnings, + // only emit errors in production mode. + emitError: allErrors, + eslintPath: resolveModule('eslint', cwd) || require.resolve('eslint'), + formatter: + loadModule('eslint/lib/formatters/codeframe', cwd, true) || + require('eslint/lib/formatters/codeframe') + }) }) } From b30cffff6848ccbbc55078f275e2c65cc7b8e6aa Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Mon, 1 Apr 2019 18:40:24 +0800 Subject: [PATCH 7/7] style: remove extra whitespaces --- packages/@vue/cli-service/lib/options.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@vue/cli-service/lib/options.js b/packages/@vue/cli-service/lib/options.js index 3c182cef47..b99ed92542 100644 --- a/packages/@vue/cli-service/lib/options.js +++ b/packages/@vue/cli-service/lib/options.js @@ -51,7 +51,7 @@ const schema = createSchema(joi => joi.object({ ), // known runtime options for built-in plugins - lintOnSave: joi.any().valid([true, false, 'error', 'warning', 'default']), + lintOnSave: joi.any().valid([true, false, 'error', 'warning', 'default']), pwa: joi.object(), // 3rd party plugin options