From c62102b8080ecb026cf98b197cde70993fd98cf5 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Wed, 21 Aug 2024 16:54:02 +0200 Subject: [PATCH] feat: print hint message when running in editor --- src/factory.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/factory.ts b/src/factory.ts index 150ece2124..812753f5e9 100644 --- a/src/factory.ts +++ b/src/factory.ts @@ -86,7 +86,6 @@ export function antfu( autoRenamePlugins = true, componentExts = [], gitignore: enableGitignore = true, - isInEditor = isInEditorEnv(), jsx: enableJsx = true, react: enableReact = false, regexp: enableRegexp = true, @@ -97,6 +96,14 @@ export function antfu( vue: enableVue = VuePackages.some(i => isPackageExists(i)), } = options + let isInEditor = options.isInEditor + if (isInEditor == null) { + isInEditor = isInEditorEnv() + if (isInEditor) + // eslint-disable-next-line no-console + console.log('[@antfu/eslint-config] Detected running in editor, some rules are disabled.') + } + const stylisticOptions = options.stylistic === false ? false : typeof options.stylistic === 'object'