40 lines
		
	
	
		
			989 B
		
	
	
	
		
			JavaScript
		
	
	
	
		
		
			
		
	
	
			40 lines
		
	
	
		
			989 B
		
	
	
	
		
			JavaScript
		
	
	
	
|  | module.exports = { | ||
|  |   env: { | ||
|  |     browser: true, | ||
|  |     es2021: true, | ||
|  |     node: true, | ||
|  |   }, | ||
|  |   extends: ['eslint:recommended', '@vue/eslint-config-prettier'], | ||
|  |   parserOptions: { | ||
|  |     ecmaVersion: 2021, | ||
|  |     sourceType: 'module', | ||
|  |   }, | ||
|  |   globals: { | ||
|  |     uni: 'readonly', | ||
|  |     wx: 'readonly', | ||
|  |     plus: 'readonly', | ||
|  |     getCurrentPages: 'readonly', | ||
|  |     getApp: 'readonly', | ||
|  |   }, | ||
|  |   rules: { | ||
|  |     // Vue规则
 | ||
|  |     'vue/multi-word-component-names': 'off', | ||
|  |     'vue/no-unused-vars': 'error', | ||
|  |     'vue/valid-v-for': 'error', | ||
|  |     'vue/require-v-for-key': 'error', | ||
|  |     'vue/no-deprecated-filter': 'error', | ||
|  | 
 | ||
|  |     // JavaScript规则
 | ||
|  |     'no-unused-vars': 'warn', | ||
|  |     'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', | ||
|  |     'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', | ||
|  | 
 | ||
|  |     // 代码风格
 | ||
|  |     semi: ['error', 'never'], | ||
|  |     quotes: ['error', 'single'], | ||
|  |     'comma-dangle': ['error', 'only-multiline'], | ||
|  |     indent: ['error', 2], | ||
|  |     'eol-last': ['error', 'always'], | ||
|  |   }, | ||
|  | } |