UNPKG

fejn-eslint-vue

Version:

eslint-vue

85 lines (79 loc) 1.89 kB
'use strict'; const antfu = require('@antfu/eslint-config'); function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; } const antfu__default = /*#__PURE__*/_interopDefaultCompat(antfu); const index = (options, ...userConfigs) => { const ignores = options?.ignores || []; if (options?.ignores) { delete options?.ignores; } return antfu__default( { typescript: true, vue: true, stylistic: { indent: 4 }, formatters: { css: true, html: true, markdown: "prettier" }, ...options, ignores: [ ".vscode/**", ...ignores ] }, { rules: { "style/indent": ["error", 4], // 缩进空格 "style/semi": ["error", "always"], // 结尾分号 "curly": ["error", "all"], // 条件语句强制大括号 "style/brace-style": ["error", "1tbs"], "style/indent-binary-ops": ["error", 4], // 'antfu/top-level-function': 'off', // 每行最大长度 "max-len": ["error", { code: 150 }], // vue相关 "vue/html-indent": ["error", 4], // 属性数量 "vue/max-attributes-per-line": ["error", { singleline: { max: 2 }, multiline: { max: 1 } }], // ts 相关 "ts/ban-ts-comment": "off", // 注释长度限制 // 声明类型优先 type "ts/consistent-type-definitions": [ "error", "type" ] } }, { files: ["**/*.md", "**/*.json"], rules: { "max-len": ["off"] } }, { files: ["**/*.yaml"], rules: { "yaml/indent": ["error", 2] } }, ...userConfigs ); }; module.exports = index;