Skip to content

Commit

Permalink
Remove useless code when lint is not chosen (vuejs-templates#1165)
Browse files Browse the repository at this point in the history
  • Loading branch information
Toilal authored and LinusBorg committed Dec 14, 2017
1 parent 9d1674d commit 1ee03c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions template/build/webpack.base.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function resolve (dir) {
return path.join(__dirname, '..', dir)
}

const createLintingRule = () => ({
{{#lint}}const createLintingRule = () => ({
test: /\.(js|vue)$/,
loader: 'eslint-loader',
enforce: 'pre',
Expand All @@ -17,7 +17,7 @@ const createLintingRule = () => ({
formatter: require('eslint-friendly-formatter'),
emitWarning: !config.dev.showEslintErrorsInOverlay
}
})
}){{/lint}}

module.exports = {
context: path.resolve(__dirname, '../'),
Expand Down
3 changes: 2 additions & 1 deletion template/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ module.exports = {
notifyOnErrors: true,
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-

// Use Eslint Loader?
{{#lint}}// Use Eslint Loader?
// If true, your code will be linted during bundling and
// linting errors and warnings will be shown in the console.
useEslint: true,
// If true, eslint errors and warnings will also be shown in the error overlay
// in the browser.
showEslintErrorsInOverlay: false,
{{/lint}}

/**
* Source Maps
Expand Down

0 comments on commit 1ee03c9

Please sign in to comment.