fix(preset-classic): throw if preset finds GA options in theme config (#6284)

* fix(preset-classic): throw if preset finds GA options in theme config

* revert

* stricter
This commit is contained in:
Joshua Chen 2022-01-07 12:50:45 +08:00 committed by GitHub
parent e231359f84
commit 37a84f86a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 4 deletions

View file

@ -82,7 +82,7 @@ export function validateOptions({
export function validateThemeConfig({
themeConfig,
}: ThemeConfigValidationContext<ThemeConfig>): ValidationResult<ThemeConfig> {
if (themeConfig.googleAnalytics) {
if ('googleAnalytics' in themeConfig) {
throw new Error(
'The "googleAnalytics" field in themeConfig should now be specified as option for plugin-google-analytics. More information at https://github.com/facebook/docusaurus/pull/5832.',
);