diff --git a/src/configs/vue.ts b/src/configs/vue.ts index 46f9e4a..651429e 100644 --- a/src/configs/vue.ts +++ b/src/configs/vue.ts @@ -118,8 +118,12 @@ const vueTypeScriptRules: FlatConfigItem['rules'] = { } -const vueDefaultOverrideRules: FlatConfigItem['rules'] = { +const vueDefaultOverrideRules = (ruleOptions: NonNullable): FlatConfigItem['rules'] => ({ // Priority A: Essential + 'vue/multi-word-component-names': [ + 'error', + { ignores: ruleOptions.multiWordComponentNames?.ignores } + ], 'vue/no-arrow-functions-in-watch': 'off', 'vue/no-reserved-component-names': [ 'error', @@ -167,7 +171,7 @@ const vueDefaultOverrideRules: FlatConfigItem['rules'] = { // Priority C: Recommended 'vue/order-in-components': 'off' -} +}) const vueStylisticRules: FlatConfigItem['rules'] = { @@ -339,7 +343,8 @@ export const vue = async (options: VueOptions = {}): Promise = files = [GLOB_VUE], typescript = false, accessibility = {}, - overrides + overrides, + ruleOptions = {} } = options @@ -386,7 +391,7 @@ export const vue = async (options: VueOptions = {}): Promise = rules: { ...vueRules(pluginVue, options), ...typescript && vueTypeScriptRules, - ...vueDefaultOverrideRules, + ...vueDefaultOverrideRules(ruleOptions), ...vueStylisticRules, ...!!accessibility && vueAccessibilityRules(accessibility), ...overrides?.vue, diff --git a/src/types.ts b/src/types.ts index 309d5a7..f044d0d 100644 --- a/src/types.ts +++ b/src/types.ts @@ -245,6 +245,20 @@ export interface OptionsVue extends OptionsHasTypeScript, OptionsFiles { * This will be combined with `globalComponents`. */ extraGlobalComponentsWithRegex?: string[] + + /** + * Optional settings for rules. + */ + ruleOptions?: { + /** + * For `vue/multi-word-component-names` rule. + * + * @see https://eslint.vuejs.org/rules/multi-word-component-names.html + */ + multiWordComponentNames?: { + ignores?: string[] + } + } }