12345678910111213141516171819202122232425262728 |
- /* eslint-env node */
- require('@rushstack/eslint-patch/modern-module-resolution')
- module.exports = {
- root: true,
- 'extends': [
- 'plugin:vue/vue3-essential',
- 'eslint:recommended',
- '@vue/eslint-config-typescript',
- '@vue/eslint-config-prettier/skip-formatting'
- ],
- parserOptions: {
- ecmaVersion: 'latest'
- },
- rules: {
- // ===============================>>> eslint (http://eslint.cn/docs/rules)
- 'no-var': 'error', // 要求使用 let 或 const 而不是 var
- 'prefer-const': 'off', // 使用 let 关键字声明但在初始分配后从未重新分配的变量,要求使用 const
- 'eqeqeq': 'warn', // 要求使用 === 和 !==
- // ===============================>>> typeScript (https://typescript-eslint.io/rules)
- 'no-undef': 'off', // 禁止使用未定义的变量
- // ===============================>>> vue (https://eslint.vuejs.org/rules)
- 'vue/no-mutating-props': ['error', {
- 'shallowOnly': true // 允许修改prop的值,但保持引用不变
- }],
- 'vue/multi-word-component-names': 'off' // 组件名强制使用短横线连接
- }
- }
|