Repository: Redocly/redocly-cli
Pull request #847 (2022-09-02 17:41:55)

chore: flatten configuration file by removing styleguide object
## What/Why/How?

Closes https://github.com/Redocly/redocly-cli/issues/833

## Reference

Related to https://github.com/Redocly/marketing-site-portal/pull/986

## Testing



## Screenshots (optional)

## Check yourself

- [x] Code is linted
- [x] Tested with redoc/reference-docs/workflows
- [x] All new/updated code is covered with tests

## Security

- [x] Security impact of change has been considered
- [x] Code follows company security practices and guidelines


github-actions[bot]: <!-- jest coverage report action for options with hash 3339ae53a38c44382c0fb4491bdb282d -->

## Coverage report 



| <div title="Status of coverage:&#10; 🟢 - ok&#10; 🟡 - slightly more than threshold&#10; 🔴 - under the threshold">St.<sup>:grey_question:</sup></div> | Category   | Percentage | Covered / Total |
| :----------------------------------------------------------------------------------------------------------------------------------------------------: | :--------- | :--------- | :-------------: |
|                                                                           🟡                                                                           | Statements | 72.33%     |    3124/4319    |
|                                                                           🟡                                                                           | Branches   | 64.33%     |    1701/2644    |
|                                                                           🟡                                                                           | Functions  | 64.23%     |     510/794     |
|                                                                           🟡                                                                           | Lines      | 72.32%     |    2905/4017    |


<details><summary>Show files with reduced coverage 🔻</summary>
<br/>

| <div title="Status of coverage:&#10; 🟢 - ok&#10; 🟡 - slightly more than threshold&#10; 🔴 - under the threshold">St.<sup>:grey_question:</sup></div> | File                                                         | Statements | Branches | Functions | Lines  |
| :----------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------- | :--------- | :------- | :-------- | :----- |
|                                                                           🟢                                                                           | <div title="core/src/config/utils.ts">`...` / utils.ts</div> | 98.02%     | 90.99%   | 100%      | 97.87% |

</details>

## Test suite run success
481 tests passing in 82 suites.

<p align="right">Report generated by <a href="https://github.com/ArtiomTr/jest-coverage-report-action">🧪jest coverage report action</a> from 51f894971460c28a6bf8f88cfd6cb42e5174abf2</p>


Patch:
diff --git a/jest.config.js b/jest.config.js
index 5f99a47f..3773a000 100644
--- a/jest.config.js
+++ b/jest.config.js
@@ -18,10 +18,10 @@ module.exports = {
       lines: 79,
     },
     'packages/cli/': {
-      statements: 37,
-      branches: 31,
-      functions: 32,
-      lines: 38,
+      statements: 51,
+      branches: 40,
+      functions: 47,
+      lines: 52,
     },
   },
   testMatch: ['**/__tests__/**/*.test.ts', '**/*.test.ts'],
diff --git a/packages/core/src/config/config-resolvers.ts b/packages/core/src/config/config-resolvers.ts
index 52c0696d..3d29cfdd 100644
--- a/packages/core/src/config/config-resolvers.ts
+++ b/packages/core/src/config/config-resolvers.ts
@@ -21,7 +21,7 @@ import type {
   DeprecatedInRawConfig,
 } from './types';
 import { isBrowser } from '../env';
-import { isNotString, isString, notUndefined, parseYaml } from '../utils';
+import { isNotString, isString, isDefined, parseYaml } from '../utils';
 import { Config } from './config';
 import { colorize, logger } from '../logger';
 
@@ -177,7 +177,7 @@ export function resolvePlugins(
 
       return plugin;
     })
