Skip to content

Instantly share code, notes, and snippets.

@jiangnan-ten
Last active September 4, 2019 14:51
Show Gist options
  • Select an option

  • Save jiangnan-ten/02b5e9d0b97e478a1f0df2812b9e4904 to your computer and use it in GitHub Desktop.

Select an option

Save jiangnan-ten/02b5e9d0b97e478a1f0df2812b9e4904 to your computer and use it in GitHub Desktop.
eslint vue规则配置
module.exports = {
root: true,
// 指定环境全局变量
env: {
browser: true
},
// 自定义的全局变量
globals: {
AMap: true,
noUiSlider: true,
html2canvas: true
},
extends: ['plugin:vue/essential', 'standard', 'prettier'],
plugins: ['prettier'],
settings: {
'import/resolver': {
webpack: {
config: 'build/webpack.base.conf.js'
}
}
},
rules: {
'prettier/prettier': [
'error',
{
singleQuote: true,
trailingComma: 'none',
semi: false,
useTabs: true,
printWidth: 110,
bracketSpacing: true,
endOfLine: 'auto'
}
],
'vue/no-parsing-error': [
2, {'x-invalid-end-tag': false}
],
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'eqeqeq': 'off',
'no-callback-literal': 'off',
'no-unused-vars': process.env.NODE_ENV === 'production' ? 'error' : 'off'
},
parserOptions: {
parser: 'babel-eslint'
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment