Browse Source

【配置】eslint 规则:airbnb基础规则 + plugin:vue/vue3-strongly-recommended规则 + 自定义规则

master
xiaosi 1 year ago
parent
commit
d644e3f129
  1. 60
      .eslintrc.cjs
  2. 11782
      package-lock.json
  3. 1
      package.json

60
.eslintrc.cjs

@ -1,11 +1,59 @@
/* eslint-env node */
module.exports = {
root: true,
'extends': [
'plugin:vue/vue3-essential',
'eslint:recommended'
extends: [
'plugin:vue/vue3-strongly-recommended',
'eslint:recommended',
'airbnb-base',
],
parserOptions: {
ecmaVersion: 'latest'
}
}
ecmaVersion: 'latest',
},
rules: {
'no-console': 'warn',
'no-debugger': 'warn',
'vue/max-attributes-per-line': ['error', {
singleline: {
max: 6,
},
multiline: {
max: 6,
},
}],
'max-len': ['error', { code: 180 }],
indent: ['error', 4, {
SwitchCase: 1,
}],
'object-curly-newline': ['error', {
ObjectPattern: { multiline: true },
}],
'no-use-before-define': ['error', {
functions: false,
}],
'vue/script-indent': ['error', 4, {
baseIndent: 1,
switchCase: 1,
}],
'vue/html-indent': ['error', 4],
'vue/singleline-html-element-content-newline': 'off',
},
overrides: [
{
files: ['*.vue'],
rules: {
indent: 'off',
},
},
{
files: ['vite.config.js'],
rules: {
'import/no-extraneous-dependencies': 'off',
},
},
],
};

11782
package-lock.json

File diff suppressed because it is too large

1
package.json

@ -17,6 +17,7 @@
"@vitejs/plugin-vue": "^4.4.0",
"@vitejs/plugin-vue-jsx": "^3.0.2",
"eslint": "^8.49.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-vue": "^9.17.0",
"vite": "^4.4.11"
}

Loading…
Cancel
Save