diff --git a/packages/@o3r/eslint-plugin/src/rules/typescript/o3r-categories-tags/o3r-categories-tags.ts b/packages/@o3r/eslint-plugin/src/rules/typescript/o3r-categories-tags/o3r-categories-tags.ts index d3340db8c4..aa64e45721 100644 --- a/packages/@o3r/eslint-plugin/src/rules/typescript/o3r-categories-tags/o3r-categories-tags.ts +++ b/packages/@o3r/eslint-plugin/src/rules/typescript/o3r-categories-tags/o3r-categories-tags.ts @@ -12,7 +12,7 @@ type Messages = | 'notInConfigurationInterface' | 'suggestReplaceO3rCategory'; -export default createRule({ +export default createRule<[O3rCategoriesTagsRuleOption, ...any], Messages>({ name: 'o3r-categories-tags', meta: { hasSuggestions: true, @@ -37,7 +37,8 @@ export default createRule({ type: 'array', items: { type: 'string' - } + }, + default: [] } } } @@ -50,14 +51,11 @@ export default createRule({ suggestReplaceO3rCategory: 'Replace {{ currentCategory }} by {{ suggestedCategory }}.' } }, - defaultOptions: [], - create: (context) => { - const options: Required = context.options - .reduce((acc: Required, option) => { - acc.supportedInterfaceNames = (acc.supportedInterfaceNames || []).concat(option.supportedInterfaceNames || []); - acc.globalConfigCategories = (acc.globalConfigCategories || []).concat(option.globalConfigCategories || []); - return acc; - }, { globalConfigCategories: [], supportedInterfaceNames: [] }); + defaultOptions: [{ + supportedInterfaceNames: defaultSupportedInterfaceNames, + globalConfigCategories: [] + }], + create: (context, [options]: [Required]) => { const globalConfigCategories = new Set(options.globalConfigCategories); return { // eslint-disable-next-line @typescript-eslint/naming-convention