Last active
September 4, 2019 14:51
-
-
Save jiangnan-ten/02b5e9d0b97e478a1f0df2812b9e4904 to your computer and use it in GitHub Desktop.
eslint vue规则配置
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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