-    .filter(notUndefined);
+    .filter(isDefined);
 }
 
 export async function resolveApis({
diff --git a/packages/core/src/config/load.ts b/packages/core/src/config/load.ts
index 582a1b2e..cd632ac4 100644
--- a/packages/core/src/config/load.ts
+++ b/packages/core/src/config/load.ts
@@ -7,7 +7,7 @@ import { Config, DOMAINS } from './config';
 import { transformConfig } from './utils';
 import { resolveConfig } from './config-resolvers';
 
-import type { DeprecatedInRawConfig, RawConfig, Region } from './types';
+import type { DeprecatedInRawConfig, FlatRawConfig, RawConfig, Region } from './types';
 import { RegionalTokenWithValidity } from '../redocly/redocly-client-types';
 
 async function addConfigMetadata({
@@ -102,7 +102,8 @@ export function findConfig(dir?: string): string | undefined {
 export async function getConfig(configPath: string | undefined = findConfig()): Promise<RawConfig> {
   if (!configPath || !doesYamlFileExist(configPath)) return {};
   try {
-    const rawConfig = (await loadYaml<RawConfig & DeprecatedInRawConfig>(configPath)) || {};
+    const rawConfig =
+      (await loadYaml<RawConfig & DeprecatedInRawConfig & FlatRawConfig>(configPath)) || {};
     return transformConfig(rawConfig);
   } catch (e) {
     throw new Error(`Error parsing config file at '${configPath}': ${e.message}`);
diff --git a/packages/core/src/config/rules.ts b/packages/core/src/config/rules.ts
index f6cc510f..543f4848 100644
--- a/packages/core/src/config/rules.ts
+++ b/packages/core/src/config/rules.ts
@@ -1,6 +1,6 @@
 import { RuleSet, OasVersion } from '../oas-types';
 import { StyleguideConfig } from './config';
-import { notUndefined } from '../utils';
+import { isDefined } from '../utils';
 
 export function initRules<T extends Function, P extends RuleSet<T>>(
   rules: P[],
@@ -42,5 +42,5 @@ export function initRules<T extends Function, P extends RuleSet<T>>(
       })
     )
     .flatMap((visitor) => visitor)
-    .filter(notUndefined);
+    .filter(isDefined);
 }
diff --git a/packages/core/src/config/types.ts b/packages/core/src/config/types.ts
index 00ecae2b..69ecc769 100644
--- a/packages/core/src/config/types.ts
+++ b/packages/core/src/config/types.ts
@@ -110,6 +110,7 @@ export type ResolveHeader =
 
 export type RawResolveConfig = {
   http?: Partial<HttpResolveConfig>;
+  doNotResolveExamples?: boolean;
 };
 
 export type HttpResolveConfig = {
@@ -128,6 +129,7 @@ export type AccessTokens = { [region in Region]?: string };
 export type DeprecatedInRawConfig = {
   apiDefinitions?: Record<string, string>;
   lint?: StyleguideRawConfig;
+  styleguide?: StyleguideRawConfig;
   referenceDocs?: Record<string, any>;
   apis?: Record<string, Api & DeprecatedInApi>;
 };
@@ -153,6 +155,15 @@ export type RawConfig = {
   organization?: string;
 } & FeaturesConfig;
 
+export type FlatApi = Omit<Api, 'styleguide'> &
+  Omit<ApiStyleguideRawConfig, 'doNotResolveExamples'>;
+
+export type FlatRawConfig = Omit<RawConfig, 'styleguide' | 'resolve' | 'apis'> &
+  Omit<StyleguideRawConfig, 'doNotResolveExamples'> & {
+    resolve?: RawResolveConfig;
+    apis?: Record<string, FlatApi>;
+  };
+
 export type ResolvedConfig = Omit<RawConfig, 'apis' | 'styleguide'> & {
   apis: Record<string, ResolvedApi>;
   styleguide: ResolvedStyleguideConfig;
diff --git a/packages/core/src/config/utils.ts b/packages/core/src/config/utils.ts
index 58590956..49254bd6 100644
--- a/packages/core/src/config/utils.ts
+++ b/packages/core/src/config/utils.ts
@@ -1,21 +1,24 @@
 import {
   assignExisting,
+  isDefined,
   isTruthy,
   showErrorForDeprecatedField,
   showWarningForDeprecatedField,
 } from '../utils';
 import { Config } from './config';
-
 import type {
   Api,
   DeprecatedInApi,
   DeprecatedInRawConfig,
+  FlatApi,
+  FlatRawConfig,
   Plugin,
   RawConfig,
   RawResolveConfig,
   ResolveConfig,
   ResolvedStyleguideConfig,
   RulesFields,
+  StyleguideRawConfig,
 } from './types';
 import { logger, colorize } from '../logger';
 
@@ -39,13 +42,86 @@ export function transformApiDefinitionsToApis(
   return apis;
 }
 
+function extractFlatConfig<
+  T extends Partial<
+    (Api & DeprecatedInApi & FlatApi) & (DeprecatedInRawConfig & RawConfig & FlatRawConfig)
+  >
+>({
+  plugins,
+  extends: _extends,
+
+  rules,
+  oas2Rules,
+  oas3_0Rules,
+  oas3_1Rules,
+
+  preprocessors,
+  oas2Preprocessors,
+  oas3_0Preprocessors,
+  oas3_1Preprocessors,
+
+  decorators,
+  oas2Decorators,
+  oas3_0Decorators,
+  oas3_1Decorators,
+
+  ...rawConfigRest
+}: T): {
+  styleguideConfig?: StyleguideRawConfig;
+  rawConfigRest: Omit<T, 'plugins' | 'extends' | RulesFields>;
+} {
+  const styleguideConfig = {
+    plugins,
+    extends: _extends,
+
+    rules,
+    oas2Rules,
+    oas3_0Rules,
+    oas3_1Rules,
+
+    preprocessors,
+    oas2Preprocessors,
+    oas3_0Preprocessors,
+    oas3_1Preprocessors,
+
+    decorators,
+    oas2Decorators,
+    oas3_0Decorators,
+    oas3_1Decorators,
+
+    doNotResolveExamples: (rawConfigRest as FlatRawConfig).resolve?.doNotResolveExamples,
+  };
+
+  if (
+    (rawConfigRest.lint && rawConfigRest.styleguide) ||
+    (Object.values(styleguideConfig).some(isDefined) &&
+      (rawConfigRest.lint || rawConfigRest.styleguide))
+  ) {
+    throw new Error(
+      `Do not use 'lint', 'styleguide' and flat syntax together. \nSee more about the configuration in the docs: https://redocly.com/docs/cli/configuration/ \n`
+    );
+  }
+
+  return {
+    styleguideConfig: Object.values(styleguideConfig).some(isDefined)
+      ? styleguideConfig
+      : undefined,
+
+    rawConfigRest,
+  };
+}
+
 function transformApis(
-  legacyApis?: Record<string, Api & DeprecatedInApi>
+  legacyApis?: Record<string, Api & DeprecatedInApi & FlatApi>
 ): Record<string, Api> | undefined {
   if (!legacyApis) return undefined;
   const apis: Record<string, Api> = {};
   for (const [apiName, { lint, ...apiContent }] of Object.entries(legacyApis)) {
-    apis[apiName] = { styleguide: lint, ...apiContent };
+    const { styleguideConfig, rawConfigRest } = extractFlatConfig(apiContent);
+    apis[apiName] = {
+      styleguide: styleguideConfig || lint,
+      ...rawConfigRest,
+    };
   }
   return apis;
 }
@@ -165,17 +241,22 @@ export function getMergedConfig(config: Config, apiName?: string): Config {
 }
 
 function checkForDeprecatedFields(
-  deprecatedField: keyof DeprecatedInRawConfig,
-  updatedField: keyof RawConfig,
-  rawConfig: DeprecatedInRawConfig & RawConfig
+  deprecatedField: keyof (DeprecatedInRawConfig & RawConfig),
+  updatedField: keyof FlatRawConfig | undefined,
+  rawConfig: DeprecatedInRawConfig & RawConfig & FlatRawConfig
 ): void {
   const isDeprecatedFieldInApis =
     rawConfig.apis &&
     Object.values(rawConfig.apis).some(
-      (api: Api & DeprecatedInApi & DeprecatedInRawConfig) => api[deprecatedField]
+      (api: Api & FlatApi & DeprecatedInApi & DeprecatedInRawConfig & RawConfig & FlatRawConfig) =>
+        api[deprecatedField]
     );
 
-  if (rawConfig[deprecatedField] && rawConfig[updatedField]) {
+  if (rawConfig[deprecatedField] && updatedField === null) {
+    showWarningForDeprecatedField(deprecatedField);
+  }
+
+  if (rawConfig[deprecatedField] && updatedField && rawConfig[updatedField]) {
     showErrorForDeprecatedField(deprecatedField, updatedField);
   }
 
@@ -184,11 +265,17 @@ function checkForDeprecatedFields(
   }
 }
 
-export function transformConfig(rawConfig: DeprecatedInRawConfig & RawConfig): RawConfig {
-  const migratedFields: [keyof DeprecatedInRawConfig, keyof RawConfig][] = [
+export function transformConfig(
+  rawConfig: DeprecatedInRawConfig & RawConfig & FlatRawConfig
+): RawConfig {
+  const migratedFields: [
+    keyof (DeprecatedInRawConfig & RawConfig),
+    keyof FlatRawConfig | undefined
+  ][] = [
     ['apiDefinitions', 'apis'],
     ['referenceDocs', 'features.openapi'],
-    ['lint', 'styleguide'], // TODO: update docs
+    ['lint', undefined],
+    ['styleguide', undefined],
   ];
 
   for (const [deprecatedField, updatedField] of migratedFields) {
@@ -197,11 +284,13 @@ export function transformConfig(rawConfig: DeprecatedInRawConfig & RawConfig): R
 
   const { apis, apiDefinitions, referenceDocs, lint, ...rest } = rawConfig;
 
+  const { styleguideConfig, rawConfigRest } = extractFlatConfig(rest);
+
   return {
     'features.openapi': referenceDocs,
     apis: transformApis(apis) || transformApiDefinitionsToApis(apiDefinitions),
-    styleguide: lint,
-    ...rest,
+    styleguide: styleguideConfig || lint,
+    ...rawConfigRest,
   };
 }
 
diff --git a/packages/core/src/types/redocly-yaml.ts b/packages/core/src/types/redocly-yaml.ts
index 371bb7f8..45885ce5 100644
--- a/packages/core/src/types/redocly-yaml.ts
+++ b/packages/core/src/types/redocly-yaml.ts
@@ -1,5 +1,6 @@
 import { NodeType, listOf } from '.';
 import { omitObjectProps, pickObjectProps, isCustomRuleId } from '../utils';
+
 const builtInRulesList = [
   'spec',
   'info-description',
@@ -109,6 +110,39 @@ const nodeTypesList = [
   'WebhooksMap',
 ];
 
+const ConfigStyleguide: NodeType = {
+  properties: {
+    extends: {
+      type: 'array',
+      items: {
+        type: 'string',
+      },
+    },
+    rules: 'Rules',
+    oas2Rules: 'Rules',
+    oas3_0Rules: 'Rules',
+    oas3_1Rules: 'Rules',
+    preprocessors: { type: 'object' },
+    oas2Preprocessors: { type: 'object' },
+    oas3_0Preprocessors: { type: 'object' },
+    oas3_1Preprocessors: { type: 'object' },
+    decorators: { type: 'object' },
+    oas2Decorators: { type: 'object' },
+    oas3_0Decorators: { type: 'object' },
+    oas3_1Decorators: { type: 'object' },
+  },
+};
+
+const RootConfigStyleguide: NodeType = {
+  properties: {
+    plugins: {
+      type: 'array',
+      items: { type: 'string' },
+    },
+    ...ConfigStyleguide.properties,
+  },
+};
+
 const ConfigRoot: NodeType = {
   properties: {
     organization: { type: 'string' },
@@ -118,7 +152,8 @@ const ConfigRoot: NodeType = {
       properties: {},
       additionalProperties: { properties: { type: 'string' } },
     }, // deprecated
-    styleguide: 'RootConfigStyleguide',
+    ...RootConfigStyleguide.properties,
+    styleguide: 'RootConfigStyleguide', // deprecated
     lint: 'RootConfigStyleguide', // deprecated
     'features.openapi': 'ConfigReferenceDocs',
     referenceDocs: 'ConfigReferenceDocs', // deprecated
@@ -127,6 +162,7 @@ const ConfigRoot: NodeType = {
     resolve: {
       properties: {
         http: 'ConfigHTTP',
+        doNotResolveExamples: { type: 'boolean' },
       },
     },
   },
@@ -146,7 +182,9 @@ const ConfigApisProperties: NodeType = {
         type: 'string',
       },
     },
-    styleguide: 'ConfigStyleguide',
+    lint: 'ConfigStyleguide', // deprecated
+    styleguide: 'ConfigStyleguide', // deprecated
+    ...ConfigStyleguide.properties,
     'features.openapi': 'ConfigReferenceDocs',
     'features.mockServer': 'ConfigMockServer',
   },
@@ -164,40 +202,6 @@ const ConfigHTTP: NodeType = {
   },
 };
 
-const ConfigStyleguide: NodeType = {
-  properties: {
-    extends: {
-      type: 'array',
-      items: {
-        type: 'string',
-      },
-    },
-    doNotResolveExamples: { type: 'boolean' },
-    rules: 'Rules',
-    oas2Rules: 'Rules',
-    oas3_0Rules: 'Rules',
-    oas3_1Rules: 'Rules',
-    preprocessors: { type: 'object' },
-    oas2Preprocessors: { type: 'object' },
-    oas3_0Preprocessors: { type: 'object' },
-    oas3_1Preprocessors: { type: 'object' },
-    decorators: { type: 'object' },
-    oas2Decorators: { type: 'object' },
-    oas3_0Decorators: { type: 'object' },
-    oas3_1Decorators: { type: 'object' },
-  },
-};
-
-const RootConfigStyleguide: NodeType = {
-  properties: {
-    plugins: {
-      type: 'array',
-      items: { type: 'string' },
-    },
-    ...ConfigStyleguide.properties,
-  },
-};
-
 const Rules: NodeType = {
   properties: {},
   additionalProperties: (value: unknown, key: string) => {
diff --git a/packages/core/src/utils.ts b/packages/core/src/utils.ts
index 98c46742..14c0e8e2 100644
--- a/packages/core/src/utils.ts
+++ b/packages/core/src/utils.ts
@@ -33,7 +33,7 @@ export async function loadYaml<T>(filename: string): Promise<T> {
   return parseYaml(contents) as T;
 }
 
-export function notUndefined<T>(x: T | undefined): x is T {
+export function isDefined<T>(x: T | undefined): x is T {
   return x !== undefined;
 }
 
@@ -206,16 +206,20 @@ export function doesYamlFileExist(filePath: string): boolean {
   );
 }
 
-export function showWarningForDeprecatedField(deprecatedField: string, updatedField: string) {
+export function showWarningForDeprecatedField(deprecatedField: string, updatedField?: string) {
   logger.warn(
-    `The ${colorize.red(deprecatedField)} field is deprecated. Use ${colorize.green(
-      updatedField
-    )} instead. Read more about this change: https://redocly.com/docs/api-registry/guides/migration-guide-config-file/#changed-properties\n`
+    `The '${colorize.red(deprecatedField)}' field is deprecated. ${
+      updatedField ? `Use ${colorize.green(updatedField)} instead. ` : ''
+    }Read more about this change: https://redocly.com/docs/api-registry/guides/migration-guide-config-file/#changed-properties\n`
   );
 }
 
-export function showErrorForDeprecatedField(deprecatedField: string, updatedField: string) {
-  throw new Error(`Do not use '${deprecatedField}' field. Use '${updatedField}' instead.\n`);
+export function showErrorForDeprecatedField(deprecatedField: string, updatedField?: string) {
+  throw new Error(
+    `Do not use '${deprecatedField}' field. ${
+      updatedField ? `Use '${updatedField}' instead. ` : ''
+    }\n`
+  );
 }
 
 export type Falsy = undefined | null | false | '' | 0;


Test patch:
diff --git a/__tests__/bundle/bundle-lint-format/.redocly.yaml b/__tests__/bundle/bundle-lint-format/.redocly.yaml
index 9293f01f..cc560ae2 100644
--- a/__tests__/bundle/bundle-lint-format/.redocly.yaml
+++ b/__tests__/bundle/bundle-lint-format/.redocly.yaml
@@ -1,6 +1,5 @@
 apis:
   main:
     root: ./openapi.yaml
-styleguide:
-  extends: 
-    - recommended
+extends:
+  - recommended
diff --git a/__tests__/bundle/bundle-remove-unused-components/oas2/.redocly.yaml b/__tests__/bundle/bundle-remove-unused-components/oas2/.redocly.yaml
index f649def3..7be72e95 100644
--- a/__tests__/bundle/bundle-remove-unused-components/oas2/.redocly.yaml
+++ b/__tests__/bundle/bundle-remove-unused-components/oas2/.redocly.yaml
@@ -2,6 +2,5 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  decorators:
-    remove-x-internal: on
+decorators:
+  remove-x-internal: on
diff --git a/__tests__/bundle/bundle-remove-unused-components/oas3/.redocly.yaml b/__tests__/bundle/bundle-remove-unused-components/oas3/.redocly.yaml
index f649def3..7be72e95 100644
--- a/__tests__/bundle/bundle-remove-unused-components/oas3/.redocly.yaml
+++ b/__tests__/bundle/bundle-remove-unused-components/oas3/.redocly.yaml
@@ -2,6 +2,5 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  decorators:
-    remove-x-internal: on
+decorators:
+  remove-x-internal: on
diff --git a/__tests__/bundle/info-description-override-error/.redocly.yaml b/__tests__/bundle/info-description-override-error/.redocly.yaml
index 18e5767f..94dcf8dc 100644
--- a/__tests__/bundle/info-description-override-error/.redocly.yaml
+++ b/__tests__/bundle/info-description-override-error/.redocly.yaml
@@ -2,8 +2,7 @@ apis:
   main:
     root: ./main.yaml
 
-styleguide:
-  decorators:
-    info-description-override:
-      filePath: ./test.md
-  extends: []
+decorators:
+  info-description-override:
+    filePath: ./test.md
+extends: []
diff --git a/__tests__/bundle/info-description-override/.redocly.yaml b/__tests__/bundle/info-description-override/.redocly.yaml
index 18e5767f..94dcf8dc 100644
--- a/__tests__/bundle/info-description-override/.redocly.yaml
+++ b/__tests__/bundle/info-description-override/.redocly.yaml
@@ -2,8 +2,7 @@ apis:
   main:
     root: ./main.yaml
 
-styleguide:
-  decorators:
-    info-description-override:
-      filePath: ./test.md
-  extends: []
+decorators:
+  info-description-override:
+    filePath: ./test.md
+extends: []
diff --git a/__tests__/bundle/max-problems-argument/.redocly.yaml b/__tests__/bundle/max-problems-argument/.redocly.yaml
index a440ca35..0182a2b2 100644
--- a/__tests__/bundle/max-problems-argument/.redocly.yaml
+++ b/__tests__/bundle/max-problems-argument/.redocly.yaml
@@ -4,6 +4,5 @@ apis:
   bar:
     root: ./bar.yaml
 
-styleguide:
-  extends: 
-    - recommended
+extends: 
+  - recommended
diff --git a/__tests__/bundle/operation-description-override-error/.redocly.yaml b/__tests__/bundle/operation-description-override-error/.redocly.yaml
index 9606d756..c221030d 100644
--- a/__tests__/bundle/operation-description-override-error/.redocly.yaml
+++ b/__tests__/bundle/operation-description-override-error/.redocly.yaml
@@ -2,9 +2,8 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  decorators:
-    operation-description-override:
-      operationIds:
-        updatePet: ./update-pet-operation-description.md
-  extends: []
+decorators:
+  operation-description-override:
+    operationIds:
+      updatePet: ./update-pet-operation-description.md
+extends: []
diff --git a/__tests__/bundle/operation-description-override/.redocly.yaml b/__tests__/bundle/operation-description-override/.redocly.yaml
index 3bc3c11d..eeeaaa47 100644
--- a/__tests__/bundle/operation-description-override/.redocly.yaml
+++ b/__tests__/bundle/operation-description-override/.redocly.yaml
@@ -2,10 +2,9 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  decorators:
-    operation-description-override:
-      operationIds:
-        updatePet: ./update-pet-operation-description.md
-        createUser: ./create-user-operation-description.md
-  extends: []
+decorators:
+  operation-description-override:
+    operationIds:
+      updatePet: ./update-pet-operation-description.md
+      createUser: ./create-user-operation-description.md
+extends: []
diff --git a/__tests__/bundle/tag-description-override-error/.redocly.yaml b/__tests__/bundle/tag-description-override-error/.redocly.yaml
index a5977952..e2b892e0 100644
--- a/__tests__/bundle/tag-description-override-error/.redocly.yaml
+++ b/__tests__/bundle/tag-description-override-error/.redocly.yaml
@@ -2,9 +2,8 @@ apis:
   main:
     root: ./main.yaml
 
-styleguide:
-  decorators:
-    tag-description-override:
-      tagNames:
-        pet: ./pet-tag-description.md
-  extends: []
+decorators:
+  tag-description-override:
+    tagNames:
+      pet: ./pet-tag-description.md
+extends: []
diff --git a/__tests__/bundle/tag-description-override/.redocly.yaml b/__tests__/bundle/tag-description-override/.redocly.yaml
index 4a3c6120..ae43f13e 100644
--- a/__tests__/bundle/tag-description-override/.redocly.yaml
+++ b/__tests__/bundle/tag-description-override/.redocly.yaml
@@ -2,10 +2,9 @@ apis:
   main:
     root: ./main.yaml
 
-styleguide:
-  decorators:
-    tag-description-override:
-      tagNames:
-        pet: ./pet-tag-description.md
-        store: ./store-tag-description.md
-  extends: []
+decorators:
+  tag-description-override:
+    tagNames:
+      pet: ./pet-tag-description.md
+      store: ./store-tag-description.md
+extends: []
diff --git a/__tests__/lint-config/invalid-config--lint-config-error/.redocly.yaml b/__tests__/lint-config/invalid-config--lint-config-error/.redocly.yaml
index 54206449..97c5577a 100644
--- a/__tests__/lint-config/invalid-config--lint-config-error/.redocly.yaml
+++ b/__tests__/lint-config/invalid-config--lint-config-error/.redocly.yaml
@@ -2,6 +2,5 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    context:
+rules:
+  context:
diff --git a/__tests__/lint-config/invalid-config--lint-config-off/.redocly.yaml b/__tests__/lint-config/invalid-config--lint-config-off/.redocly.yaml
index 54206449..97c5577a 100644
--- a/__tests__/lint-config/invalid-config--lint-config-off/.redocly.yaml
+++ b/__tests__/lint-config/invalid-config--lint-config-off/.redocly.yaml
@@ -2,6 +2,5 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    context:
+rules:
+  context:
diff --git a/__tests__/lint-config/invalid-config--lint-config-warn/.redocly.yaml b/__tests__/lint-config/invalid-config--lint-config-warn/.redocly.yaml
index 54206449..97c5577a 100644
--- a/__tests__/lint-config/invalid-config--lint-config-warn/.redocly.yaml
+++ b/__tests__/lint-config/invalid-config--lint-config-warn/.redocly.yaml
@@ -2,6 +2,5 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    context:
+rules:
+  context:
diff --git a/__tests__/lint-config/invalid-config--no-option/.redocly.yaml b/__tests__/lint-config/invalid-config--no-option/.redocly.yaml
index 54206449..97c5577a 100644
--- a/__tests__/lint-config/invalid-config--no-option/.redocly.yaml
+++ b/__tests__/lint-config/invalid-config--no-option/.redocly.yaml
@@ -2,6 +2,5 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    context:
+rules:
+  context:
diff --git a/__tests__/lint-config/invalid-config-assertation-config-type/.redocly.yaml b/__tests__/lint-config/invalid-config-assertation-config-type/.redocly.yaml
index 7f9207b2..d622da32 100644
--- a/__tests__/lint-config/invalid-config-assertation-config-type/.redocly.yaml
+++ b/__tests__/lint-config/invalid-config-assertation-config-type/.redocly.yaml
@@ -2,11 +2,10 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    assert/path-item-mutually-required:
-      context:
-        - type: Invalid-type
-      subject: Operation
-      message: Operation should have summary and security fields simultaneously
-  extends: []
+rules:
+  assert/path-item-mutually-required:
+    context:
+      - type: Invalid-type
+    subject: Operation
+    message: Operation should have summary and security fields simultaneously
+extends: []
diff --git a/__tests__/lint-config/invalid-config-assertation-config-type/snapshot.js b/__tests__/lint-config/invalid-config-assertation-config-type/snapshot.js
index c0f18035..6cbfb3ed 100644
--- a/__tests__/lint-config/invalid-config-assertation-config-type/snapshot.js
+++ b/__tests__/lint-config/invalid-config-assertation-config-type/snapshot.js
@@ -2,16 +2,16 @@
 
 exports[`E2E lint-config test with option: { dirName: 'invalid-config-assertation-config-type', option: 'error' } 1`] = `
 
-[1] .redocly.yaml:8:17 at #/styleguide/rules/assert~1path-item-mutually-required/context/0/type
+[1] .redocly.yaml:9:17 at #/styleguide/rules/assert~1path-item-mutually-required/context/0/type
 
 \`type\` can be one of the following only: "Root", "Tag", "ExternalDocs", "Server", "ServerVariable", "ServerVariablesMap", "SecurityRequirement", "Info", "Contact", "License", "PathsMap", "PathItem", "Parameter", "Operation", "Callback", "CallbacksMap", "RequestBody", "MediaTypesMap", "MediaType", "Example", "ExamplesMap", "Encoding", "EncodingsMap", "Header", "HeadersMap", "ResponsesMap", "Response", "Link", "LinksMap", "Schema", "Xml", "SchemaProperties", "DiscriminatorMapping", "Discriminator", "Components", "NamedSchemas", "NamedResponses", "NamedParameters", "NamedExamples", "NamedRequestBodies", "NamedHeaders", "NamedSecuritySchemes", "NamedLinks", "NamedCallbacks", "ImplicitFlow", "PasswordFlow", "ClientCredentials", "AuthorizationCode", "SecuritySchemeFlows", "SecurityScheme", "XCodeSample", "WebhooksMap".
 
- 6 | assert/path-item-mutually-required:
- 7 |   context:
- 8 |     - type: Invalid-type
+ 7 | assert/path-item-mutually-required:
+ 8 |   context:
+ 9 |     - type: Invalid-type
    |             ^^^^^^^^^^^^
- 9 |   subject: Operation
-10 |   message: Operation should have summary and security fields simultaneously
+10 |   subject: Operation
+11 |   message: Operation should have summary and security fields simultaneously
 
 Error was generated by the configuration spec rule.
 
diff --git a/__tests__/lint-config/invalid-config-assertation-name/.redocly.yaml b/__tests__/lint-config/invalid-config-assertation-name/.redocly.yaml
index 9318acd0..f59e5a90 100644
--- a/__tests__/lint-config/invalid-config-assertation-name/.redocly.yaml
+++ b/__tests__/lint-config/invalid-config-assertation-name/.redocly.yaml
@@ -2,11 +2,10 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    asset/path-item-mutually-required:
-      context:
-        - type: PathItem
-      subject: Operation
-      message: Operation should have summary and security fields simultaneously
-  extends: []
+rules:
+  asset/path-item-mutually-required:
+    context:
+      - type: PathItem
+    subject: Operation
+    message: Operation should have summary and security fields simultaneously
+extends: []
diff --git a/__tests__/lint-config/invalid-config-assertation-name/snapshot.js b/__tests__/lint-config/invalid-config-assertation-name/snapshot.js
index 75177282..cdd68e68 100644
--- a/__tests__/lint-config/invalid-config-assertation-name/snapshot.js
+++ b/__tests__/lint-config/invalid-config-assertation-name/snapshot.js
@@ -2,16 +2,16 @@
 
 exports[`E2E lint-config test with option: { dirName: 'invalid-config-assertation-name', option: 'error' } 1`] = `
 
-[1] .redocly.yaml:6:5 at #/styleguide/rules/asset~1path-item-mutually-required
+[1] .redocly.yaml:7:5 at #/styleguide/rules/asset~1path-item-mutually-required
 
 The field \`severity\` must be present on this level.
 
-4 | styleguide:
-5 |   rules:
-6 |     asset/path-item-mutually-required:
-  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-7 |       context:
-8 |         - type: PathItem
+5 | extends: []
+6 | rules:
+7 |   asset/path-item-mutually-required:
+  |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+8 |     context:
+9 |       - type: PathItem
 
 Error was generated by the configuration spec rule.
 
diff --git a/__tests__/lint-config/invalid-definition-and-config/.redocly.yaml b/__tests__/lint-config/invalid-definition-and-config/.redocly.yaml
index 54206449..97c5577a 100644
--- a/__tests__/lint-config/invalid-definition-and-config/.redocly.yaml
+++ b/__tests__/lint-config/invalid-definition-and-config/.redocly.yaml
@@ -2,6 +2,5 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    context:
+rules:
+  context:
diff --git a/__tests__/lint-config/invlid-lint-config-saverity/.redocly.yaml b/__tests__/lint-config/invlid-lint-config-saverity/.redocly.yaml
index d6f9f3c1..8054578d 100644
--- a/__tests__/lint-config/invlid-lint-config-saverity/.redocly.yaml
+++ b/__tests__/lint-config/invlid-lint-config-saverity/.redocly.yaml
@@ -2,11 +2,10 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    assert/path-item-mutually-required:
-      context:
-        - type: PathItem
-      subject: Operation
-      message: Operation should have summary and security fields simultaneously
-  extends: []
+rules:
+  assert/path-item-mutually-required:
+    context:
+      - type: PathItem
+    subject: Operation
+    message: Operation should have summary and security fields simultaneously
+extends: []
diff --git a/__tests__/lint/assertions-casing-camel-case-error/.redocly.yaml b/__tests__/lint/assertions-casing-camel-case-error/.redocly.yaml
index 7193b4db..78cf3cf3 100644
--- a/__tests__/lint/assertions-casing-camel-case-error/.redocly.yaml
+++ b/__tests__/lint/assertions-casing-camel-case-error/.redocly.yaml
@@ -2,23 +2,22 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    assert/operation-get:
-      context:
-        - type: Operation
-          matchParentKeys: [get]
-      subject: Operation
-      property: operationId
-      message: Operation id for get operation should be camelCase
-      casing: camelCase
-    assert/operation-id-camel-case:
-      subject: Operation
-      property: operationId
-      message: Operation id should be camelCase
-      casing: camelCase
-    assert/camel-case-on-value:
-      subject: NamedParameters
-      casing: camelCase
-      message: Named Parameters should be camelCase
-  extends: []
+rules:
+  assert/operation-get:
+    context:
+      - type: Operation
+        matchParentKeys: [get]
+    subject: Operation
+    property: operationId
+    message: Operation id for get operation should be camelCase
+    casing: camelCase
+  assert/operation-id-camel-case:
+    subject: Operation
+    property: operationId
+    message: Operation id should be camelCase
+    casing: camelCase
+  assert/camel-case-on-value:
+    subject: NamedParameters
+    casing: camelCase
+    message: Named Parameters should be camelCase
+extends: []
diff --git a/__tests__/lint/assertions-casing-kebab-case-error/.redocly.yaml b/__tests__/lint/assertions-casing-kebab-case-error/.redocly.yaml
index 7f35e3ca..44f9485e 100644
--- a/__tests__/lint/assertions-casing-kebab-case-error/.redocly.yaml
+++ b/__tests__/lint/assertions-casing-kebab-case-error/.redocly.yaml
@@ -2,19 +2,18 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    assert/operation-get:
-      context:
-        - type: Operation
-          matchParentKeys: [get]
-      subject: Operation
-      property: operationId
-      message: Operation id should be kebab-case
-      casing: kebab-case
-    assert/operation-id-kebab-case:
-      subject: Operation
-      property: operationId
-      message: Operation id should be kebab-case
-      casing: kebab-case
-  extends: []
\ No newline at end of file
+rules:
+  assert/operation-get:
+    context:
+      - type: Operation
+        matchParentKeys: [get]
+    subject: Operation
+    property: operationId
+    message: Operation id should be kebab-case
+    casing: kebab-case
+  assert/operation-id-kebab-case:
+    subject: Operation
+    property: operationId
+    message: Operation id should be kebab-case
+    casing: kebab-case
+extends: []
\ No newline at end of file
diff --git a/__tests__/lint/assertions-casing-pascal-case-error/.redocly.yaml b/__tests__/lint/assertions-casing-pascal-case-error/.redocly.yaml
index b15ab17a..52c5a2ef 100644
--- a/__tests__/lint/assertions-casing-pascal-case-error/.redocly.yaml
+++ b/__tests__/lint/assertions-casing-pascal-case-error/.redocly.yaml
@@ -2,19 +2,19 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    assert/operation-get:
-      context:
-        - type: Operation
-          matchParentKeys: [get]
-      subject: Operation
-      property: operationId
-      message: Operation id should be PascalCase
-      casing: PascalCase
-    assert/operation-id-pascal-case:
-      subject: Operation
-      property: operationId
-      message: Operation id should be PascalCase
-      casing: PascalCase
-  extends: []
\ No newline at end of file
+
+rules:
+  assert/operation-get:
+    context:
+      - type: Operation
+        matchParentKeys: [get]
+    subject: Operation
+    property: operationId
+    message: Operation id should be PascalCase
+    casing: PascalCase
+  assert/operation-id-pascal-case:
+    subject: Operation
+    property: operationId
+    message: Operation id should be PascalCase
+    casing: PascalCase
+extends: []
\ No newline at end of file
diff --git a/__tests__/lint/assertions-casing-snake-case-error/.redocly.yaml b/__tests__/lint/assertions-casing-snake-case-error/.redocly.yaml
index 43a784ec..508d9a45 100644
--- a/__tests__/lint/assertions-casing-snake-case-error/.redocly.yaml
+++ b/__tests__/lint/assertions-casing-snake-case-error/.redocly.yaml
@@ -2,19 +2,19 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    assert/operation-id-pascal-case:
-      context:
-        - type: Operation
-          matchParentKeys: [get]
-      subject: Operation
-      property: operationId
-      message: Operation id for get requests should be PascalCase
-      casing: PascalCase
-    assert/operation-id-snake-case:
-      subject: Operation
-      property: operationId
-      message: Operation id should be snake_case
-      casing: snake_case
-  extends: []
\ No newline at end of file
+
+rules:
+  assert/operation-id-pascal-case:
+    context:
+      - type: Operation
+        matchParentKeys: [get]
+    subject: Operation
+    property: operationId
+    message: Operation id for get requests should be PascalCase
+    casing: PascalCase
+  assert/operation-id-snake-case:
+    subject: Operation
+    property: operationId
+    message: Operation id should be snake_case
+    casing: snake_case
+extends: []
\ No newline at end of file
diff --git a/__tests__/lint/assertions-defined-error/.redocly.yaml b/__tests__/lint/assertions-defined-error/.redocly.yaml
index 66435e47..a669caea 100644
--- a/__tests__/lint/assertions-defined-error/.redocly.yaml
+++ b/__tests__/lint/assertions-defined-error/.redocly.yaml
@@ -2,19 +2,19 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    assert/response-content-defined:
-      context:
-      - type: Response
-        excludeParentKeys: ['204']
-      subject: Response
-      property: content
-      message: Response content should be defined
-      defined: true
-    assert/operation-security:
-      subject: Operation
-      property: security
-      message: Operation security should be defined
-      defined: true
-  extends: []
+
+rules:
+  assert/response-content-defined:
+    context:
+    - type: Response
+      excludeParentKeys: ['204']
+    subject: Response
+    property: content
+    message: Response content should be defined
+    defined: true
+  assert/operation-security:
+    subject: Operation
+    property: security
+    message: Operation security should be defined
+    defined: true
+extends: []
diff --git a/__tests__/lint/assertions-enum-error/.redocly.yaml b/__tests__/lint/assertions-enum-error/.redocly.yaml
index ea18de01..f9398073 100644
--- a/__tests__/lint/assertions-enum-error/.redocly.yaml
+++ b/__tests__/lint/assertions-enum-error/.redocly.yaml
@@ -2,17 +2,16 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    assert/operation-summary-value:
-      subject:
-      - Operation
-      property: summary
-      message: Operation summary value should be among of predefined values
-      enum:
-        - test summary
-        - test example
-      suggest:
-        - test summary
-        - test example
-  extends: []
\ No newline at end of file
+rules:
+  assert/operation-summary-value:
+    subject:
+    - Operation
+    property: summary
+    message: Operation summary value should be among of predefined values
+    enum:
+      - test summary
+      - test example
+    suggest:
+      - test summary
+      - test example
+extends: []
\ No newline at end of file
diff --git a/__tests__/lint/assertions-enum-on-keys-error/.redocly.yaml b/__tests__/lint/assertions-enum-on-keys-error/.redocly.yaml
index 06df517a..bd5f7ddf 100644
--- a/__tests__/lint/assertions-enum-on-keys-error/.redocly.yaml
+++ b/__tests__/lint/assertions-enum-on-keys-error/.redocly.yaml
@@ -2,12 +2,11 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    assert/media-type-application-json:
-      subject:
-      - MediaTypesMap
-      message: Only application/json can be used
-      enum:
-        - application/json
-  extends: []
+rules:
+  assert/media-type-application-json:
+    subject:
+    - MediaTypesMap
+    message: Only application/json can be used
+    enum:
+      - application/json
+extends: []
diff --git a/__tests__/lint/assertions-error/.redocly.yaml b/__tests__/lint/assertions-error/.redocly.yaml
index 46a0c835..c0273cb8 100644
--- a/__tests__/lint/assertions-error/.redocly.yaml
+++ b/__tests__/lint/assertions-error/.redocly.yaml
@@ -2,157 +2,156 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  extends:
-    - recommended
-  rules:
-    assert/tag-description-pattern:
-      subject: Tag
-      property: description
-      message: Tag description must be at least 13 characters and end with a full stop.
-      severity: error
-      minLength: 13
-      pattern: /\.$/
-#property example
-    assert/path-item-get-defined:
-      subject: PathItem
-      property: get
-      message: Every path item must have a GET operation.
-      defined: true
-    assert/path-item-get-required:
-      subject: PathItem
-      message: Every path item must have a GET(required) operation.
-      required:
-        - get
-    assert/tag-name-and-desc:
-      subject: Tag
-      property:
-        - name
-        - description
-      message: Every tag must have a name and description.
-      defined: true
-#context example
-    assert/operation-w-context:
-      subject:
-        - MediaTypesMap
-      context:
+extends:
+  - recommended
+rules:
+  assert/tag-description-pattern:
+    subject: Tag
+    property: description
+    message: Tag description must be at least 13 characters and end with a full stop.
+    severity: error
+    minLength: 13
+    pattern: /\.$/
+  # property example
+  assert/path-item-get-defined:
+    subject: PathItem
+    property: get
+    message: Every path item must have a GET operation.
+    defined: true
+  assert/path-item-get-required:
+    subject: PathItem
+    message: Every path item must have a GET(required) operation.
+    required:
+      - get
+  assert/tag-name-and-desc:
+    subject: Tag
+    property:
+      - name
+      - description
+    message: Every tag must have a name and description.
+    defined: true
+  # context example
+  assert/operation-w-context:
+    subject:
+      - MediaTypesMap
+    context:
+      - type: Operation
+        excludeParentKeys:
+          - put
+      - type: Response
+        matchParentKeys: ['201', '200']
+    disallowed: [ 'application/pdf' ]
+    message: Media type should not be pdf
+  # enum example
+  assert/media-type-pdf:
+    subject: MediaTypesMap
+    message: Only application/pdf can be used
+    severity: error
+    enum:
+      - application/pdf
+  assert/operation-summary-suggest:
+    subject: Operation
+    property: summary
+    message: Summary must be one of the predefined values
+    suggest:
+      - change to 'My resource'
+      - change to 'My collection'
+    severity: error
+    enum:
+      - My resource
+      - My collection
+  # pattern example
+  assert/operation-summary-pattern:
+    subject: Operation
+    property: summary
+    message: Summary should match a regex
+    severity: error
+    pattern: /resource/
+  # casing
+  assert/operation-id-camel-case:
+    subject: Operation
+    property: operationId
+    message: NamedExamples key must be in PascalCase
+    severity: error
+    casing: camelCase
+  # mutuallyExclusive example
+  assert/operation-mutually-exclusive:
+    subject: Operation
+    message: "Operation must not define both properties together: description and externalDocs"
+    severity: error
+    mutuallyExclusive:
+      - description
+      - externalDocs
+  # mutuallyRequired example
+  assert/operation-mutually-required:
+    subject: SchemaProperties
+    context:
+      - type: Response
+    message: The created_at and updated_at properties are mutually required
+    severity: error
+    mutuallyRequired:
+      - created_at
+      - updated_at
+  # mutuallyRequired example with context
+  assert/operation-mutually-required-w-context:
+    subject: ResponsesMap
+    context:
         - type: Operation
-          excludeParentKeys:
+          matchParentKeys:
             - put
-        - type: Response
-          matchParentKeys: ['201', '200']
-      disallowed: [ 'application/pdf' ]
-      message: Media type should not be pdf
-#enum example
-    assert/media-type-pdf:
-      subject: MediaTypesMap
-      message: Only application/pdf can be used
-      severity: error
-      enum:
-        - application/pdf
-    assert/operation-summary-suggest:
-      subject: Operation
-      property: summary
-      message: Summary must be one of the predefined values
-      suggest:
-        - change to 'My resource'
-        - change to 'My collection'
-      severity: error
-      enum:
-        - My resource
-        - My collection
-#pattern example
-    assert/operation-summary-pattern:
-      subject: Operation
-      property: summary
-      message: Summary should match a regex
-      severity: error
-      pattern: /resource/
-#casing
-    assert/operation-id-camel-case:
-      subject: Operation
-      property: operationId
-      message: NamedExamples key must be in PascalCase
-      severity: error
-      casing: camelCase
-#mutuallyExclusive example
-    assert/operation-mutually-exclusive:
-      subject: Operation
-      message: "Operation must not define both properties together: description and externalDocs"
-      severity: error
-      mutuallyExclusive:
-        - description
-        - externalDocs
-#mutuallyRequired example
-    assert/operation-mutually-required:
-      subject: SchemaProperties
-      context:
-        - type: Response
-      message: The created_at and updated_at properties are mutually required
-      severity: error
-      mutuallyRequired:
-        - created_at
-        - updated_at
-#mutuallyRequired example with context
-    assert/operation-mutually-required-w-context:
-      subject: ResponsesMap
-      context:
-          - type: Operation
-            matchParentKeys:
-              - put
-      message: Must mutually define 200 and 201 responses for PUT requests.
-      severity: error
-      mutuallyRequired:
-        - '200'
-        - '201'
-#disallowed example
-    assert/operation-disallowed:
-      subject: Operation
-      message: x-code-samples and x-internal must not be defined
-      severity: error
-      disallowed:
-        - x-code-samples
-        - x-internal
-#defined example
-    assert/operation-x-code-samples-defined:
-      subject: Operation
-      property: x-codeSamples
-      message: x-codeSamples must be defined
-      severity: error
-      defined: true
-# undefined example
-    assert/operation-x-code-samples-undefined:
-      subject: Operation
-      property: x-code-samples
-      message: x-code-samples is deprecated
-      suggest:
-        - x-codeSamples instead of x-code-samples
-      severity: error
-      undefined: true
-#nonEmpty example
-    assert/operation-summary-non-empty:
-      subject: Operation
-      property: summary
-      message: Operation summary should not be empty
-      severity: error
-      nonEmpty: true
-#minLength example
-    assert/operation-summary-min-length:
-      subject: Operation
-      property: summary
-      message: Operation summary must have minimum of 2 chars length
-      severity: error
-      minLength: 2
-#maxLength example
-    assert/operation-summary-max-length:
-      subject: Operation
-      property: summary
-      message: Operation summary must have a maximum of 2 characters
-      severity: error
-      maxLength: 2
-# Example map subject example
-    assert/exampleMap:
-      subject: ExamplesMap
-      message: Examples names must use camelCase
-      casing: camelCase
-      severity: error
+    message: Must mutually define 200 and 201 responses for PUT requests.
+    severity: error
+    mutuallyRequired:
+      - '200'
+      - '201'
+  # disallowed example
+  assert/operation-disallowed:
+    subject: Operation
+    message: x-code-samples and x-internal must not be defined
+    severity: error
+    disallowed:
+      - x-code-samples
+      - x-internal
+  # defined example
+  assert/operation-x-code-samples-defined:
+    subject: Operation
+    property: x-codeSamples
+    message: x-codeSamples must be defined
+    severity: error
+    defined: true
+  # undefined example
+  assert/operation-x-code-samples-undefined:
+    subject: Operation
+    property: x-code-samples
+    message: x-code-samples is deprecated
+    suggest:
+      - x-codeSamples instead of x-code-samples
+    severity: error
+    undefined: true
+  # nonEmpty example
+  assert/operation-summary-non-empty:
+    subject: Operation
+    property: summary
+    message: Operation summary should not be empty
+    severity: error
+    nonEmpty: true
+  # minLength example
+  assert/operation-summary-min-length:
+    subject: Operation
+    property: summary
+    message: Operation summary must have minimum of 2 chars length
+    severity: error
+    minLength: 2
+  # maxLength example
+  assert/operation-summary-max-length:
+    subject: Operation
+    property: summary
+    message: Operation summary must have a maximum of 2 characters
+    severity: error
+    maxLength: 2
+  # Example map subject example
+  assert/exampleMap:
+    subject: ExamplesMap
+    message: Examples names must use camelCase
+    casing: camelCase
+    severity: error
diff --git a/__tests__/lint/assertions-map-types/.redocly.yaml b/__tests__/lint/assertions-map-types/.redocly.yaml
index 982c8dcb..511c0336 100644
--- a/__tests__/lint/assertions-map-types/.redocly.yaml
+++ b/__tests__/lint/assertions-map-types/.redocly.yaml
@@ -2,26 +2,25 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  extends: []
-  rules:
-    assert/headerMap:
-      subject: HeadersMap
-      property: x-next
-      defined: false
+extends: []
+rules:
+  assert/headerMap:
+    subject: HeadersMap
+    property: x-next
+    defined: false
 
-    assert/encodingMap:
-      subject: EncodingsMap
-      casing: kebab-case
+  assert/encodingMap:
+    subject: EncodingsMap
+    casing: kebab-case
 
-    assert/linkMap:
-      subject: LinksMap
-      pattern: /^pet/
+  assert/linkMap:
+    subject: LinksMap
+    pattern: /^pet/
 
-    assert/serverVariableMap:
-      subject: ServerVariablesMap
-      casing: flatcase
+  assert/serverVariableMap:
+    subject: ServerVariablesMap
+    casing: flatcase
 
-    assert/callbackMap:
-      subject: CallbacksMap
-      casing: snake_case
+  assert/callbackMap:
+    subject: CallbacksMap
+    casing: snake_case
diff --git a/__tests__/lint/assertions-max-length-array-error/.redocly.yaml b/__tests__/lint/assertions-max-length-array-error/.redocly.yaml
index e16d3501..5106f2f1 100644
--- a/__tests__/lint/assertions-max-length-array-error/.redocly.yaml
+++ b/__tests__/lint/assertions-max-length-array-error/.redocly.yaml
@@ -2,11 +2,10 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    assert/tags-max-length:
-      subject: Operation
-      property: tags
-      message: Operation tags should have maximum 2 items
-      maxLength: 2
-  extends: []
\ No newline at end of file
+rules:
+  assert/tags-max-length:
+    subject: Operation
+    property: tags
+    message: Operation tags should have maximum 2 items
+    maxLength: 2
+extends: []
diff --git a/__tests__/lint/assertions-max-length-string-error/.redocly.yaml b/__tests__/lint/assertions-max-length-string-error/.redocly.yaml
index fea3d8a4..ea990c07 100644
--- a/__tests__/lint/assertions-max-length-string-error/.redocly.yaml
+++ b/__tests__/lint/assertions-max-length-string-error/.redocly.yaml
@@ -2,11 +2,10 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    assert/description-max-length:
-      subject: Info
-      property: description
-      message: Info description should be maximum 10 chars length
-      maxLength: 10
-  extends: []
\ No newline at end of file
+rules:
+  assert/description-max-length:
+    subject: Info
+    property: description
+    message: Info description should be maximum 10 chars length
+    maxLength: 10
+extends: []
diff --git a/__tests__/lint/assertions-min-length-array-error/.redocly.yaml b/__tests__/lint/assertions-min-length-array-error/.redocly.yaml
index a243d485..4f3c0d68 100644
--- a/__tests__/lint/assertions-min-length-array-error/.redocly.yaml
+++ b/__tests__/lint/assertions-min-length-array-error/.redocly.yaml
@@ -2,11 +2,10 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    assert/tags-min-length:
-      subject: Operation
-      property: tags
-      message: Operation tags should have minimum 4 items
-      minLength: 4
-  extends: []
\ No newline at end of file
+rules:
+  assert/tags-min-length:
+    subject: Operation
+    property: tags
+    message: Operation tags should have minimum 4 items
+    minLength: 4
+extends: []
diff --git a/__tests__/lint/assertions-min-length-string-error/.redocly.yaml b/__tests__/lint/assertions-min-length-string-error/.redocly.yaml
index 2e375811..1d69bbf6 100644
--- a/__tests__/lint/assertions-min-length-string-error/.redocly.yaml
+++ b/__tests__/lint/assertions-min-length-string-error/.redocly.yaml
@@ -2,11 +2,10 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    assert/description-min-length:
-      subject: Info
-      property: description
-      message: Info description should be minimum 20 chars length
-      minLength: 20
-  extends: []
\ No newline at end of file
+rules:
+  assert/description-min-length:
+    subject: Info
+    property: description
+    message: Info description should be minimum 20 chars length
+    minLength: 20
+extends: []
diff --git a/__tests__/lint/assertions-mutually-exclusive-error/.redocly.yaml b/__tests__/lint/assertions-mutually-exclusive-error/.redocly.yaml
index a7a95ebf..aa1fb302 100644
--- a/__tests__/lint/assertions-mutually-exclusive-error/.redocly.yaml
+++ b/__tests__/lint/assertions-mutually-exclusive-error/.redocly.yaml
@@ -2,14 +2,13 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    assert/path-item-mutually-exclusive:
-      context:
-        - type: PathItem
-      subject: Operation
-      message: Operation should not have summary and tags fields simultaneously
-      mutuallyExclusive:
-        - summary
-        - tags
-  extends: []
\ No newline at end of file
+rules:
+  assert/path-item-mutually-exclusive:
+    context:
+      - type: PathItem
+    subject: Operation
+    message: Operation should not have summary and tags fields simultaneously
+    mutuallyExclusive:
+      - summary
+      - tags
+extends: []
diff --git a/__tests__/lint/assertions-mutually-required-error/.redocly.yaml b/__tests__/lint/assertions-mutually-required-error/.redocly.yaml
index d0f69d78..261ab35e 100644
--- a/__tests__/lint/assertions-mutually-required-error/.redocly.yaml
+++ b/__tests__/lint/assertions-mutually-required-error/.redocly.yaml
@@ -2,14 +2,13 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    assert/path-item-mutually-required:
-      context:
+rules:
+  assert/path-item-mutually-required:
+    context:
       - type: PathItem
-      subject: Operation
-      message: Operation should have summary and security fields simultaneously
-      mutuallyRequired:
-        - summary
-        - security
-  extends: []
\ No newline at end of file
+    subject: Operation
+    message: Operation should have summary and security fields simultaneously
+    mutuallyRequired:
+      - summary
+      - security
+extends: []
diff --git a/__tests__/lint/assertions-non-empty-error/.redocly.yaml b/__tests__/lint/assertions-non-empty-error/.redocly.yaml
index e5d18b6f..ad986963 100644
--- a/__tests__/lint/assertions-non-empty-error/.redocly.yaml
+++ b/__tests__/lint/assertions-non-empty-error/.redocly.yaml
@@ -2,11 +2,10 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    assert/summary-non-empty:
-      subject: Operation
-      property: summary
-      message: Operation summary should not be empty
-      nonEmpty: true
-  extends: []
\ No newline at end of file
+rules:
+  assert/summary-non-empty:
+    subject: Operation
+    property: summary
+    message: Operation summary should not be empty
+    nonEmpty: true
+extends: []
diff --git a/__tests__/lint/assertions-non-empty-off/.redocly.yaml b/__tests__/lint/assertions-non-empty-off/.redocly.yaml
index 373207bc..854a79d9 100644
--- a/__tests__/lint/assertions-non-empty-off/.redocly.yaml
+++ b/__tests__/lint/assertions-non-empty-off/.redocly.yaml
@@ -2,12 +2,11 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    assert/summary-non-empty:
-      subject: Operation
-      property: summary
-      message: Operation summary should not be empty
-      nonEmpty: true
-      severity: off
-  extends: []
\ No newline at end of file
+rules:
+  assert/summary-non-empty:
+    subject: Operation
+    property: summary
+    message: Operation summary should not be empty
+    nonEmpty: true
+    severity: off
+extends: []
diff --git a/__tests__/lint/assertions-non-empty-warn/.redocly.yaml b/__tests__/lint/assertions-non-empty-warn/.redocly.yaml
index d6badee0..3bbb2824 100644
--- a/__tests__/lint/assertions-non-empty-warn/.redocly.yaml
+++ b/__tests__/lint/assertions-non-empty-warn/.redocly.yaml
@@ -2,12 +2,11 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    assert/summary-non-empty:
-      subject: Operation
-      property: summary
-      message: Operation summary should not be empty
-      nonEmpty: true
-      severity: warn
-  extends: []
\ No newline at end of file
+rules:
+  assert/summary-non-empty:
+    subject: Operation
+    property: summary
+    message: Operation summary should not be empty
+    nonEmpty: true
+    severity: warn
+extends: []
diff --git a/__tests__/lint/assertions-pattern-error/.redocly.yaml b/__tests__/lint/assertions-pattern-error/.redocly.yaml
index 952ad169..f83ffbb7 100644
--- a/__tests__/lint/assertions-pattern-error/.redocly.yaml
+++ b/__tests__/lint/assertions-pattern-error/.redocly.yaml
@@ -2,11 +2,10 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    assert/summary-pattern:
-      subject: Operation
-      property: summary
-      message: Operation summary should have 'test' word
-      pattern: '/test/'
-  extends: []
\ No newline at end of file
+rules:
+  assert/summary-pattern:
+    subject: Operation
+    property: summary
+    message: Operation summary should have 'test' word
+    pattern: '/test/'
+extends: []
diff --git a/__tests__/lint/assertions-ref-forbidden-error/.redocly.yaml b/__tests__/lint/assertions-ref-forbidden-error/.redocly.yaml
index 34780a4b..31fb6d80 100644
--- a/__tests__/lint/assertions-ref-forbidden-error/.redocly.yaml
+++ b/__tests__/lint/assertions-ref-forbidden-error/.redocly.yaml
@@ -2,17 +2,16 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    assert/ref-forbidden:
-      context:
-        - type: Response
-      subject: MediaType
-      property: schema
-      message: Response MediaType schema should NOT have a ref
-      ref: false
-    assert/ref-forbidden-no-property:
-      subject: PathItem
-      message: PathItems should NOT should have a ref
-      ref: false
-  extends: []
+rules:
+  assert/ref-forbidden:
+    context:
+      - type: Response
+    subject: MediaType
+    property: schema
+    message: Response MediaType schema should NOT have a ref
+    ref: false
+  assert/ref-forbidden-no-property:
+    subject: PathItem
+    message: PathItems should NOT should have a ref
+    ref: false
+extends: []
diff --git a/__tests__/lint/assertions-ref-pattern-error/.redocly.yaml b/__tests__/lint/assertions-ref-pattern-error/.redocly.yaml
index a8c74b0c..fd117fd0 100644
--- a/__tests__/lint/assertions-ref-pattern-error/.redocly.yaml
+++ b/__tests__/lint/assertions-ref-pattern-error/.redocly.yaml
@@ -2,17 +2,16 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    assert/ref-pattern:
-      context:
-        - type: Response
-      subject: MediaType
-      property: schema
-      message: Response MediaType schema should contain ref to components/schemas folder
-      ref: ^(\.\/)?components\/schemas\/.*\.yaml$
-    assert/ref-pattern-no-properties:
-      subject: PathItem
-      message: PathItem should contain ref to components/paths folder
-      ref: ^(\.\/)?components\/paths\/.*\.yaml$
-  extends: []
+rules:
+  assert/ref-pattern:
+    context:
+      - type: Response
+    subject: MediaType
+    property: schema
+    message: Response MediaType schema should contain ref to components/schemas folder
+    ref: ^(\.\/)?components\/schemas\/.*\.yaml$
+  assert/ref-pattern-no-properties:
+    subject: PathItem
+    message: PathItem should contain ref to components/paths folder
+    ref: ^(\.\/)?components\/paths\/.*\.yaml$
+extends: []
diff --git a/__tests__/lint/assertions-ref-required-error/.redocly.yaml b/__tests__/lint/assertions-ref-required-error/.redocly.yaml
index e3c248f4..1369922b 100644
--- a/__tests__/lint/assertions-ref-required-error/.redocly.yaml
+++ b/__tests__/lint/assertions-ref-required-error/.redocly.yaml
@@ -2,17 +2,16 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    assert/ref-required:
-      context:
-        - type: Response
-      subject: MediaType
-      property: schema
-      message: Response MediaType schema should have a ref
-      ref: true
-    assert/ref-required-no-property:
-      subject: PathItem
-      message: PathItems should have refs
-      ref: true
-  extends: []
+rules:
+  assert/ref-required:
+    context:
+      - type: Response
+    subject: MediaType
+    property: schema
+    message: Response MediaType schema should have a ref
+    ref: true
+  assert/ref-required-no-property:
+    subject: PathItem
+    message: PathItems should have refs
+    ref: true
+extends: []
diff --git a/__tests__/lint/assertions-require-any-error/.redocly.yaml b/__tests__/lint/assertions-require-any-error/.redocly.yaml
index b842223c..558b0321 100644
--- a/__tests__/lint/assertions-require-any-error/.redocly.yaml
+++ b/__tests__/lint/assertions-require-any-error/.redocly.yaml
@@ -2,13 +2,12 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    assert/operation-require-any-description-or-external:
-      subject: Operation
-      message: 'Operation must have one of properties defined: description or externalDocs'
-      severity: error
-      requireAny:
-        - description
-        - externalDocs
-  extends: []
+rules:
+  assert/operation-require-any-description-or-external:
+    subject: Operation
+    message: 'Operation must have one of properties defined: description or externalDocs'
+    severity: error
+    requireAny:
+      - description
+      - externalDocs
+extends: []
diff --git a/__tests__/lint/assertions-show-suggestions/.redocly.yaml b/__tests__/lint/assertions-show-suggestions/.redocly.yaml
index 4f839e00..28311164 100644
--- a/__tests__/lint/assertions-show-suggestions/.redocly.yaml
+++ b/__tests__/lint/assertions-show-suggestions/.redocly.yaml
@@ -2,16 +2,15 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    assert/path-item-suggest:
-      context:
+rules:
+  assert/path-item-suggest:
+    context:
       - type: PathItem
-      subject: Operation
-      property: summary
-      message: Operation summary should have at least 10 chars length
-      suggest:
-        - Suggestion 1
-        - Suggestion 2
-      minLength: 20
-  extends: []
\ No newline at end of file
+    subject: Operation
+    property: summary
+    message: Operation summary should have at least 10 chars length
+    suggest:
+      - Suggestion 1
+      - Suggestion 2
+    minLength: 20
+extends: []
diff --git a/__tests__/lint/assertions-undefined-error/.redocly.yaml b/__tests__/lint/assertions-undefined-error/.redocly.yaml
index 3f7ed685..eba8d6bd 100644
--- a/__tests__/lint/assertions-undefined-error/.redocly.yaml
+++ b/__tests__/lint/assertions-undefined-error/.redocly.yaml
@@ -2,11 +2,10 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    assert/summary-undefined:
-      subject: Operation
-      property: summary
-      message: Operation summary should be undefined
-      undefined: true
-  extends: []
\ No newline at end of file
+rules:
+  assert/summary-undefined:
+    subject: Operation
+    property: summary
+    message: Operation summary should be undefined
+    undefined: true
+extends: []
diff --git a/__tests__/lint/assertions/.redocly.yaml b/__tests__/lint/assertions/.redocly.yaml
index d9ee04d7..a117082f 100644
--- a/__tests__/lint/assertions/.redocly.yaml
+++ b/__tests__/lint/assertions/.redocly.yaml
@@ -2,165 +2,164 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  extends: []
-  rules:
-    assert/tag-description:
-      subject: Tag
-      property: description
-      message: Tag description must be at least 13 characters and end with a full stop.
-      severity: error
-      minLength: 13
-      pattern: /\.$/
-    # property example
-    assert/path-item-get-defined:
-      subject: PathItem
-      property: get
-      message: Every path item must have a GET operation.
-      defined: true
-    assert/path-item-get-required:
-      subject: PathItem
-      message: Every path item must have a GET operation.
-      required:
-        - get
-    assert/tag-name-and-desc:
-      subject: Tag
-      property:
-        - name
-        - description
-      message: Every tag must have a name and description.
-      defined: true
-    # context example
-    assert/media-type-map-not-pdf:
-      subject:
-        - MediaTypesMap
-      context:
-        - type: Operation
-          excludeParentKeys:
-            - put
-        - type: Response
-          matchParentKeys: ['201', '200']
-      disallowed: ['application/pdf']
-      message: Media type should not be pdf
-    # enum example
-    assert/media-type-map-enum:
-      subject: MediaTypesMap
-      message: Only application/json and application/pdf can be used
-      severity: error
-      enum:
-        - application/json
-        - application/pdf
-    assert/operation-summary-suggest:
-      subject: Operation
-      property: summary
-      message: Summary must be one of the predefined values
-      suggest:
-        - change to 'My resource'
-        - change to 'My collection'
-      severity: error
-      enum:
-        - My resource
-        - My collection
-    # pattern example
-    assert/operation-summary-pattern:
-      subject: Operation
-      property: summary
-      message: Summary should match a regex
-      severity: error
-      pattern: /resource/
-    # casing
-    assert/operation-id-casing:
-      subject: Operation
-      property: operationId
-      message: NamedExamples key must be in PascalCase
-      severity: error
-      casing: camelCase
-    # mutuallyExclusive example
-    assert/operation-mutually-exclusive:
-      subject: Operation
-      message: 'Operation must not define both properties together: description and externalDocs'
-      severity: error
-      mutuallyExclusive:
-        - description
-        - externalDocs
-    # mutuallyRequired example
-    assert/schema-properties-mutually-required:
-      subject: SchemaProperties
-      context:
-        - type: Response
-      message: The created_at and updated_at properties are mutually required
-      severity: error
-      mutuallyRequired:
-        - created_at
-        - updated_at
-    # mutuallyRequired example with context
-    assert/response-map-required-with-context:
-      subject: ResponsesMap
-      context:
-        - type: Operation
-          matchParentKeys:
-            - put
-      message: Must mutually define 200 and 201 responses for PUT requests.
-      severity: error
-      mutuallyRequired:
-        - '200'
-        - '201'
-    # requireAny example
-    assert/operation-require-any-description-or-external:
-      subject: Operation
-      message: 'Operation must have one of properties defined: description or externalDocs'
-      severity: error
-      requireAny:
-        - description
-        - externalDocs
-    # disallowed example
-    assert/operation-disallowed:
-      subject: Operation
-      message: x-code-samples and x-internal must not be defined
-      severity: error
-      disallowed:
-        - x-code-samples
-        - x-internal
-    # defined example
-    assert/operation-defined:
-      subject: Operation
-      property: x-codeSamples
-      message: x-codeSamples must be defined
-      severity: error
-      defined: true
-    # undefined example
-    assert/operation-undefined:
-      subject: Operation
-      property: x-code-samples
-      message: x-code-samples is deprecated
-      suggest:
-        - x-codeSamples instead of x-code-samples
-      severity: error
-      undefined: true
-    # nonEmpty example
-    assert/operation-non-empty:
-      subject: Operation
-      property: summary
-      message: Operation summary should not be empty
-      severity: error
-      nonEmpty: true
-    # minLength example
-    assert/operation-min-length:
-      subject: Operation
-      property: summary
-      message: Operation summary must have minimum of 2 chars length
-      severity: error
-      minLength: 2
-    # maxLength example
-    assert/operation-max-length:
-      subject: Operation
-      property: summary
-      message: Operation summary must have a maximum of 2 characters
-      severity: error
-      maxLength: 20
-    # ref example
-    assert/ref:
-      subject: PathItem
-      message: No refs on Path Items
-      severity: error
-      ref: false
+extends: []
+rules:
+  assert/tag-description:
+    subject: Tag
+    property: description
+    message: Tag description must be at least 13 characters and end with a full stop.
+    severity: error
+    minLength: 13
+    pattern: /\.$/
+  # property example
+  assert/path-item-get-defined:
+    subject: PathItem
+    property: get
+    message: Every path item must have a GET operation.
+    defined: true
+  assert/path-item-get-required:
+    subject: PathItem
+    message: Every path item must have a GET operation.
+    required:
+      - get
+  assert/tag-name-and-desc:
+    subject: Tag
+    property:
+      - name
+      - description
+    message: Every tag must have a name and description.
+    defined: true
+  # context example
+  assert/media-type-map-not-pdf:
+    subject:
+      - MediaTypesMap
+    context:
+      - type: Operation
+        excludeParentKeys:
+          - put
+      - type: Response
+        matchParentKeys: ['201', '200']
+    disallowed: ['application/pdf']
+    message: Media type should not be pdf
+  # enum example
+  assert/media-type-map-enum:
+    subject: MediaTypesMap
+    message: Only application/json and application/pdf can be used
+    severity: error
+    enum:
+      - application/json
+      - application/pdf
+  assert/operation-summary-suggest:
+    subject: Operation
+    property: summary
+    message: Summary must be one of the predefined values
+    suggest:
+      - change to 'My resource'
+      - change to 'My collection'
+    severity: error
+    enum:
+      - My resource
+      - My collection
+  # pattern example
+  assert/operation-summary-pattern:
+    subject: Operation
+    property: summary
+    message: Summary should match a regex
+    severity: error
+    pattern: /resource/
+  # casing
+  assert/operation-id-casing:
+    subject: Operation
+    property: operationId
+    message: NamedExamples key must be in PascalCase
+    severity: error
+    casing: camelCase
+  # mutuallyExclusive example
+  assert/operation-mutually-exclusive:
+    subject: Operation
+    message: 'Operation must not define both properties together: description and externalDocs'
+    severity: error
+    mutuallyExclusive:
+      - description
+      - externalDocs
+  # mutuallyRequired example
+  assert/schema-properties-mutually-required:
+    subject: SchemaProperties
+    context:
+      - type: Response
+    message: The created_at and updated_at properties are mutually required
+    severity: error
+    mutuallyRequired:
+      - created_at
+      - updated_at
+  # mutuallyRequired example with context
+  assert/response-map-required-with-context:
+    subject: ResponsesMap
+    context:
+      - type: Operation
+        matchParentKeys:
+          - put
+    message: Must mutually define 200 and 201 responses for PUT requests.
+    severity: error
+    mutuallyRequired:
+      - '200'
+      - '201'
+  # requireAny example
+  assert/operation-require-any-description-or-external:
+    subject: Operation
+    message: 'Operation must have one of properties defined: description or externalDocs'
+    severity: error
+    requireAny:
+      - description
+      - externalDocs
+  # disallowed example
+  assert/operation-disallowed:
+    subject: Operation
+    message: x-code-samples and x-internal must not be defined
+    severity: error
+    disallowed:
+      - x-code-samples
+      - x-internal
+  # defined example
+  assert/operation-defined:
+    subject: Operation
+    property: x-codeSamples
+    message: x-codeSamples must be defined
+    severity: error
+    defined: true
+  # undefined example
+  assert/operation-undefined:
+    subject: Operation
+    property: x-code-samples
+    message: x-code-samples is deprecated
+    suggest:
+      - x-codeSamples instead of x-code-samples
+    severity: error
+    undefined: true
+  # nonEmpty example
+  assert/operation-non-empty:
+    subject: Operation
+    property: summary
+    message: Operation summary should not be empty
+    severity: error
+    nonEmpty: true
+  # minLength example
+  assert/operation-min-length:
+    subject: Operation
+    property: summary
+    message: Operation summary must have minimum of 2 chars length
+    severity: error
+    minLength: 2
+  # maxLength example
+  assert/operation-max-length:
+    subject: Operation
+    property: summary
+    message: Operation summary must have a maximum of 2 characters
+    severity: error
+    maxLength: 20
+  # ref example
+  assert/ref:
+    subject: PathItem
+    message: No refs on Path Items
+    severity: error
+    ref: false
diff --git a/__tests__/lint/deprecated-apiDefinitions/snapshot.js b/__tests__/lint/deprecated-apiDefinitions/snapshot.js
index f65fe034..d1d9e645 100644
--- a/__tests__/lint/deprecated-apiDefinitions/snapshot.js
+++ b/__tests__/lint/deprecated-apiDefinitions/snapshot.js
@@ -2,8 +2,8 @@
 
 exports[`E2E lint deprecated-apiDefinitions 1`] = `
 
-The apiDefinitions field is deprecated. Use apis instead. Read more about this change: https://redocly.com/docs/api-registry/guides/migration-guide-config-file/#changed-properties
-The lint field is deprecated. Use styleguide instead. Read more about this change: https://redocly.com/docs/api-registry/guides/migration-guide-config-file/#changed-properties
+The 'apiDefinitions' field is deprecated. Use apis instead. Read more about this change: https://redocly.com/docs/api-registry/guides/migration-guide-config-file/#changed-properties
+The 'lint' field is deprecated. Read more about this change: https://redocly.com/docs/api-registry/guides/migration-guide-config-file/#changed-properties
 validating /openapi.yaml...
 [1] openapi.yaml:2:1 at #/info/contact
 
diff --git a/__tests__/lint/deprecated-lint/snapshot.js b/__tests__/lint/deprecated-lint/snapshot.js
index 67edbfea..ba056180 100644
--- a/__tests__/lint/deprecated-lint/snapshot.js
+++ b/__tests__/lint/deprecated-lint/snapshot.js
@@ -2,7 +2,7 @@
 
 exports[`E2E lint deprecated-lint 1`] = `
 
-The lint field is deprecated. Use styleguide instead. Read more about this change: https://redocly.com/docs/api-registry/guides/migration-guide-config-file/#changed-properties
+The 'lint' field is deprecated. Read more about this change: https://redocly.com/docs/api-registry/guides/migration-guide-config-file/#changed-properties
 validating /openapi.yaml...
 [1] openapi.yaml:11:7 at #/paths/~1pet~1findByStatus/get/responses
 
diff --git a/__tests__/lint/deprecated-styleguide/.redocly.yaml b/__tests__/lint/deprecated-styleguide/.redocly.yaml
new file mode 100644
index 00000000..e935b54a
--- /dev/null
+++ b/__tests__/lint/deprecated-styleguide/.redocly.yaml
@@ -0,0 +1,11 @@
+apis:
+  api@legacy:
+    root: ./openapi.yaml
+    styleguide: 
+      rules: 
+        operation-4xx-response: error
+
+styleguide:
+  rules:
+    info-contact: warn
+  extends: []
\ No newline at end of file
diff --git a/__tests__/lint/deprecated-styleguide/openapi.yaml b/__tests__/lint/deprecated-styleguide/openapi.yaml
new file mode 100644
index 00000000..34106d08
--- /dev/null
+++ b/__tests__/lint/deprecated-styleguide/openapi.yaml
@@ -0,0 +1,13 @@
+openapi: 3.1.0
+info:
+  title: Example OpenAPI 3 definition.
+  version: 1.0
+
+paths:
+  /pet/findByStatus:
+    get:
+      operationId: example
+      summary: summary example
+      responses:
+        '200':
+          description: example description
diff --git a/__tests__/lint/deprecated-styleguide/snapshot.js b/__tests__/lint/deprecated-styleguide/snapshot.js
new file mode 100644
index 00000000..f39da0f4
--- /dev/null
+++ b/__tests__/lint/deprecated-styleguide/snapshot.js
@@ -0,0 +1,40 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`E2E lint deprecated-styleguide 1`] = `
+
+The 'styleguide' field is deprecated. Read more about this change: https://redocly.com/docs/api-registry/guides/migration-guide-config-file/#changed-properties
+validating /openapi.yaml...
+[1] openapi.yaml:11:7 at #/paths/~1pet~1findByStatus/get/responses
+
+Operation must have at least one \`4XX\` response.
+
+ 9 | operationId: example
+10 | summary: summary example
+11 | responses:
+   | ^^^^^^^^^
+12 |   '200':
+13 |     description: example description
+
+Error was generated by the operation-4xx-response rule.
+
+
+[2] openapi.yaml:2:1 at #/info/contact
+
+Info object should contain \`contact\` field.
+
+1 | openapi: 3.1.0
+2 | info:
+  | ^^^^
+3 |   title: Example OpenAPI 3 definition.
+4 |   version: 1.0
+
+Warning was generated by the info-contact rule.
+
+
+/openapi.yaml: validated in <test>ms
+
+❌ Validation failed with 1 error and 1 warning.
+run \`openapi lint --generate-ignore-file\` to add all problems to the ignore file.
+
+
+`;
diff --git a/__tests__/lint/info-contact--lint-in-apis/.redocly.yaml b/__tests__/lint/info-contact--lint-in-apis/.redocly.yaml
index ac15b885..76ed7631 100644
--- a/__tests__/lint/info-contact--lint-in-apis/.redocly.yaml
+++ b/__tests__/lint/info-contact--lint-in-apis/.redocly.yaml
@@ -1,7 +1,6 @@
 apis:
   main@latest:
     root: ./openapi.yaml
-    styleguide:
-      rules:
-        info-contact: warn
-      extends: []
+    rules:
+      info-contact: warn
+    extends: []
diff --git a/__tests__/lint/info-contact-not-present-warning/.redocly.yaml b/__tests__/lint/info-contact-not-present-warning/.redocly.yaml
index 18fb972b..a1268564 100644
--- a/__tests__/lint/info-contact-not-present-warning/.redocly.yaml
+++ b/__tests__/lint/info-contact-not-present-warning/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    info-contact: warn
-  extends: []
+rules:
+  info-contact: warn
+extends: []
diff --git a/__tests__/lint/info-contact/.redocly.yaml b/__tests__/lint/info-contact/.redocly.yaml
index 18fb972b..a1268564 100644
--- a/__tests__/lint/info-contact/.redocly.yaml
+++ b/__tests__/lint/info-contact/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    info-contact: warn
-  extends: []
+rules:
+  info-contact: warn
+extends: []
diff --git a/__tests__/lint/info-description-empty-warning/.redocly.yaml b/__tests__/lint/info-description-empty-warning/.redocly.yaml
index 7db7dfd4..70db5070 100644
--- a/__tests__/lint/info-description-empty-warning/.redocly.yaml
+++ b/__tests__/lint/info-description-empty-warning/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    info-description: warn
-  extends: []
+rules:
+  info-description: warn
+extends: []
diff --git a/__tests__/lint/info-description-not-present-warning/.redocly.yaml b/__tests__/lint/info-description-not-present-warning/.redocly.yaml
index 7db7dfd4..70db5070 100644
--- a/__tests__/lint/info-description-not-present-warning/.redocly.yaml
+++ b/__tests__/lint/info-description-not-present-warning/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    info-description: warn
-  extends: []
+rules:
+  info-description: warn
+extends: []
diff --git a/__tests__/lint/info-description-rule/.redocly.yaml b/__tests__/lint/info-description-rule/.redocly.yaml
index 7db7dfd4..70db5070 100644
--- a/__tests__/lint/info-description-rule/.redocly.yaml
+++ b/__tests__/lint/info-description-rule/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    info-description: warn
-  extends: []
+rules:
+  info-description: warn
+extends: []
diff --git a/__tests__/lint/info-license-rule-not-present-warning/.redocly.yaml b/__tests__/lint/info-license-rule-not-present-warning/.redocly.yaml
index 3a5d63a2..f1e6155e 100644
--- a/__tests__/lint/info-license-rule-not-present-warning/.redocly.yaml
+++ b/__tests__/lint/info-license-rule-not-present-warning/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    info-license: warn
-  extends: []
+rules:
+  info-license: warn
+extends: []
diff --git a/__tests__/lint/info-license-rule/.redocly.yaml b/__tests__/lint/info-license-rule/.redocly.yaml
index 3a5d63a2..f1e6155e 100644
--- a/__tests__/lint/info-license-rule/.redocly.yaml
+++ b/__tests__/lint/info-license-rule/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    info-license: warn
-  extends: []
+rules:
+  info-license: warn
+extends: []
diff --git a/__tests__/lint/info-license-url-missing-warning/.redocly.yaml b/__tests__/lint/info-license-url-missing-warning/.redocly.yaml
index 175c6454..e28e7fd3 100644
--- a/__tests__/lint/info-license-url-missing-warning/.redocly.yaml
+++ b/__tests__/lint/info-license-url-missing-warning/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    info-license-url: warn
-  extends: []
+rules:
+  info-license-url: warn
+extends: []
diff --git a/__tests__/lint/info-license-url-rule/.redocly.yaml b/__tests__/lint/info-license-url-rule/.redocly.yaml
index 175c6454..e28e7fd3 100644
--- a/__tests__/lint/info-license-url-rule/.redocly.yaml
+++ b/__tests__/lint/info-license-url-rule/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    info-license-url: warn
-  extends: []
+rules:
+  info-license-url: warn
+extends: []
diff --git a/__tests__/lint/merge-lint-configs/.redocly.yaml b/__tests__/lint/merge-lint-configs/.redocly.yaml
index 308ad58a..27cd6331 100644
--- a/__tests__/lint/merge-lint-configs/.redocly.yaml
+++ b/__tests__/lint/merge-lint-configs/.redocly.yaml
@@ -1,11 +1,9 @@
 apis:
   main:
     root: ./openapi.yaml
-    styleguide: 
-      rules:
-        info-description: warn
+    rules:
+      info-description: warn
 
-styleguide:
-  rules:
-    info-description: error
-  extends: []
+rules:
+  info-description: error
+extends: []
diff --git a/__tests__/lint/no-empty-servers-rule/.redocly.yaml b/__tests__/lint/no-empty-servers-rule/.redocly.yaml
index 3211c7c4..fce711ff 100644
--- a/__tests__/lint/no-empty-servers-rule/.redocly.yaml
+++ b/__tests__/lint/no-empty-servers-rule/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    no-empty-servers: warn
-  extends: []
+rules:
+  no-empty-servers: warn
+extends: []
diff --git a/__tests__/lint/no-empty-servers-warning/.redocly.yaml b/__tests__/lint/no-empty-servers-warning/.redocly.yaml
index 3211c7c4..fce711ff 100644
--- a/__tests__/lint/no-empty-servers-warning/.redocly.yaml
+++ b/__tests__/lint/no-empty-servers-warning/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    no-empty-servers: warn
-  extends: []
+rules:
+  no-empty-servers: warn
+extends: []
diff --git a/__tests__/lint/no-enum-type-mismatch-error-recommended-config/.redocly.yaml b/__tests__/lint/no-enum-type-mismatch-error-recommended-config/.redocly.yaml
index a639c041..08d47eba 100644
--- a/__tests__/lint/no-enum-type-mismatch-error-recommended-config/.redocly.yaml
+++ b/__tests__/lint/no-enum-type-mismatch-error-recommended-config/.redocly.yaml
@@ -1,6 +1,5 @@
 apiDefinitions:
   main: ./openapi.yaml
 
-styleguide:
-  extends:
-    - recommended # This is the default (and built in) configuration.
\ No newline at end of file
+extends:
+  - recommended # This is the default (and built in) configuration.
diff --git a/__tests__/lint/no-enum-type-mismatch-error-recommended-config/snapshot.js b/__tests__/lint/no-enum-type-mismatch-error-recommended-config/snapshot.js
index fa00a8af..8886583b 100644
--- a/__tests__/lint/no-enum-type-mismatch-error-recommended-config/snapshot.js
+++ b/__tests__/lint/no-enum-type-mismatch-error-recommended-config/snapshot.js
@@ -2,7 +2,7 @@
 
 exports[`E2E lint no-enum-type-mismatch-error-recommended-config 1`] = `
 
-The apiDefinitions field is deprecated. Use apis instead. Read more about this change: https://redocly.com/docs/api-registry/guides/migration-guide-config-file/#changed-properties
+The 'apiDefinitions' field is deprecated. Use apis instead. Read more about this change: https://redocly.com/docs/api-registry/guides/migration-guide-config-file/#changed-properties
 validating /openapi.yaml...
 [1] openapi.yaml:1:1 at #/openapi
 
diff --git a/__tests__/lint/no-enum-type-mismatch-error/.redocly.yaml b/__tests__/lint/no-enum-type-mismatch-error/.redocly.yaml
index 714443d9..56ee5b28 100644
--- a/__tests__/lint/no-enum-type-mismatch-error/.redocly.yaml
+++ b/__tests__/lint/no-enum-type-mismatch-error/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    no-enum-type-mismatch: error
-  extends: []
+rules:
+  no-enum-type-mismatch: error
+extends: []
diff --git a/__tests__/lint/no-enum-type-mismatch/.redocly.yaml b/__tests__/lint/no-enum-type-mismatch/.redocly.yaml
index 714443d9..56ee5b28 100644
--- a/__tests__/lint/no-enum-type-mismatch/.redocly.yaml
+++ b/__tests__/lint/no-enum-type-mismatch/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    no-enum-type-mismatch: error
-  extends: []
+rules:
+  no-enum-type-mismatch: error
+extends: []
diff --git a/__tests__/lint/no-http-verbs-in-paths-error/.redocly.yaml b/__tests__/lint/no-http-verbs-in-paths-error/.redocly.yaml
index c286dc11..c406a61d 100644
--- a/__tests__/lint/no-http-verbs-in-paths-error/.redocly.yaml
+++ b/__tests__/lint/no-http-verbs-in-paths-error/.redocly.yaml
@@ -2,8 +2,7 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    no-http-verbs-in-paths:
-      severity: error
-  extends: []
+rules:
+  no-http-verbs-in-paths:
+    severity: error
+extends: []
diff --git a/__tests__/lint/no-http-verbs-in-paths-split-words-error/.redocly.yaml b/__tests__/lint/no-http-verbs-in-paths-split-words-error/.redocly.yaml
index 8bcfa4b6..6f1d0d7a 100644
--- a/__tests__/lint/no-http-verbs-in-paths-split-words-error/.redocly.yaml
+++ b/__tests__/lint/no-http-verbs-in-paths-split-words-error/.redocly.yaml
@@ -2,9 +2,8 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    no-http-verbs-in-paths:
-      severity: error
-      splitIntoWords: true
-  extends: []
+rules:
+  no-http-verbs-in-paths:
+    severity: error
+    splitIntoWords: true
+extends: []
diff --git a/__tests__/lint/no-invalid-media-type-examples-invalid-schema/.redocly.yaml b/__tests__/lint/no-invalid-media-type-examples-invalid-schema/.redocly.yaml
index ceaa9cfe..1dbb4340 100644
--- a/__tests__/lint/no-invalid-media-type-examples-invalid-schema/.redocly.yaml
+++ b/__tests__/lint/no-invalid-media-type-examples-invalid-schema/.redocly.yaml
@@ -2,6 +2,5 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  extends:
-    - recommended
+extends:
+  - recommended
diff --git a/__tests__/lint/no-invalid-media-type-examples-recursion-oneOf/.redocly.yaml b/__tests__/lint/no-invalid-media-type-examples-recursion-oneOf/.redocly.yaml
index 21591403..c18783e9 100644
--- a/__tests__/lint/no-invalid-media-type-examples-recursion-oneOf/.redocly.yaml
+++ b/__tests__/lint/no-invalid-media-type-examples-recursion-oneOf/.redocly.yaml
@@ -2,6 +2,5 @@ apis:
   main:
     root: ./openapi.json
 
-styleguide:
-  extends:
-    - recommended
+extends:
+  - recommended
diff --git a/__tests__/lint/no-invalid-media-type-examples-recursion/.redocly.yaml b/__tests__/lint/no-invalid-media-type-examples-recursion/.redocly.yaml
index 21591403..c18783e9 100644
--- a/__tests__/lint/no-invalid-media-type-examples-recursion/.redocly.yaml
+++ b/__tests__/lint/no-invalid-media-type-examples-recursion/.redocly.yaml
@@ -2,6 +2,5 @@ apis:
   main:
     root: ./openapi.json
 
-styleguide:
-  extends:
-    - recommended
+extends:
+  - recommended
diff --git a/__tests__/lint/no-invalid-media-type-examples/.redocly.yaml b/__tests__/lint/no-invalid-media-type-examples/.redocly.yaml
index fe368d32..77796510 100644
--- a/__tests__/lint/no-invalid-media-type-examples/.redocly.yaml
+++ b/__tests__/lint/no-invalid-media-type-examples/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  extends: []
-  rules:
-    no-invalid-media-type-examples: error
+extends: []
+rules:
+  no-invalid-media-type-examples: error
diff --git a/__tests__/lint/no-invalid-schema-examples-array-error/.redocly.yaml b/__tests__/lint/no-invalid-schema-examples-array-error/.redocly.yaml
index 12f0dda7..c4297a19 100644
--- a/__tests__/lint/no-invalid-schema-examples-array-error/.redocly.yaml
+++ b/__tests__/lint/no-invalid-schema-examples-array-error/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    no-invalid-schema-examples: error
-  extends: []
+rules:
+  no-invalid-schema-examples: error
+extends: []
diff --git a/__tests__/lint/no-invalid-schema-examples-nested-error/.redocly.yaml b/__tests__/lint/no-invalid-schema-examples-nested-error/.redocly.yaml
index 12f0dda7..c4297a19 100644
--- a/__tests__/lint/no-invalid-schema-examples-nested-error/.redocly.yaml
+++ b/__tests__/lint/no-invalid-schema-examples-nested-error/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    no-invalid-schema-examples: error
-  extends: []
+rules:
+  no-invalid-schema-examples: error
+extends: []
diff --git a/__tests__/lint/no-invalid-schema-examples-oas3.1-error/.redocly.yaml b/__tests__/lint/no-invalid-schema-examples-oas3.1-error/.redocly.yaml
index 12f0dda7..c4297a19 100644
--- a/__tests__/lint/no-invalid-schema-examples-oas3.1-error/.redocly.yaml
+++ b/__tests__/lint/no-invalid-schema-examples-oas3.1-error/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    no-invalid-schema-examples: error
-  extends: []
+rules:
+  no-invalid-schema-examples: error
+extends: []
diff --git a/__tests__/lint/no-invalid-schema-examples-oas3.1/.redocly.yaml b/__tests__/lint/no-invalid-schema-examples-oas3.1/.redocly.yaml
index 12f0dda7..c4297a19 100644
--- a/__tests__/lint/no-invalid-schema-examples-oas3.1/.redocly.yaml
+++ b/__tests__/lint/no-invalid-schema-examples-oas3.1/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    no-invalid-schema-examples: error
-  extends: []
+rules:
+  no-invalid-schema-examples: error
+extends: []
diff --git a/__tests__/lint/no-invalid-schema-examples-string-number-error/.redocly.yaml b/__tests__/lint/no-invalid-schema-examples-string-number-error/.redocly.yaml
index 12f0dda7..c4297a19 100644
--- a/__tests__/lint/no-invalid-schema-examples-string-number-error/.redocly.yaml
+++ b/__tests__/lint/no-invalid-schema-examples-string-number-error/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    no-invalid-schema-examples: error
-  extends: []
+rules:
+  no-invalid-schema-examples: error
+extends: []
diff --git a/__tests__/lint/no-invalid-schema-examples/.redocly.yaml b/__tests__/lint/no-invalid-schema-examples/.redocly.yaml
index 12f0dda7..c4297a19 100644
--- a/__tests__/lint/no-invalid-schema-examples/.redocly.yaml
+++ b/__tests__/lint/no-invalid-schema-examples/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    no-invalid-schema-examples: error
-  extends: []
+rules:
+  no-invalid-schema-examples: error
+extends: []
diff --git a/__tests__/lint/no-path-trailing-slash-error/.redocly.yaml b/__tests__/lint/no-path-trailing-slash-error/.redocly.yaml
index 29dca02f..37ff2af7 100644
--- a/__tests__/lint/no-path-trailing-slash-error/.redocly.yaml
+++ b/__tests__/lint/no-path-trailing-slash-error/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    no-path-trailing-slash: error
-  extends: []
+rules:
+  no-path-trailing-slash: error
+extends: []
diff --git a/__tests__/lint/no-path-trailing-slash-off/.redocly.yaml b/__tests__/lint/no-path-trailing-slash-off/.redocly.yaml
index 935bf48c..d4689a95 100644
--- a/__tests__/lint/no-path-trailing-slash-off/.redocly.yaml
+++ b/__tests__/lint/no-path-trailing-slash-off/.redocly.yaml
@@ -2,8 +2,7 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    no-path-trailing-slash: off
-    paths-kebab-case: error
-  extends: []
+rules:
+  no-path-trailing-slash: off
+  paths-kebab-case: error
+extends: []
diff --git a/__tests__/lint/no-path-trailing-slash-rule/.redocly.yaml b/__tests__/lint/no-path-trailing-slash-rule/.redocly.yaml
index 29dca02f..37ff2af7 100644
--- a/__tests__/lint/no-path-trailing-slash-rule/.redocly.yaml
+++ b/__tests__/lint/no-path-trailing-slash-rule/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    no-path-trailing-slash: error
-  extends: []
+rules:
+  no-path-trailing-slash: error
+extends: []
diff --git a/__tests__/lint/no-server-example-rule/.redocly.yaml b/__tests__/lint/no-server-example-rule/.redocly.yaml
index 50414fee..7cdd6e10 100644
--- a/__tests__/lint/no-server-example-rule/.redocly.yaml
+++ b/__tests__/lint/no-server-example-rule/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    no-server-example.com: warn
-  extends: []
+rules:
+  no-server-example.com: warn
+extends: []
diff --git a/__tests__/lint/no-server-trailing-slash-error/.redocly.yaml b/__tests__/lint/no-server-trailing-slash-error/.redocly.yaml
index b73de42f..9148e20b 100644
--- a/__tests__/lint/no-server-trailing-slash-error/.redocly.yaml
+++ b/__tests__/lint/no-server-trailing-slash-error/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    no-server-trailing-slash: error
-  extends: []
+rules:
+  no-server-trailing-slash: error
+extends: []
diff --git a/__tests__/lint/no-server-trailing-slash-rule/.redocly.yaml b/__tests__/lint/no-server-trailing-slash-rule/.redocly.yaml
index b73de42f..9148e20b 100644
--- a/__tests__/lint/no-server-trailing-slash-rule/.redocly.yaml
+++ b/__tests__/lint/no-server-trailing-slash-rule/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    no-server-trailing-slash: error
-  extends: []
+rules:
+  no-server-trailing-slash: error
+extends: []
diff --git a/__tests__/lint/no-server-variables-empty-enum-errror/.redocly.yaml b/__tests__/lint/no-server-variables-empty-enum-errror/.redocly.yaml
index bbacf150..1bcf1742 100644
--- a/__tests__/lint/no-server-variables-empty-enum-errror/.redocly.yaml
+++ b/__tests__/lint/no-server-variables-empty-enum-errror/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    no-server-variables-empty-enum: error
-  extends: []
+rules:
+  no-server-variables-empty-enum: error
+extends: []
diff --git a/__tests__/lint/no-server-variables-empty-enum/.redocly.yaml b/__tests__/lint/no-server-variables-empty-enum/.redocly.yaml
index bbacf150..1bcf1742 100644
--- a/__tests__/lint/no-server-variables-empty-enum/.redocly.yaml
+++ b/__tests__/lint/no-server-variables-empty-enum/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    no-server-variables-empty-enum: error
-  extends: []
+rules:
+  no-server-variables-empty-enum: error
+extends: []
diff --git a/__tests__/lint/no-undefined-server-variable-error-recommended-config/.redocly.yaml b/__tests__/lint/no-undefined-server-variable-error-recommended-config/.redocly.yaml
index a639c041..0964060a 100644
--- a/__tests__/lint/no-undefined-server-variable-error-recommended-config/.redocly.yaml
+++ b/__tests__/lint/no-undefined-server-variable-error-recommended-config/.redocly.yaml
@@ -1,6 +1,5 @@
 apiDefinitions:
   main: ./openapi.yaml
 
-styleguide:
-  extends:
-    - recommended # This is the default (and built in) configuration.
\ No newline at end of file
+extends:
+  - recommended # This is the default (and built in) configuration.
\ No newline at end of file
diff --git a/__tests__/lint/no-undefined-server-variable-error-recommended-config/snapshot.js b/__tests__/lint/no-undefined-server-variable-error-recommended-config/snapshot.js
index c555ec66..fb2789e1 100644
--- a/__tests__/lint/no-undefined-server-variable-error-recommended-config/snapshot.js
+++ b/__tests__/lint/no-undefined-server-variable-error-recommended-config/snapshot.js
@@ -2,7 +2,7 @@
 
 exports[`E2E lint no-undefined-server-variable-error-recommended-config 1`] = `
 
-The apiDefinitions field is deprecated. Use apis instead. Read more about this change: https://redocly.com/docs/api-registry/guides/migration-guide-config-file/#changed-properties
+The 'apiDefinitions' field is deprecated. Use apis instead. Read more about this change: https://redocly.com/docs/api-registry/guides/migration-guide-config-file/#changed-properties
 validating /openapi.yaml...
 [1] openapi.yaml:7:5 at #/servers/0/url
 
diff --git a/__tests__/lint/no-unresolved-refs-error/.redocly.yaml b/__tests__/lint/no-unresolved-refs-error/.redocly.yaml
index cacd0974..d53df931 100644
--- a/__tests__/lint/no-unresolved-refs-error/.redocly.yaml
+++ b/__tests__/lint/no-unresolved-refs-error/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    no-unresolved-refs: error
-  extends: []
+rules:
+  no-unresolved-refs: error
+extends: []
diff --git a/__tests__/lint/no-unresolved-refs-rule/.redocly.yaml b/__tests__/lint/no-unresolved-refs-rule/.redocly.yaml
index cacd0974..d53df931 100644
--- a/__tests__/lint/no-unresolved-refs-rule/.redocly.yaml
+++ b/__tests__/lint/no-unresolved-refs-rule/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    no-unresolved-refs: error
-  extends: []
+rules:
+  no-unresolved-refs: error
+extends: []
diff --git a/__tests__/lint/no-unused-components-rule/.redocly.yaml b/__tests__/lint/no-unused-components-rule/.redocly.yaml
index 50252c21..6a71e6cc 100644
--- a/__tests__/lint/no-unused-components-rule/.redocly.yaml
+++ b/__tests__/lint/no-unused-components-rule/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    no-unused-components: warn
-  extends: []
+rules:
+  no-unused-components: warn
+extends: []
diff --git a/__tests__/lint/no-unused-components-warning/.redocly.yaml b/__tests__/lint/no-unused-components-warning/.redocly.yaml
index 50252c21..6a71e6cc 100644
--- a/__tests__/lint/no-unused-components-warning/.redocly.yaml
+++ b/__tests__/lint/no-unused-components-warning/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    no-unused-components: warn
-  extends: []
+rules:
+  no-unused-components: warn
+extends: []
diff --git a/__tests__/lint/oas2/.redocly.yaml b/__tests__/lint/oas2/.redocly.yaml
index ceaa9cfe..1dbb4340 100644
--- a/__tests__/lint/oas2/.redocly.yaml
+++ b/__tests__/lint/oas2/.redocly.yaml
@@ -2,6 +2,5 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  extends:
-    - recommended
+extends:
+  - recommended
diff --git a/__tests__/lint/oas3-no-errors/.redocly.yaml b/__tests__/lint/oas3-no-errors/.redocly.yaml
index ceaa9cfe..1dbb4340 100644
--- a/__tests__/lint/oas3-no-errors/.redocly.yaml
+++ b/__tests__/lint/oas3-no-errors/.redocly.yaml
@@ -2,6 +2,5 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  extends:
-    - recommended
+extends:
+  - recommended
diff --git a/__tests__/lint/oas3.1-error/.redocly.yaml b/__tests__/lint/oas3.1-error/.redocly.yaml
index ceaa9cfe..1dbb4340 100644
--- a/__tests__/lint/oas3.1-error/.redocly.yaml
+++ b/__tests__/lint/oas3.1-error/.redocly.yaml
@@ -2,6 +2,5 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  extends:
-    - recommended
+extends:
+  - recommended
diff --git a/__tests__/lint/oas3.1/.redocly.yaml b/__tests__/lint/oas3.1/.redocly.yaml
index ceaa9cfe..1dbb4340 100644
--- a/__tests__/lint/oas3.1/.redocly.yaml
+++ b/__tests__/lint/oas3.1/.redocly.yaml
@@ -2,6 +2,5 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  extends:
-    - recommended
+extends:
+  - recommended
diff --git a/__tests__/lint/operation-2xx-response-rule/.redocly.yaml b/__tests__/lint/operation-2xx-response-rule/.redocly.yaml
index c331f3cf..cdd18670 100644
--- a/__tests__/lint/operation-2xx-response-rule/.redocly.yaml
+++ b/__tests__/lint/operation-2xx-response-rule/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    operation-2xx-response: warn
-  extends: []
+rules:
+  operation-2xx-response: warn
+extends: []
diff --git a/__tests__/lint/operation-2xx-response-warning/.redocly.yaml b/__tests__/lint/operation-2xx-response-warning/.redocly.yaml
index c331f3cf..cdd18670 100644
--- a/__tests__/lint/operation-2xx-response-warning/.redocly.yaml
+++ b/__tests__/lint/operation-2xx-response-warning/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    operation-2xx-response: warn
-  extends: []
+rules:
+  operation-2xx-response: warn
+extends: []
diff --git a/__tests__/lint/operation-4xx-problem-details-rfc7807/.redocly.yaml b/__tests__/lint/operation-4xx-problem-details-rfc7807/.redocly.yaml
index 181437c6..37bfdc34 100644
--- a/__tests__/lint/operation-4xx-problem-details-rfc7807/.redocly.yaml
+++ b/__tests__/lint/operation-4xx-problem-details-rfc7807/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    operation-4xx-problem-details-rfc7807: error
-  extends: []
+rules:
+  operation-4xx-problem-details-rfc7807: error
+extends: []
diff --git a/__tests__/lint/operation-4xx-response-rule/.redocly.yaml b/__tests__/lint/operation-4xx-response-rule/.redocly.yaml
index 19f0a53c..a14c35dd 100644
--- a/__tests__/lint/operation-4xx-response-rule/.redocly.yaml
+++ b/__tests__/lint/operation-4xx-response-rule/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    operation-4xx-response: warn
-  extends: []
+rules:
+  operation-4xx-response: warn
+extends: []
diff --git a/__tests__/lint/operation-4xx-response-warning/.redocly.yaml b/__tests__/lint/operation-4xx-response-warning/.redocly.yaml
index 19f0a53c..a14c35dd 100644
--- a/__tests__/lint/operation-4xx-response-warning/.redocly.yaml
+++ b/__tests__/lint/operation-4xx-response-warning/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    operation-4xx-response: warn
-  extends: []
+rules:
+  operation-4xx-response: warn
+extends: []
diff --git a/__tests__/lint/operation-description-rule/.redocly.yaml b/__tests__/lint/operation-description-rule/.redocly.yaml
index 7482c366..b4ff548a 100644
--- a/__tests__/lint/operation-description-rule/.redocly.yaml
+++ b/__tests__/lint/operation-description-rule/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    operation-description: warn
-  extends: []
+rules:
+  operation-description: warn
+extends: []
diff --git a/__tests__/lint/operation-description-warning/.redocly.yaml b/__tests__/lint/operation-description-warning/.redocly.yaml
index 7482c366..b4ff548a 100644
--- a/__tests__/lint/operation-description-warning/.redocly.yaml
+++ b/__tests__/lint/operation-description-warning/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    operation-description: warn
-  extends: []
+rules:
+  operation-description: warn
+extends: []
diff --git a/__tests__/lint/operation-operationId-in-callback/.redocly.yaml b/__tests__/lint/operation-operationId-in-callback/.redocly.yaml
index ceaa9cfe..1dbb4340 100644
--- a/__tests__/lint/operation-operationId-in-callback/.redocly.yaml
+++ b/__tests__/lint/operation-operationId-in-callback/.redocly.yaml
@@ -2,6 +2,5 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  extends:
-    - recommended
+extends:
+  - recommended
diff --git a/__tests__/lint/operation-operationId-unique-error/.redocly.yaml b/__tests__/lint/operation-operationId-unique-error/.redocly.yaml
index fe0d1019..163a7f0e 100644
--- a/__tests__/lint/operation-operationId-unique-error/.redocly.yaml
+++ b/__tests__/lint/operation-operationId-unique-error/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    operation-operationId-unique: error
-  extends: []
+rules:
+  operation-operationId-unique: error
+extends: []
diff --git a/__tests__/lint/operation-operationId-unique-rule/.redocly.yaml b/__tests__/lint/operation-operationId-unique-rule/.redocly.yaml
index fe0d1019..163a7f0e 100644
--- a/__tests__/lint/operation-operationId-unique-rule/.redocly.yaml
+++ b/__tests__/lint/operation-operationId-unique-rule/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    operation-operationId-unique: error
-  extends: []
+rules:
+  operation-operationId-unique: error
+extends: []
diff --git a/__tests__/lint/operation-parameters-unique-rule/.redocly.yaml b/__tests__/lint/operation-parameters-unique-rule/.redocly.yaml
index 59f0d5ca..d2ec08d5 100644
--- a/__tests__/lint/operation-parameters-unique-rule/.redocly.yaml
+++ b/__tests__/lint/operation-parameters-unique-rule/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    operation-parameters-unique: error
-  extends: []
+rules:
+  operation-parameters-unique: error
+extends: []
diff --git a/__tests__/lint/operation-security-defined-rule/.redocly.yaml b/__tests__/lint/operation-security-defined-rule/.redocly.yaml
index 84167479..c7b0caa3 100644
--- a/__tests__/lint/operation-security-defined-rule/.redocly.yaml
+++ b/__tests__/lint/operation-security-defined-rule/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    operation-security-defined: warn
-  extends: []
+rules:
+  operation-security-defined: warn
+extends: []
diff --git a/__tests__/lint/operation-security-defined-warning/.redocly.yaml b/__tests__/lint/operation-security-defined-warning/.redocly.yaml
index 84167479..c7b0caa3 100644
--- a/__tests__/lint/operation-security-defined-warning/.redocly.yaml
+++ b/__tests__/lint/operation-security-defined-warning/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    operation-security-defined: warn
-  extends: []
+rules:
+  operation-security-defined: warn
+extends: []
diff --git a/__tests__/lint/operation-security-scheme-oas2-error/.redocly.yaml b/__tests__/lint/operation-security-scheme-oas2-error/.redocly.yaml
index ceaa9cfe..1dbb4340 100644
--- a/__tests__/lint/operation-security-scheme-oas2-error/.redocly.yaml
+++ b/__tests__/lint/operation-security-scheme-oas2-error/.redocly.yaml
@@ -2,6 +2,5 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  extends:
-    - recommended
+extends:
+  - recommended
diff --git a/__tests__/lint/operation-security-scheme-oas3-error/.redocly.yaml b/__tests__/lint/operation-security-scheme-oas3-error/.redocly.yaml
index ceaa9cfe..1dbb4340 100644
--- a/__tests__/lint/operation-security-scheme-oas3-error/.redocly.yaml
+++ b/__tests__/lint/operation-security-scheme-oas3-error/.redocly.yaml
@@ -2,6 +2,5 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  extends:
-    - recommended
+extends:
+  - recommended
diff --git a/__tests__/lint/operation-tag-defined-rule/.redocly.yaml b/__tests__/lint/operation-tag-defined-rule/.redocly.yaml
index 1a041124..5b1a2777 100644
--- a/__tests__/lint/operation-tag-defined-rule/.redocly.yaml
+++ b/__tests__/lint/operation-tag-defined-rule/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    operation-tag-defined: warn
-  extends: []
+rules:
+  operation-tag-defined: warn
+extends: []
diff --git a/__tests__/lint/parameter-description-rule/.redocly.yaml b/__tests__/lint/parameter-description-rule/.redocly.yaml
index 81df383f..3a769c16 100644
--- a/__tests__/lint/parameter-description-rule/.redocly.yaml
+++ b/__tests__/lint/parameter-description-rule/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    parameter-description: warn
-  extends: []
+rules:
+  parameter-description: warn
+extends: []
diff --git a/__tests__/lint/parameter-description-warning/.redocly.yaml b/__tests__/lint/parameter-description-warning/.redocly.yaml
index 81df383f..3a769c16 100644
--- a/__tests__/lint/parameter-description-warning/.redocly.yaml
+++ b/__tests__/lint/parameter-description-warning/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    parameter-description: warn
-  extends: []
+rules:
+  parameter-description: warn
+extends: []
diff --git a/__tests__/lint/path-declaration-must-exist-error/.redocly.yaml b/__tests__/lint/path-declaration-must-exist-error/.redocly.yaml
index c7e92292..f595ae32 100644
--- a/__tests__/lint/path-declaration-must-exist-error/.redocly.yaml
+++ b/__tests__/lint/path-declaration-must-exist-error/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    path-declaration-must-exist: error
-  extends: []
+rules:
+  path-declaration-must-exist: error
+extends: []
diff --git a/__tests__/lint/path-declaration-must-exist-rule/.redocly.yaml b/__tests__/lint/path-declaration-must-exist-rule/.redocly.yaml
index c7e92292..f595ae32 100644
--- a/__tests__/lint/path-declaration-must-exist-rule/.redocly.yaml
+++ b/__tests__/lint/path-declaration-must-exist-rule/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    path-declaration-must-exist: error
-  extends: []
+rules:
+  path-declaration-must-exist: error
+extends: []
diff --git a/__tests__/lint/path-excludes-patterns/.redocly.yaml b/__tests__/lint/path-excludes-patterns/.redocly.yaml
index 142056b8..2c86be58 100644
--- a/__tests__/lint/path-excludes-patterns/.redocly.yaml
+++ b/__tests__/lint/path-excludes-patterns/.redocly.yaml
@@ -2,10 +2,9 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    path-excludes-patterns:
-      severity: error
-      patterns:
-        - ^\/[a-z]
-  extends: []
+rules:
+  path-excludes-patterns:
+    severity: error
+    patterns:
+      - ^\/[a-z]
+extends: []
diff --git a/__tests__/lint/path-not-include-query-error/.redocly.yaml b/__tests__/lint/path-not-include-query-error/.redocly.yaml
index 5cd5788b..f9702567 100644
--- a/__tests__/lint/path-not-include-query-error/.redocly.yaml
+++ b/__tests__/lint/path-not-include-query-error/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    path-not-include-query: error
-  extends: []
+rules:
+  path-not-include-query: error
+extends: []
diff --git a/__tests__/lint/path-not-include-query-rule/.redocly.yaml b/__tests__/lint/path-not-include-query-rule/.redocly.yaml
index 5cd5788b..f9702567 100644
--- a/__tests__/lint/path-not-include-query-rule/.redocly.yaml
+++ b/__tests__/lint/path-not-include-query-rule/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    path-not-include-query: error
-  extends: []
+rules:
+  path-not-include-query: error
+extends: []
diff --git a/__tests__/lint/path-parameters-defined-error/.redocly.yaml b/__tests__/lint/path-parameters-defined-error/.redocly.yaml
index 8ce729ac..224f3566 100644
--- a/__tests__/lint/path-parameters-defined-error/.redocly.yaml
+++ b/__tests__/lint/path-parameters-defined-error/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    path-parameters-defined: error
-  extends: []
+rules:
+  path-parameters-defined: error
+extends: []
diff --git a/__tests__/lint/path-parameters-defined-rule/.redocly.yaml b/__tests__/lint/path-parameters-defined-rule/.redocly.yaml
index 8ce729ac..224f3566 100644
--- a/__tests__/lint/path-parameters-defined-rule/.redocly.yaml
+++ b/__tests__/lint/path-parameters-defined-rule/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    path-parameters-defined: error
-  extends: []
+rules:
+  path-parameters-defined: error
+extends: []
diff --git a/__tests__/lint/path-segment-plural-error/.redocly.yaml b/__tests__/lint/path-segment-plural-error/.redocly.yaml
index 5e5ac6b1..f5246084 100644
--- a/__tests__/lint/path-segment-plural-error/.redocly.yaml
+++ b/__tests__/lint/path-segment-plural-error/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    path-segment-plural: error
-  extends: []
+rules:
+  path-segment-plural: error
+extends: []
diff --git a/__tests__/lint/path-segment-plural/.redocly.yaml b/__tests__/lint/path-segment-plural/.redocly.yaml
index 8a6fea4b..de3dded1 100644
--- a/__tests__/lint/path-segment-plural/.redocly.yaml
+++ b/__tests__/lint/path-segment-plural/.redocly.yaml
@@ -2,12 +2,11 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    path-segment-plural:
-      severity: error
-      ignoreLastPathSegment: true
-      exceptions:
-        - v1
-        - pet
-  extends: []
+rules:
+  path-segment-plural:
+    severity: error
+    ignoreLastPathSegment: true
+    exceptions:
+      - v1
+      - pet
+extends: []
diff --git a/__tests__/lint/request-response-mime-type-oas2-error/.redocly.yaml b/__tests__/lint/request-response-mime-type-oas2-error/.redocly.yaml
index fe82e049..4e9a5915 100644
--- a/__tests__/lint/request-response-mime-type-oas2-error/.redocly.yaml
+++ b/__tests__/lint/request-response-mime-type-oas2-error/.redocly.yaml
@@ -2,14 +2,13 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    request-mime-type:
-      severity: error
-      allowedValues:
-        - application/json
-    response-mime-type:
-      severity: error
-      allowedValues:
-        - application/json
-  extends: []
\ No newline at end of file
+rules:
+  request-mime-type:
+    severity: error
+    allowedValues:
+      - application/json
+  response-mime-type:
+    severity: error
+    allowedValues:
+      - application/json
+extends: []
\ No newline at end of file
diff --git a/__tests__/lint/request-response-mime-type-oas3-error/.redocly.yaml b/__tests__/lint/request-response-mime-type-oas3-error/.redocly.yaml
index c9ca0fa2..7876bb78 100644
--- a/__tests__/lint/request-response-mime-type-oas3-error/.redocly.yaml
+++ b/__tests__/lint/request-response-mime-type-oas3-error/.redocly.yaml
@@ -2,14 +2,13 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    request-mime-type:
-      severity: error
-      allowedValues:
-        - application/json
-    response-mime-type:
-      severity: error
-      allowedValues:
-        - application/json
-  extends: []
+rules:
+  request-mime-type:
+    severity: error
+    allowedValues:
+      - application/json
+  response-mime-type:
+    severity: error
+    allowedValues:
+      - application/json
+extends: []
diff --git a/__tests__/lint/request-response-mime-type-oas3.1-error/.redocly.yaml b/__tests__/lint/request-response-mime-type-oas3.1-error/.redocly.yaml
index c9ca0fa2..7876bb78 100644
--- a/__tests__/lint/request-response-mime-type-oas3.1-error/.redocly.yaml
+++ b/__tests__/lint/request-response-mime-type-oas3.1-error/.redocly.yaml
@@ -2,14 +2,13 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    request-mime-type:
-      severity: error
-      allowedValues:
-        - application/json
-    response-mime-type:
-      severity: error
-      allowedValues:
-        - application/json
-  extends: []
+rules:
+  request-mime-type:
+    severity: error
+    allowedValues:
+      - application/json
+  response-mime-type:
+    severity: error
+    allowedValues:
+      - application/json
+extends: []
diff --git a/__tests__/lint/spec-error-if-minimum-not-correct/.redocly.yaml b/__tests__/lint/spec-error-if-minimum-not-correct/.redocly.yaml
new file mode 100644
index 00000000..ab55088c
--- /dev/null
+++ b/__tests__/lint/spec-error-if-minimum-not-correct/.redocly.yaml
@@ -0,0 +1,6 @@
+apis:
+  main: 
+    root: ./openapi.yaml
+
+rules:
+  spec: error
diff --git a/__tests__/spec-error-if-minimum-not-correct/openapi.yaml b/__tests__/lint/spec-error-if-minimum-not-correct/openapi.yaml
similarity index 100%
rename from __tests__/spec-error-if-minimum-not-correct/openapi.yaml
rename to __tests__/lint/spec-error-if-minimum-not-correct/openapi.yaml
diff --git a/__tests__/spec-error-if-minimum-not-correct/snapshot.js b/__tests__/lint/spec-error-if-minimum-not-correct/snapshot.js
similarity index 97%
rename from __tests__/spec-error-if-minimum-not-correct/snapshot.js
rename to __tests__/lint/spec-error-if-minimum-not-correct/snapshot.js
index 0a90a494..983cd8f6 100644
--- a/__tests__/spec-error-if-minimum-not-correct/snapshot.js
+++ b/__tests__/lint/spec-error-if-minimum-not-correct/snapshot.js
@@ -3,6 +3,7 @@
 exports[`E2E lint spec-error-if-minimum-not-correct 1`] = `
 
 No configurations were defined in extends -- using built in recommended configuration by default.
+Warning! This default behavior is going to be deprecated soon.
 
 validating /openapi.yaml...
 [1] openapi.yaml:29:23 at #/paths/~1pet~1findByStatus/get/parameters/0/schema/minItems
diff --git a/__tests__/lint/spec-from/.redocly.yaml b/__tests__/lint/spec-from/.redocly.yaml
index 00592e74..772b5cdd 100644
--- a/__tests__/lint/spec-from/.redocly.yaml
+++ b/__tests__/lint/spec-from/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  extends: []
-  rules:
-    spec: error
+extends: []
+rules:
+  spec: error
diff --git a/__tests__/lint/tags-alphabetical-rule/.redocly.yaml b/__tests__/lint/tags-alphabetical-rule/.redocly.yaml
index c5a0064e..26472699 100644
--- a/__tests__/lint/tags-alphabetical-rule/.redocly.yaml
+++ b/__tests__/lint/tags-alphabetical-rule/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    tags-alphabetical: warn
-  extends: []
+rules:
+  tags-alphabetical: warn
+extends: []
diff --git a/__tests__/lint/tags-alphabetical-warning/.redocly.yaml b/__tests__/lint/tags-alphabetical-warning/.redocly.yaml
index c5a0064e..26472699 100644
--- a/__tests__/lint/tags-alphabetical-warning/.redocly.yaml
+++ b/__tests__/lint/tags-alphabetical-warning/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    tags-alphabetical: warn
-  extends: []
+rules:
+  tags-alphabetical: warn
+extends: []
diff --git a/__tests__/lint/test-unused-component/.redocly.yaml b/__tests__/lint/test-unused-component/.redocly.yaml
index 76cd351e..8b6a3251 100644
--- a/__tests__/lint/test-unused-component/.redocly.yaml
+++ b/__tests__/lint/test-unused-component/.redocly.yaml
@@ -2,7 +2,6 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    info-description: off
-  extends: []
+rules:
+  info-description: off
+extends: []
diff --git a/__tests__/lint/turn-off-rules/.redocly.yaml b/__tests__/lint/turn-off-rules/.redocly.yaml
index c2bcf9c2..9a170d04 100644
--- a/__tests__/lint/turn-off-rules/.redocly.yaml
+++ b/__tests__/lint/turn-off-rules/.redocly.yaml
@@ -2,5 +2,4 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  extends: []
+extends: []
diff --git a/__tests__/lint/turn-on-all-rules/.redocly.yaml b/__tests__/lint/turn-on-all-rules/.redocly.yaml
index 47141e47..092d1f87 100644
--- a/__tests__/lint/turn-on-all-rules/.redocly.yaml
+++ b/__tests__/lint/turn-on-all-rules/.redocly.yaml
@@ -2,6 +2,5 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  extends:
-    - all
+extends:
+  - all
diff --git a/__tests__/lint/with-ignore-file/.redocly.yaml b/__tests__/lint/with-ignore-file/.redocly.yaml
index 9a290738..232f5491 100644
--- a/__tests__/lint/with-ignore-file/.redocly.yaml
+++ b/__tests__/lint/with-ignore-file/.redocly.yaml
@@ -2,8 +2,7 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules:
-    operation-operationId: error
-    operation-summary: error
-  extends: []
+rules:
+  operation-operationId: error
+  operation-summary: error
+extends: []
diff --git a/__tests__/spec-error-if-minimum-not-correct/.redocly.yaml b/__tests__/spec-error-if-minimum-not-correct/.redocly.yaml
deleted file mode 100644
index 6ba17e1b..00000000
--- a/__tests__/spec-error-if-minimum-not-correct/.redocly.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-apiDefinitions:
-  main: ./openapi.yaml
-
-lint:
-  rues:
-    spec: error
diff --git a/__tests__/webpack-bundle/bundle/.redocly.yaml b/__tests__/webpack-bundle/bundle/.redocly.yaml
index ceaa9cfe..1dbb4340 100644
--- a/__tests__/webpack-bundle/bundle/.redocly.yaml
+++ b/__tests__/webpack-bundle/bundle/.redocly.yaml
@@ -2,6 +2,5 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  extends:
-    - recommended
+extends:
+  - recommended
diff --git a/__tests__/webpack-bundle/lint-workflows-fail/.redocly.yaml b/__tests__/webpack-bundle/lint-workflows-fail/.redocly.yaml
index bda031b1..dd4bf007 100644
--- a/__tests__/webpack-bundle/lint-workflows-fail/.redocly.yaml
+++ b/__tests__/webpack-bundle/lint-workflows-fail/.redocly.yaml
@@ -2,8 +2,7 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  rules: 
-    operation-operationId: warn
-    operation-summary: error
-  extends: []
+rules: 
+  operation-operationId: warn
+  operation-summary: error
+extends: []
diff --git a/__tests__/webpack-bundle/lint-workflows/.redocly.yaml b/__tests__/webpack-bundle/lint-workflows/.redocly.yaml
index ceaa9cfe..1dbb4340 100644
--- a/__tests__/webpack-bundle/lint-workflows/.redocly.yaml
+++ b/__tests__/webpack-bundle/lint-workflows/.redocly.yaml
@@ -2,6 +2,5 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  extends:
-    - recommended
+extends:
+  - recommended
diff --git a/__tests__/webpack-bundle/lint/.redocly.yaml b/__tests__/webpack-bundle/lint/.redocly.yaml
index ceaa9cfe..1dbb4340 100644
--- a/__tests__/webpack-bundle/lint/.redocly.yaml
+++ b/__tests__/webpack-bundle/lint/.redocly.yaml
@@ -2,6 +2,5 @@ apis:
   main:
     root: ./openapi.yaml
 
-styleguide:
-  extends:
-    - recommended
+extends:
+  - recommended
diff --git a/packages/core/src/__tests__/lint.test.ts b/packages/core/src/__tests__/lint.test.ts
index 25a60d8a..714b261b 100644
--- a/packages/core/src/__tests__/lint.test.ts
+++ b/packages/core/src/__tests__/lint.test.ts
@@ -12,16 +12,16 @@ describe('lint', () => {
     const results = await lintFromString({
       absoluteRef: '/test/spec.yaml',
       source: outdent`
-      openapi: 3.0.0
-      info:
-        title: Test API
-        version: "1.0"
-        description: Test
-        license: Fail
+        openapi: 3.0.0
+        info:
+          title: Test API
+          version: "1.0"
+          description: Test
+          license: Fail
 
-      servers:
-        - url: http://example.com
-      paths: {}
+        servers:
+          - url: http://example.com
+        paths: {}
     `,
       config: await loadConfig(),
     });
@@ -49,8 +49,7 @@ describe('lint', () => {
   it('lintConfig should work', async () => {
     const document = parseYamlToDocument(
       outdent`
-      apis: error string
-      styleguide:
+        apis: error string
         plugins:
           - './local-plugin.js'
         extends:
@@ -61,16 +60,16 @@ describe('lint', () => {
           no-invalid-media-type-examples: error
           path-http-verbs-order: error
           boolean-parameter-prefixes: off
-      features.openapi:
-        showConsole: true
-        layout:
-          scope: section
-        routingStrategy: browser
-        theme:
-          rightPanel:
-            backgroundColor: '#263238'
-          links:
-            color: '#6CC496'
+        features.openapi:
+          showConsole: true
+          layout:
+            scope: section
+          routingStrategy: browser
+          theme:
+            rightPanel:
+              backgroundColor: '#263238'
+            links:
+              color: '#6CC496'
       `,
       ''
     );
@@ -113,10 +112,9 @@ describe('lint', () => {
   it('lintConfig should detect wrong fields and suggest correct ones', async () => {
     const document = parseYamlToDocument(
       outdent`
-      api: 
-        name@version:
-          root: ./file.yaml
-      syleguide:
+        api:
+          name@version:
+            root: ./file.yaml
         rules:
           operation-2xx-response: warn
       `,
@@ -142,22 +140,6 @@ describe('lint', () => {
             "apis",
           ],
         },
-        Object {
-          "from": undefined,
-          "location": Array [
-            Object {
-              "pointer": "#/syleguide",
-              "reportOnKey": true,
-              "source": "",
-            },
-          ],
-          "message": "Property \`syleguide\` is not expected here.",
-          "ruleId": "configuration spec",
-          "severity": "error",
-          "suggest": Array [
-            "styleguide",
-          ],
-        },
       ]
     `);
   });
@@ -165,13 +147,13 @@ describe('lint', () => {
   it('lintConfig should work with legacy fields', async () => {
     const document = parseYamlToDocument(
       outdent`
-      apiDefinitions: 
-        entry: ./file.yaml
-      lint:
+        apis: 
+          entry: 
+            root: ./file.yaml
         rules:
           operation-2xx-response: warn
-      referenceDocs:
-        showConsole: true
+        referenceDocs:
+          showConsole: true
       `,
       ''
     );
@@ -180,16 +162,16 @@ describe('lint', () => {
     expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`);
   });
 
-  it("'plugins' shouldn't be allowed in 'apis' -> 'styleguide' field", async () => {
+  it("'plugins' shouldn't be allowed in 'apis'", async () => {
     const document = parseYamlToDocument(
       outdent`
-      apis: 
-        styleguide: 
-          plugins: 
+        apis:
+          main:
+            root: ./main.yaml
+            plugins:
             - './local-plugin.js'
-      styleguide:
         plugins:
-          - './local-plugin.js'
+        - './local-plugin.js'
       `,
       ''
     );
@@ -201,21 +183,7 @@ describe('lint', () => {
           "from": undefined,
           "location": Array [
             Object {
-              "pointer": "#/apis/styleguide",
-              "reportOnKey": true,
-              "source": "",
-            },
-          ],
-          "message": "The field \`root\` must be present on this level.",
-          "ruleId": "configuration spec",
-          "severity": "error",
-          "suggest": Array [],
-        },
-        Object {
-          "from": undefined,
-          "location": Array [
-            Object {
-              "pointer": "#/apis/styleguide/plugins",
+              "pointer": "#/apis/main/plugins",
               "reportOnKey": true,
               "source": "",
             },
@@ -232,31 +200,31 @@ describe('lint', () => {
   it("'const' can have any type", async () => {
     const document = parseYamlToDocument(
       outdent`
-      openapi: "3.1.0"
-      info:
-        version: 1.0.0
-        title: Swagger Petstore
-        description: Information about Petstore
-        license:
-          name: MIT
-          url: https://opensource.org/licenses/MIT
-      servers:
-        - url: http://petstore.swagger.io/v1
-      paths:
-        /pets:
-          get:
-            summary: List all pets
-            operationId: listPets
-            tags:
-              - pets
-            responses:
-              200:
-                description: An paged array of pets
-                content:
-                  application/json:
-                    schema:
-                      type: string
-                      const: ABC
+        openapi: "3.1.0"
+        info:
+          version: 1.0.0
+          title: Swagger Petstore
+          description: Information about Petstore
+          license:
+            name: MIT
+            url: https://opensource.org/licenses/MIT
+        servers:
+          - url: http://petstore.swagger.io/v1
+        paths:
+          /pets:
+            get:
+              summary: List all pets
+              operationId: listPets
+              tags:
+                - pets
+              responses:
+                200:
+                  description: An paged array of pets
+                  content:
+                    application/json:
+                      schema:
+                        type: string
+                        const: ABC
         `,
       'foobar.yaml'
     );
@@ -273,8 +241,8 @@ describe('lint', () => {
   it('detect OpenAPI should throw an error when version is not string', () => {
     const testDocument = parseYamlToDocument(
       outdent`
-      openapi: 3.0
-    `,
+        openapi: 3.0
+      `,
       ''
     );
     expect(() => detectOpenAPI(testDocument.parsed)).toThrow(
@@ -285,28 +253,28 @@ describe('lint', () => {
   it("spec rule shouldn't throw an error for named callback", async () => {
     const document = parseYamlToDocument(
       outdent`
-      openapi: 3.1.0
-      info:
-        title: Callback test
-        version: 'alpha'
-      components:
-        callbacks:
-          resultCallback:
-            '{$url}':
-              post:
-                requestBody:
-                  description: Callback payload
-                  content:
-                    'application/json':
-                      schema:
-                        type: object
-                        properties:
-                          test:
-                            type: string
-                responses:
-                  '200':
-                    description: callback successfully processed
-    `,
+        openapi: 3.1.0
+        info:
+          title: Callback test
+          version: 'alpha'
+        components:
+          callbacks:
+            resultCallback:
+              '{$url}':
+                post:
+                  requestBody:
+                    description: Callback payload
+                    content:
+                      'application/json':
+                        schema:
+                          type: object
+                          properties:
+                            test:
+                              type: string
+                  responses:
+                    '200':
+                      description: callback successfully processed
+      `,
       'foobar.yaml'
     );
 
@@ -323,23 +291,23 @@ describe('lint', () => {
     const absoluteRef = path.join(__dirname, 'fixtures/openapi.yaml');
     const document = parseYamlToDocument(
       outdent`
-      openapi: 3.0.0
-      info:
-        version: 1.0.0
-        title: Example OpenAPI 3 definition.
-        description: Information about API
-        license:
-          name: MIT
-          url: 'https://opensource.org/licenses/MIT'
-      servers:
-        - url: 'https://redocly.com/v1'
-      paths:
-        '/pets/{petId}':
-          post:
-            responses:
-              '201':
-                summary: Exist 
-                description: example description
+        openapi: 3.0.0
+        info:
+          version: 1.0.0
+          title: Example OpenAPI 3 definition.
+          description: Information about API
+          license:
+            name: MIT
+            url: 'https://opensource.org/licenses/MIT'
+        servers:
+          - url: 'https://redocly.com/v1'
+        paths:
+          '/pets/{petId}':
+            post:
+              responses:
+                '201':
+                  summary: Exist
+                  description: example description
       `,
       absoluteRef
     );
diff --git a/packages/core/src/config/__tests__/fixtures/plugin-config.yaml b/packages/core/src/config/__tests__/fixtures/plugin-config.yaml
index 150f0cfe..006d6cd3 100644
--- a/packages/core/src/config/__tests__/fixtures/plugin-config.yaml
+++ b/packages/core/src/config/__tests__/fixtures/plugin-config.yaml
@@ -1,3 +1,2 @@
-lint:
-  plugins:
-    - './plugin.js'
\ No newline at end of file
+plugins:
+  - './plugin.js'
diff --git a/packages/core/src/config/__tests__/fixtures/resolve-config/api/nested-config.yaml b/packages/core/src/config/__tests__/fixtures/resolve-config/api/nested-config.yaml
index 6c1d250d..4aeaa4a5 100644
--- a/packages/core/src/config/__tests__/fixtures/resolve-config/api/nested-config.yaml
+++ b/packages/core/src/config/__tests__/fixtures/resolve-config/api/nested-config.yaml
@@ -1,12 +1,11 @@
-lint:
-  plugins:
-    - plugin.js
-  rules:
-    operation-2xx-response: error
-    assert/path-item-get-defined:
-      subject: PathItem
-      property: get
-      message: Every path item must have a GET operation.
-      defined: true
-  extends:
-    - test-plugin-nested/all
+plugins:
+  - plugin.js
+rules:
+  operation-2xx-response: error
+  assert/path-item-get-defined:
+    subject: PathItem
+    property: get
+    message: Every path item must have a GET operation.
+    defined: true
+extends:
+  - test-plugin-nested/all
diff --git a/packages/core/src/config/__tests__/fixtures/resolve-config/local-config-with-circular.yaml b/packages/core/src/config/__tests__/fixtures/resolve-config/local-config-with-circular.yaml
index 1a7062f2..58d19cad 100644
--- a/packages/core/src/config/__tests__/fixtures/resolve-config/local-config-with-circular.yaml
+++ b/packages/core/src/config/__tests__/fixtures/resolve-config/local-config-with-circular.yaml
@@ -1,8 +1,7 @@
-lint:
-  extends:
-    - local-config-with-circular.yaml
-  rules:
-    no-invalid-media-type-examples: error
-    operation-description: error
-    path-http-verbs-order: error
-    operation-2xx-response: off
+extends:
+  - local-config-with-circular.yaml
+rules:
+  no-invalid-media-type-examples: error
+  operation-description: error
+  path-http-verbs-order: error
+  operation-2xx-response: off
diff --git a/packages/core/src/config/__tests__/fixtures/resolve-config/local-config-with-file.yaml b/packages/core/src/config/__tests__/fixtures/resolve-config/local-config-with-file.yaml
index 179ff990..8345de99 100644
--- a/packages/core/src/config/__tests__/fixtures/resolve-config/local-config-with-file.yaml
+++ b/packages/core/src/config/__tests__/fixtures/resolve-config/local-config-with-file.yaml
@@ -1,19 +1,18 @@
-lint:
-  rules:
-    no-invalid-media-type-examples: warn
-    operation-4xx-response: off
-    assert/tag-description:
-      subject: Tag
-      property: description
-      message: Tag description must be at least 13 characters and end with a full stop.
-      severity: error
-      minLength: 13
-      pattern: /\.$/
-  plugins:
-    - plugin.js
-    - api/plugin.js
-  extends:
-    - recommended
-    - api/nested-config.yaml
-    - test-plugin-nested/all
-    - test-plugin/all
+rules:
+  no-invalid-media-type-examples: warn
+  operation-4xx-response: off
+  assert/tag-description:
+    subject: Tag
+    property: description
+    message: Tag description must be at least 13 characters and end with a full stop.
+    severity: error
+    minLength: 13
+    pattern: /\.$/
+plugins:
+  - plugin.js
+  - api/plugin.js
+extends:
+  - recommended
+  - api/nested-config.yaml
+  - test-plugin-nested/all
+  - test-plugin/all
diff --git a/packages/core/src/config/__tests__/fixtures/resolve-config/local-config.yaml b/packages/core/src/config/__tests__/fixtures/resolve-config/local-config.yaml
index 5b9a4da7..e1613cb9 100644
--- a/packages/core/src/config/__tests__/fixtures/resolve-config/local-config.yaml
+++ b/packages/core/src/config/__tests__/fixtures/resolve-config/local-config.yaml
@@ -1,10 +1,9 @@
-lint:
-  plugins:
-    - plugin.js
-  extends:
-    - test-plugin/all
-  rules:
-    no-invalid-media-type-examples: error
-    operation-description: error
-    path-http-verbs-order: error
-    operation-2xx-response: off
+plugins:
+  - plugin.js
+extends:
+  - test-plugin/all
+rules:
+  no-invalid-media-type-examples: error
+  operation-description: error
+  path-http-verbs-order: error
+  operation-2xx-response: off
diff --git a/packages/core/src/config/__tests__/fixtures/resolve-remote-configs/nested-remote-config.yaml b/packages/core/src/config/__tests__/fixtures/resolve-remote-configs/nested-remote-config.yaml
index 42aff325..5762e1ce 100644
--- a/packages/core/src/config/__tests__/fixtures/resolve-remote-configs/nested-remote-config.yaml
+++ b/packages/core/src/config/__tests__/fixtures/resolve-remote-configs/nested-remote-config.yaml
@@ -1,4 +1,3 @@
-lint:
-  rules:
-    operation-2xx-response: off
-    operation-4xx-response: error
\ No newline at end of file
+rules:
+  operation-2xx-response: off
+  operation-4xx-response: error
diff --git a/packages/core/src/config/__tests__/fixtures/resolve-remote-configs/remote-config.yaml b/packages/core/src/config/__tests__/fixtures/resolve-remote-configs/remote-config.yaml
index ac461100..2533894b 100644
--- a/packages/core/src/config/__tests__/fixtures/resolve-remote-configs/remote-config.yaml
+++ b/packages/core/src/config/__tests__/fixtures/resolve-remote-configs/remote-config.yaml
@@ -1,5 +1,4 @@
-lint:
-  extends:
-    - nested-remote-config.yaml
-  rules:
-    operation-2xx-response: error
\ No newline at end of file
+extends:
+  - nested-remote-config.yaml
+rules:
+  operation-2xx-response: error
diff --git a/packages/core/src/config/__tests__/load.test.ts b/packages/core/src/config/__tests__/load.test.ts
index 66bce5f8..15670ca2 100644
--- a/packages/core/src/config/__tests__/load.test.ts
+++ b/packages/core/src/config/__tests__/load.test.ts
@@ -1,6 +1,6 @@
 import { loadConfig, findConfig, getConfig, createConfig } from '../load';
 import { RedoclyClient } from '../../redocly';
-import { RuleConfig, RawConfig } from './../types';
+import { RuleConfig, FlatRawConfig } from './../types';
 import { Config } from '../config';
 
 const fs = require('fs');
@@ -93,11 +93,10 @@ describe('getConfig', () => {
 describe('createConfig', () => {
   it('should create config from string', async () => {
     const config = await createConfig(`
-      styleguide:
-        extends:
-          - recommended
-        rules:
-          info-license: off
+      extends:
+      - recommended
+      rules:
+        info-license: off
     `);
 
     verifyExtendedConfig(config, {
@@ -107,21 +106,19 @@ describe('createConfig', () => {
   });
 
   it('should create config from object', async () => {
-    const rawConfig: RawConfig = {
-      styleguide: {
-        extends: ['minimal'],
-        rules: {
-          'info-license': 'off',
-          'tag-description': 'off',
-          'operation-2xx-response': 'off',
-        },
+    const rawConfig: FlatRawConfig = {
+      extends: ['minimal'],
+      rules: {
+        'info-license': 'off',
+        'tag-description': 'off',
+        'operation-2xx-response': 'off',
       },
     };
     const config = await createConfig(rawConfig);
 
     verifyExtendedConfig(config, {
       extendsRuleSet: 'minimal',
-      overridesRules: rawConfig.styleguide!.rules as Record<string, RuleConfig>,
+      overridesRules: rawConfig.rules as Record<string, RuleConfig>,
     });
   });
 });
diff --git a/packages/core/src/config/__tests__/utils.test.ts b/packages/core/src/config/__tests__/utils.test.ts
index a89cfef9..e8fa8164 100644
--- a/packages/core/src/config/__tests__/utils.test.ts
+++ b/packages/core/src/config/__tests__/utils.test.ts
@@ -1,4 +1,4 @@
-import { DeprecatedInRawConfig, RawConfig } from '../types';
+import { DeprecatedInRawConfig, RawConfig, FlatRawConfig } from '../types';
 import * as utils from '../utils';
 
 const makeTestRawConfig = (
@@ -22,8 +22,54 @@ const makeTestRawConfig = (
   },
 });
 
+const rawTestConfig: RawConfig = {
+  apis: {
+    'test@v1': {
+      root: 'root.yaml',
+      styleguide: {
+        extends: ['recommended'],
+        rules: { 'operation-2xx-response': 'error' },
+      },
+    },
+  },
+  styleguide: {
+    plugins: ['test-plugin'],
+    extends: ['minimal'],
+    rules: { 'operation-4xx-response': 'warn' },
+    doNotResolveExamples: true,
+  },
+  resolve: {
+    http: { headers: [{ matches: '*', name: 'all', envVariable: 'all' }] },
+  },
+  'features.openapi': {
+    disableSidebar: true,
+  },
+};
+
+const flatTestConfig: FlatRawConfig = {
+  apis: {
+    'test@v1': {
+      root: 'root.yaml',
+      extends: ['recommended'],
+      rules: { 'operation-2xx-response': 'error' },
+    },
+  },
+  plugins: ['test-plugin'],
+  extends: ['minimal'],
+  rules: {
+    'operation-4xx-response': 'warn',
+  },
+  resolve: {
+    http: { headers: [{ matches: '*', name: 'all', envVariable: 'all' }] },
+    doNotResolveExamples: true,
+  },
+  'features.openapi': {
+    disableSidebar: true,
+  },
+};
+
 describe('transformConfig', () => {
-  it('should work for new syntax', () => {
+  it('should work for the `styleguide` syntax', () => {
     const transformedRawConfig: RawConfig = utils.transformConfig(
       makeTestRawConfig('styleguide', 'styleguide')
     );
@@ -73,11 +119,25 @@ describe('transformConfig', () => {
       }
     `);
   });
-  it('should throw an error if both new and old syntax used together', () => {
+  it('should throw an error if both `styleguide` and `lint` syntaxes used together', () => {
     const testRawConfig = makeTestRawConfig('styleguide', 'lint');
     testRawConfig.apiDefinitions = { legacyApiDefinition: 'file.yaml' };
     expect(() => utils.transformConfig(testRawConfig)).toThrowError(
-      `Do not use 'apiDefinitions' field. Use 'apis' instead.`
+      `Do not use 'apiDefinitions' field. Use 'apis' instead. `
+    );
+  });
+  it('should transform flatten config into styleguide', () => {
+    expect(utils.transformConfig(flatTestConfig)).toEqual({
+      ...rawTestConfig,
+      resolve: { ...rawTestConfig.resolve, doNotResolveExamples: true },
+    });
+  });
+  it('should transform styleguide config into styleguide identically', () => {
+    expect(utils.transformConfig(rawTestConfig)).toEqual(rawTestConfig);
+  });
+  it('should fail when there is a mixed config', () => {
+    expect(() => utils.transformConfig({ ...rawTestConfig, extends: ['recommended'] })).toThrow(
+      `Do not use 'lint', 'styleguide' and flat syntax together. \nSee more about the configuration in the docs: https://redocly.com/docs/cli/configuration/ \n`
     );
   });
 });
diff --git a/packages/core/src/rules/__tests__/utils.test.ts b/packages/core/src/rules/__tests__/utils.test.ts
index 8db6991b..ab75bb7c 100644
--- a/packages/core/src/rules/__tests__/utils.test.ts
+++ b/packages/core/src/rules/__tests__/utils.test.ts
@@ -153,7 +153,7 @@ describe('get-additional-properties-option', () => {
     } catch (error) {
       expect(error).toBeInstanceOf(Error);
       expect(error.message).toEqual(
-        "Do not use 'disallowAdditionalProperties' field. Use 'allowAdditionalProperties' instead.\n"
+        "Do not use 'disallowAdditionalProperties' field. Use 'allowAdditionalProperties' instead. \n"
       );
     }
   });