@truenine/eslint9-config
Version:
ESLint 9 configuration package for Compose Client projects with TypeScript, Vue, and modern JavaScript support
1 lines • 3.72 kB
Source Map (JSON)
{"version":3,"file":"vue.cjs","names":[],"sources":["../../src/configs/vue.ts"],"sourcesContent":["import type {AntFuVueConfig} from '../types'\n\ntype VueOverrides = NonNullable<AntFuVueConfig['overrides']>\n\nconst attributeHyphenationIgnoreTags = ['i-', 'v-', 'v-bind']\nconst componentNameInTemplateCasingOptions = {\n ignores: ['router-view', 'router-link', 'scroll-view', 'custom-tabbar', 'custom-navbar'],\n registeredComponentsOnly: false\n}\nconst uniappVueOverrides: VueOverrides = {\n 'vue/attribute-hyphenation': ['error', 'always', {ignoreTags: attributeHyphenationIgnoreTags}],\n 'vue/component-name-in-template-casing': ['error', 'kebab-case', componentNameInTemplateCasingOptions]\n}\n\n/** Vue 默认配置 */\nexport const vueConfig: AntFuVueConfig = {\n vueVersion: 3,\n overrides: {\n 'vue/html-self-closing': ['error', {html: {void: 'always', normal: 'always', component: 'always'}}],\n 'vue/html-comment-content-spacing': ['error', 'always', {exceptions: []}],\n 'vue/html-comment-indent': ['error', 2],\n 'vue/html-indent': ['error', 2, {baseIndent: 0, alignAttributesVertically: true}],\n 'vue/define-emits-declaration': ['error', 'type-literal'],\n 'vue/define-props-declaration': ['error', 'type-based'],\n 'vue/define-macros-order': [\n 'error',\n {order: ['defineProps', 'defineEmits', 'defineModel', 'defineSlots'], defineExposeLast: true}\n ],\n 'vue/block-order': [\n 'error',\n {order: ['script', 'template', 'style']}\n ],\n 'vue/attributes-order': [\n 'error',\n {\n order: [\n 'DEFINITION',\n 'LIST_RENDERING',\n 'CONDITIONALS',\n 'RENDER_MODIFIERS',\n 'GLOBAL',\n 'UNIQUE',\n 'TWO_WAY_BINDING',\n 'OTHER_DIRECTIVES',\n 'OTHER_ATTR',\n 'EVENTS',\n 'CONTENT'\n ]\n }\n ],\n 'vue/v-on-event-hyphenation': ['error', 'never', {autofix: true}],\n 'vue/attribute-hyphenation': ['error', 'never', {ignoreTags: attributeHyphenationIgnoreTags}],\n 'vue/prop-name-casing': ['error', 'camelCase'],\n 'vue/component-name-in-template-casing': [\n 'error',\n 'PascalCase',\n componentNameInTemplateCasingOptions\n ]\n }\n}\n\nexport function applyUniappVueConfig(config: AntFuVueConfig): AntFuVueConfig {\n const overrides = config.overrides ?? {}\n return {\n ...config,\n overrides: {\n ...overrides,\n ...uniappVueOverrides\n }\n }\n}\n\n/** @deprecated 使用 vueConfig 代替 */\nexport const defaultVueConfig: AntFuVueConfig = vueConfig\n"],"mappings":";;;AAIA,MAAM,iCAAiC;CAAC;CAAM;CAAM;CAAS;AAC7D,MAAM,uCAAuC;CAC3C,SAAS;EAAC;EAAe;EAAe;EAAe;EAAiB;EAAgB;CACxF,0BAA0B;CAC3B;AACD,MAAM,qBAAmC;CACvC,6BAA6B;EAAC;EAAS;EAAU,EAAC,YAAY,gCAA+B;EAAC;CAC9F,yCAAyC;EAAC;EAAS;EAAc;EAAqC;CACvG;;AAGD,MAAa,YAA4B;CACvC,YAAY;CACZ,WAAW;EACT,yBAAyB,CAAC,SAAS,EAAC,MAAM;GAAC,MAAM;GAAU,QAAQ;GAAU,WAAW;GAAS,EAAC,CAAC;EACnG,oCAAoC;GAAC;GAAS;GAAU,EAAC,YAAY,EAAE,EAAC;GAAC;EACzE,2BAA2B,CAAC,SAAS,EAAE;EACvC,mBAAmB;GAAC;GAAS;GAAG;IAAC,YAAY;IAAG,2BAA2B;IAAK;GAAC;EACjF,gCAAgC,CAAC,SAAS,eAAe;EACzD,gCAAgC,CAAC,SAAS,aAAa;EACvD,2BAA2B,CACzB,SACA;GAAC,OAAO;IAAC;IAAe;IAAe;IAAe;IAAc;GAAE,kBAAkB;GAAK,CAC9F;EACD,mBAAmB,CACjB,SACA,EAAC,OAAO;GAAC;GAAU;GAAY;GAAQ,EAAC,CACzC;EACD,wBAAwB,CACtB,SACA,EACE,OAAO;GACL;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;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