Closed
Description
Tell us about your environment
- ESLint Version: 4.18.1
- eslint-plugin-vue Version: 4.3.0
- Node Version: v9.5.0
- Repo: https://github.com/mrzzcn/eslint-plugin-vue-issue-demo
- Quicklook https://asciinema.org/a/1jB955Be0InfZ21RT1dJ3GvBH
Please show your full configuration:
// https://eslint.org/docs/user-guide/configuring
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint'
},
env: {
browser: true,
},
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
extends: ['plugin:vue/essential', 'airbnb-base'],
// required to lint *.vue files
plugins: [
'vue'
],
// check if imports actually resolve
settings: {
'import/resolver': {
webpack: {
config: 'build/webpack.base.conf.js'
}
}
},
// add your custom rules here
rules: {
// don't require .vue extension when importing
'import/extensions': ['error', 'always', {
js: 'never',
vue: 'never'
}],
indent: 'off',
'vue/script-indent': ['error', 2, {
'baseIndent': 1,
'switchCase': 1,
'ignores': []
}],
// disallow reassignment of function parameters
// disallow parameter object manipulation except for specific exclusions
'no-param-reassign': ['error', {
props: true,
ignorePropertyModificationsFor: [
'state', // for vuex state
'acc', // for reduce accumulators
'e' // for e.returnvalue
]
}],
// allow optionalDependencies
'import/no-extraneous-dependencies': ['error', {
optionalDependencies: ['test/unit/index.js']
}],
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
}
}
What did you do? Please include the actual source code causing the issue.
router.beforeEach((to, from, next) => {
document.title = to.meta.title || document.title;
next();
});
What did you expect to happen? only work for vue files?
What actually happened? Please include the actual, raw output from ESLint. working for js file and in a wrong way.