You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
shop-admin/.eslintrc.js

131 lines
3.7 KiB

module.exports = {
root: true,
env: {
es6: true,
node: true,
browser: true,
},
extends: ['eslint:recommended', 'plugin:vue/vue3-recommended', 'plugin:prettier/recommended', '@vue/prettier'],
parser: 'vue-eslint-parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
impliedStrict: true,
},
},
rules: {
'no-alert': 'warn',
'no-debugger': 'warn',
'no-undef': 'error',
'no-else-return': 'error',
'no-console': 'off',
'vue/no-v-html': 'off',
'vue/html-self-closing': [
'error',
{
html: {
void: 'any',
normal: 'any',
component: 'always',
},
svg: 'always',
math: 'always',
},
],
'vue/multi-word-component-names': 'off',
'vue/order-in-components': [
'warn',
{
order: [
'el',
'name',
'key',
'parent',
'functional',
['delimiters', 'comments'],
['components', 'directives', 'filters'],
'extends',
'mixins',
['provide', 'inject'],
'ROUTER_GUARDS',
'layout',
'middleware',
'validate',
'scrollToTop',
'transition',
'loading',
'inheritAttrs',
'model',
['props', 'propsData'],
'emits',
'setup',
'fetch',
'asyncData',
'data',
'head',
'computed',
'watch',
'watchQuery',
'LIFECYCLE_HOOKS',
'methods',
['template', 'render'],
'renderError',
],
},
],
'vue/attributes-order': [
'warn',
{
order: [
'DEFINITION',
'LIST_RENDERING',
'CONDITIONALS',
'RENDER_MODIFIERS',
'GLOBAL',
'UNIQUE',
'TWO_WAY_BINDING',
'OTHER_DIRECTIVES',
'OTHER_ATTR',
'EVENTS',
'CONTENT',
],
alphabetical: true, //字母顺序
},
],
// 'prettier/prettier': [
// 'error',
// {
// printWidth: 120,
// tabWidth: 4,
// useTabs: false,
// semi: true,
// singleQuote: true,
// quoteProps: 'as-needed',
// jsxSingleQuote: false,
// trailingComma: 'es5',
// bracketSpacing: true,
// bracketSameLine: false,
// arrowParens: 'always',
// htmlWhitespaceSensitivity: 'ignore',
// vueIndentScriptAndStyle: true,
// endOfLine: 'auto',
// },
// {
// usePrettierrc: true,
// },
// ],
indent: [0, 4],
eqeqeq: [2, 'always'],
semi: [2, 'always'],
quotes: [2, 'single'],
},
globals: {
arguments: true,
defineProps: true,
defineEmits: true,
defineExpose: true,
},
};