From 96884ef33662291e9f84d3309f1210d10e50f510 Mon Sep 17 00:00:00 2001 From: Konstantinos Paparas Date: Fri, 27 Sep 2024 17:34:18 +0200 Subject: [PATCH] feat: allow overrides for import rules --- src/configs/imports.ts | 4 ++-- src/factory.ts | 1 + src/types.ts | 5 +++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/configs/imports.ts b/src/configs/imports.ts index afe336d..ec519df 100644 --- a/src/configs/imports.ts +++ b/src/configs/imports.ts @@ -1,8 +1,8 @@ import { pluginAntfu, pluginImport } from '../plugins'; -import type { OptionsStylistic, TypedFlatConfigItem } from '../types'; +import type { OptionsOverrides, OptionsStylistic, TypedFlatConfigItem } from '../types'; export async function imports( - options: OptionsStylistic = {}, + options: OptionsStylistic & OptionsOverrides = {}, ): Promise { const { stylistic = true, diff --git a/src/factory.ts b/src/factory.ts index 1c7bfcb..a0df0fc 100644 --- a/src/factory.ts +++ b/src/factory.ts @@ -124,6 +124,7 @@ export function rotki( comments(), node(), imports({ + overrides: getOverrides(options, 'imports'), stylistic: stylisticOptions, }), diff --git a/src/types.ts b/src/types.ts index 275eafd..3b1eed8 100644 --- a/src/types.ts +++ b/src/types.ts @@ -263,6 +263,11 @@ export interface OptionsConfig extends OptionsComponentExts, OptionsProjectType */ jsx?: boolean; + /** + * Core rules. Can't be disabled; + */ + imports?: OptionsOverrides; + /** * Options for eslint-plugin-unicorn. *