mirror of
https://github.com/withastro/astro.git
synced 2025-01-22 10:31:53 -05:00
[ci] format
This commit is contained in:
parent
ea603aec80
commit
1072c76703
4 changed files with 28 additions and 12 deletions
|
@ -73,12 +73,16 @@ export default function ({ include, exclude, compat, devtools }: Options = {}):
|
|||
},
|
||||
'astro:config:done': ({ logger, config }) => {
|
||||
const knownJsxRenderers = ['@astrojs/react', '@astrojs/preact', '@astrojs/solid-js'];
|
||||
const enabledKnownJsxRenderers = config.integrations.filter((renderer) => knownJsxRenderers.includes(renderer.name));
|
||||
const enabledKnownJsxRenderers = config.integrations.filter((renderer) =>
|
||||
knownJsxRenderers.includes(renderer.name),
|
||||
);
|
||||
|
||||
if (enabledKnownJsxRenderers.length > 1 && !include && !exclude) {
|
||||
logger.warn('More than one JSX renderer is enabled. This will lead to unexpected behavior unless you set the `include` or `exclude` option. See https://docs.astro.build/en/guides/integrations-guide/preact/#combining-multiple-jsx-frameworks for more information.');
|
||||
logger.warn(
|
||||
'More than one JSX renderer is enabled. This will lead to unexpected behavior unless you set the `include` or `exclude` option. See https://docs.astro.build/en/guides/integrations-guide/preact/#combining-multiple-jsx-frameworks for more information.',
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
|
@ -102,12 +102,16 @@ export default function ({
|
|||
},
|
||||
'astro:config:done': ({ logger, config }) => {
|
||||
const knownJsxRenderers = ['@astrojs/react', '@astrojs/preact', '@astrojs/solid-js'];
|
||||
const enabledKnownJsxRenderers = config.integrations.filter((renderer) => knownJsxRenderers.includes(renderer.name));
|
||||
const enabledKnownJsxRenderers = config.integrations.filter((renderer) =>
|
||||
knownJsxRenderers.includes(renderer.name),
|
||||
);
|
||||
|
||||
if (enabledKnownJsxRenderers.length > 1 && !include && !exclude) {
|
||||
logger.warn('More than one JSX renderer is enabled. This will lead to unexpected behavior unless you set the `include` or `exclude` option. See https://docs.astro.build/en/guides/integrations-guide/react/#combining-multiple-jsx-frameworks for more information.');
|
||||
logger.warn(
|
||||
'More than one JSX renderer is enabled. This will lead to unexpected behavior unless you set the `include` or `exclude` option. See https://docs.astro.build/en/guides/integrations-guide/react/#combining-multiple-jsx-frameworks for more information.',
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
|
@ -110,12 +110,16 @@ export default function (options: Options = {}): AstroIntegration {
|
|||
},
|
||||
'astro:config:done': ({ logger, config }) => {
|
||||
const knownJsxRenderers = ['@astrojs/react', '@astrojs/preact', '@astrojs/solid-js'];
|
||||
const enabledKnownJsxRenderers = config.integrations.filter((renderer) => knownJsxRenderers.includes(renderer.name));
|
||||
const enabledKnownJsxRenderers = config.integrations.filter((renderer) =>
|
||||
knownJsxRenderers.includes(renderer.name),
|
||||
);
|
||||
|
||||
if (enabledKnownJsxRenderers.length > 1 && !options.include && !options.exclude) {
|
||||
logger.warn('More than one JSX renderer is enabled. This will lead to unexpected behavior unless you set the `include` or `exclude` option. See https://docs.astro.build/en/guides/integrations-guide/solid-js/#combining-multiple-jsx-frameworks for more information.');
|
||||
logger.warn(
|
||||
'More than one JSX renderer is enabled. This will lead to unexpected behavior unless you set the `include` or `exclude` option. See https://docs.astro.build/en/guides/integrations-guide/solid-js/#combining-multiple-jsx-frameworks for more information.',
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
|
@ -162,13 +162,17 @@ export default function (options?: Options): AstroIntegration {
|
|||
if (!options?.jsx) return;
|
||||
|
||||
const knownJsxRenderers = ['@astrojs/react', '@astrojs/preact', '@astrojs/solid-js'];
|
||||
const enabledKnownJsxRenderers = config.integrations.filter((renderer) => knownJsxRenderers.includes(renderer.name));
|
||||
const enabledKnownJsxRenderers = config.integrations.filter((renderer) =>
|
||||
knownJsxRenderers.includes(renderer.name),
|
||||
);
|
||||
|
||||
// This error can only be thrown from here since Vue is an optional JSX renderer
|
||||
if (enabledKnownJsxRenderers.length > 1 && !options?.include && !options?.exclude) {
|
||||
logger.warn('More than one JSX renderer is enabled. This will lead to unexpected behavior unless you set the `include` or `exclude` option. See https://docs.astro.build/en/guides/integrations-guide/solid-js/#combining-multiple-jsx-frameworks for more information.');
|
||||
logger.warn(
|
||||
'More than one JSX renderer is enabled. This will lead to unexpected behavior unless you set the `include` or `exclude` option. See https://docs.astro.build/en/guides/integrations-guide/solid-js/#combining-multiple-jsx-frameworks for more information.',
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue