Skip to content

Remove useless code when lint is not chosen #1165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = () => ({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a call to that function further below in the rules section, that should be wrapped in the same handlebars check.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's already wrapped

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, my mistake. Thanks.

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