@redocly/openapi-core 1.25.15 → 1.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/__tests__/utils.ts +0 -3
  3. package/lib/bundle.js +3 -3
  4. package/lib/config/all.js +129 -48
  5. package/lib/config/builtIn.d.ts +1 -1
  6. package/lib/config/builtIn.js +5 -3
  7. package/lib/config/config-resolvers.d.ts +3 -1
  8. package/lib/config/config-resolvers.js +16 -14
  9. package/lib/config/config.d.ts +2 -2
  10. package/lib/config/config.js +38 -20
  11. package/lib/config/minimal.js +124 -49
  12. package/lib/config/recommended-strict.js +123 -48
  13. package/lib/config/recommended.js +122 -47
  14. package/lib/config/rules.d.ts +2 -2
  15. package/lib/config/spec.d.ts +3 -0
  16. package/lib/config/spec.js +30 -0
  17. package/lib/config/types.d.ts +23 -23
  18. package/lib/config/utils.d.ts +1 -1
  19. package/lib/config/utils.js +33 -23
  20. package/lib/index.d.ts +1 -1
  21. package/lib/index.js +2 -2
  22. package/lib/lint.js +3 -3
  23. package/lib/oas-types.d.ts +11 -11
  24. package/lib/oas-types.js +6 -6
  25. package/lib/rules/arazzo/criteria-unique.d.ts +2 -2
  26. package/lib/rules/arazzo/index.d.ts +2 -2
  27. package/lib/rules/arazzo/index.js +6 -6
  28. package/lib/rules/arazzo/parameters-unique.d.ts +2 -2
  29. package/lib/rules/arazzo/requestBody-replacements-unique.d.ts +2 -2
  30. package/lib/rules/arazzo/sourceDescription-type.d.ts +2 -0
  31. package/lib/rules/arazzo/{source-description-type.js → sourceDescription-type.js} +5 -3
  32. package/lib/rules/arazzo/sourceDescriptions-name-unique.d.ts +2 -2
  33. package/lib/rules/arazzo/sourceDescriptions-not-empty.d.ts +2 -0
  34. package/lib/rules/arazzo/sourceDescriptions-not-empty.js +18 -0
  35. package/lib/rules/arazzo/step-onFailure-unique.d.ts +2 -2
  36. package/lib/rules/arazzo/step-onSuccess-unique.d.ts +2 -2
  37. package/lib/rules/arazzo/stepId-unique.d.ts +2 -2
  38. package/lib/rules/arazzo/workflow-dependsOn.d.ts +2 -2
  39. package/lib/rules/arazzo/workflowId-unique.d.ts +2 -2
  40. package/lib/rules/async2/index.js +5 -2
  41. package/lib/rules/async3/index.js +5 -2
  42. package/lib/rules/common/assertions/index.d.ts +2 -2
  43. package/lib/rules/common/struct.d.ts +2 -0
  44. package/lib/rules/common/{spec.js → struct.js} +3 -3
  45. package/lib/rules/oas2/index.js +5 -2
  46. package/lib/rules/oas3/index.js +5 -2
  47. package/lib/rules/spot/no-criteria-xpath.d.ts +2 -2
  48. package/lib/rules/spot/parameters-not-in-body.d.ts +2 -2
  49. package/lib/rules/spot/version-enum.d.ts +2 -2
  50. package/lib/types/arazzo.d.ts +1 -1
  51. package/lib/types/arazzo.js +3 -16
  52. package/lib/types/redocly-yaml.d.ts +6 -8
  53. package/lib/types/redocly-yaml.js +47 -13
  54. package/lib/typings/arazzo.d.ts +1 -6
  55. package/lib/utils.d.ts +1 -1
  56. package/lib/utils.js +3 -2
  57. package/lib/visitors.d.ts +5 -6
  58. package/package.json +1 -3
  59. package/src/__tests__/lint.test.ts +3 -3
  60. package/src/bundle.ts +3 -3
  61. package/src/config/__tests__/__snapshots__/config-resolvers.test.ts.snap +228 -72
  62. package/src/config/__tests__/__snapshots__/config.test.ts.snap +16 -3
  63. package/src/config/__tests__/config-resolvers.test.ts +14 -2
  64. package/src/config/__tests__/config.test.ts +11 -6
  65. package/src/config/all.ts +129 -48
  66. package/src/config/builtIn.ts +10 -8
  67. package/src/config/config-resolvers.ts +37 -45
  68. package/src/config/config.ts +46 -22
  69. package/src/config/minimal.ts +124 -49
  70. package/src/config/recommended-strict.ts +123 -48
  71. package/src/config/recommended.ts +122 -47
  72. package/src/config/rules.ts +2 -2
  73. package/src/config/spec.ts +31 -0
  74. package/src/config/types.ts +27 -33
  75. package/src/config/utils.ts +38 -26
  76. package/src/index.ts +1 -1
  77. package/src/lint.ts +6 -6
  78. package/src/oas-types.ts +19 -20
  79. package/src/rules/arazzo/__tests__/criteria-unique.test.ts +1 -2
  80. package/src/rules/arazzo/__tests__/no-criteria-xpath.test.ts +1 -2
  81. package/src/rules/arazzo/__tests__/parameters-not-in-body.test.ts +1 -2
  82. package/src/rules/arazzo/__tests__/parameters-unique.test.ts +1 -2
  83. package/src/rules/arazzo/__tests__/requestBody-replacements-unique.test.ts +1 -2
  84. package/src/rules/arazzo/__tests__/source-description-type.test.ts +2 -4
  85. package/src/rules/arazzo/__tests__/sourceDescription-name-unique.test.ts +1 -2
  86. package/src/rules/arazzo/__tests__/sourceDescriptions-not-empty.test.ts +104 -0
  87. package/src/rules/arazzo/__tests__/step-onFailure-unique.test.ts +1 -2
  88. package/src/rules/arazzo/__tests__/step-onSuccess-unique.test.ts +1 -2
  89. package/src/rules/arazzo/__tests__/stepId-unique.test.ts +1 -2
  90. package/src/rules/arazzo/__tests__/version-enum.test.ts +1 -2
  91. package/src/rules/arazzo/__tests__/workflow-dependsOn.test.ts +3 -6
  92. package/src/rules/arazzo/__tests__/workflowId-unique.test.ts +2 -4
  93. package/src/rules/arazzo/criteria-unique.ts +2 -2
  94. package/src/rules/arazzo/index.ts +22 -22
  95. package/src/rules/arazzo/parameters-unique.ts +2 -2
  96. package/src/rules/arazzo/requestBody-replacements-unique.ts +2 -2
  97. package/src/rules/arazzo/{source-description-type.ts → sourceDescription-type.ts} +6 -5
  98. package/src/rules/arazzo/sourceDescriptions-name-unique.ts +2 -2
  99. package/src/rules/arazzo/sourceDescriptions-not-empty.ts +17 -0
  100. package/src/rules/arazzo/step-onFailure-unique.ts +2 -2
  101. package/src/rules/arazzo/step-onSuccess-unique.ts +2 -2
  102. package/src/rules/arazzo/stepId-unique.ts +2 -2
  103. package/src/rules/arazzo/workflow-dependsOn.ts +2 -2
  104. package/src/rules/arazzo/workflowId-unique.ts +2 -2
  105. package/src/rules/async2/index.ts +5 -2
  106. package/src/rules/async3/index.ts +5 -2
  107. package/src/rules/common/__tests__/no-enum-type-mismatch.test.ts +1 -1
  108. package/src/rules/common/__tests__/{spec.test.ts → struct.test.ts} +35 -35
  109. package/src/rules/common/assertions/index.ts +2 -2
  110. package/src/rules/common/{spec.ts → struct.ts} +2 -2
  111. package/src/rules/oas2/index.ts +5 -2
  112. package/src/rules/oas3/__tests__/spec/spec.test.ts +10 -10
  113. package/src/rules/oas3/index.ts +5 -2
  114. package/src/rules/spot/no-criteria-xpath.ts +2 -2
  115. package/src/rules/spot/parameters-not-in-body.ts +2 -2
  116. package/src/rules/spot/version-enum.ts +2 -2
  117. package/src/types/arazzo.ts +2 -14
  118. package/src/types/redocly-yaml.ts +48 -17
  119. package/src/typings/arazzo.ts +1 -10
  120. package/src/utils.ts +4 -2
  121. package/src/visitors.ts +4 -6
  122. package/tsconfig.tsbuildinfo +1 -1
  123. package/lib/rules/arazzo/source-description-type.d.ts +0 -2
  124. package/lib/rules/common/spec.d.ts +0 -2
  125. package/lib/rules/spot/no-actions-type-end.d.ts +0 -2
  126. package/lib/rules/spot/no-actions-type-end.js +0 -28
  127. package/src/rules/arazzo/__tests__/no-actions-type-end.test.ts +0 -122
  128. package/src/rules/spot/no-actions-type-end.ts +0 -27
@@ -2,54 +2,70 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const recommended = {
4
4
  rules: {
5
+ struct: 'error',
6
+ },
7
+ oas2Rules: {
8
+ 'boolean-parameter-prefixes': 'off',
5
9
  'info-contact': 'off',
6
10
  'info-license': 'warn',
7
11
  'info-license-url': 'off',
8
12
  'info-license-strict': 'warn',
9
- 'tag-description': 'warn',
10
- 'tags-alphabetical': 'off',
11
- 'parameter-description': 'off',
12
13
  'no-path-trailing-slash': 'error',
13
14
  'no-identical-paths': 'error',
14
15
  'no-ambiguous-paths': 'warn',
15
- 'path-declaration-must-exist': 'error',
16
- 'path-not-include-query': 'error',
17
- 'path-parameters-defined': 'error',
16
+ 'no-invalid-schema-examples': 'off',
17
+ 'no-invalid-parameter-examples': 'off',
18
+ 'no-http-verbs-in-paths': 'off',
19
+ 'no-enum-type-mismatch': 'error',
20
+ 'no-unresolved-refs': 'error',
21
+ 'no-required-schema-properties-undefined': 'off',
22
+ 'operation-summary': 'error',
18
23
  'operation-description': 'off',
19
- 'operation-2xx-response': 'warn',
20
- 'operation-4xx-response': 'warn',
21
24
  'operation-operationId': 'warn',
22
- 'operation-summary': 'error',
23
25
  'operation-operationId-unique': 'error',
24
26
  'operation-operationId-url-safe': 'error',
27
+ 'operation-2xx-response': 'warn',
28
+ 'operation-4xx-response': 'warn',
25
29
  'operation-parameters-unique': 'error',
26
30
  'operation-tag-defined': 'off',
27
- 'security-defined': 'error',
28
31
  'operation-singular-tag': 'off',
29
- 'no-unresolved-refs': 'error',
30
- 'no-enum-type-mismatch': 'error',
32
+ 'parameter-description': 'off',
33
+ 'path-declaration-must-exist': 'error',
34
+ 'path-not-include-query': 'error',
35
+ 'path-parameters-defined': 'error',
31
36
  'paths-kebab-case': 'off',
32
- spec: 'error',
33
- 'spec-strict-refs': 'off',
34
- 'no-http-verbs-in-paths': 'off',
35
- 'no-invalid-parameter-examples': 'off',
36
- 'no-invalid-schema-examples': 'off',
37
37
  'path-excludes-patterns': 'off',
38
38
  'path-http-verbs-order': 'off',
39
39
  'path-params-defined': 'off',
40
40
  'path-segment-plural': 'off',
41
41
  'required-string-property-missing-min-length': 'off',
42
42
  'response-contains-header': 'off',
43
- 'scalar-property-missing-example': 'off',
44
- 'no-required-schema-properties-undefined': 'off',
45
- },
46
- oas2Rules: {
47
- 'boolean-parameter-prefixes': 'off',
48
43
  'request-mime-type': 'off',
49
44
  'response-contains-property': 'off',
50
45
  'response-mime-type': 'off',
46
+ 'security-defined': 'error',
47
+ 'spec-strict-refs': 'off',
48
+ 'scalar-property-missing-example': 'off',
49
+ 'tag-description': 'warn',
50
+ 'tags-alphabetical': 'off',
51
51
  },
52
52
  oas3_0Rules: {
53
+ 'array-parameter-serialization': 'off',
54
+ 'boolean-parameter-prefixes': 'off',
55
+ 'component-name-unique': 'off',
56
+ 'info-contact': 'off',
57
+ 'info-license': 'warn',
58
+ 'info-license-url': 'off',
59
+ 'info-license-strict': 'warn',
60
+ 'no-path-trailing-slash': 'error',
61
+ 'no-identical-paths': 'error',
62
+ 'no-ambiguous-paths': 'warn',
63
+ 'no-invalid-schema-examples': 'off',
64
+ 'no-invalid-parameter-examples': 'off',
65
+ 'no-http-verbs-in-paths': 'off',
66
+ 'no-enum-type-mismatch': 'error',
67
+ 'no-unresolved-refs': 'error',
68
+ 'no-required-schema-properties-undefined': 'off',
53
69
  'no-invalid-media-type-examples': {
54
70
  severity: 'warn',
55
71
  allowAdditionalProperties: false,
@@ -61,16 +77,55 @@ const recommended = {
61
77
  'no-unused-components': 'warn',
62
78
  'no-undefined-server-variable': 'error',
63
79
  'no-server-variables-empty-enum': 'error',
64
- 'spec-components-invalid-map-name': 'error',
65
- 'boolean-parameter-prefixes': 'off',
66
- 'component-name-unique': 'off',
80
+ 'operation-summary': 'error',
81
+ 'operation-operationId': 'warn',
82
+ 'operation-operationId-unique': 'error',
83
+ 'operation-operationId-url-safe': 'error',
84
+ 'operation-description': 'off',
85
+ 'operation-2xx-response': 'warn',
86
+ 'operation-4xx-response': 'warn',
67
87
  'operation-4xx-problem-details-rfc7807': 'off',
88
+ 'operation-parameters-unique': 'error',
89
+ 'operation-tag-defined': 'off',
90
+ 'operation-singular-tag': 'off',
91
+ 'parameter-description': 'off',
92
+ 'path-declaration-must-exist': 'error',
93
+ 'path-not-include-query': 'error',
94
+ 'path-parameters-defined': 'error',
95
+ 'paths-kebab-case': 'off',
96
+ 'path-excludes-patterns': 'off',
97
+ 'path-http-verbs-order': 'off',
98
+ 'path-params-defined': 'off',
99
+ 'path-segment-plural': 'off',
100
+ 'required-string-property-missing-min-length': 'off',
101
+ 'response-contains-header': 'off',
68
102
  'request-mime-type': 'off',
69
103
  'response-contains-property': 'off',
70
104
  'response-mime-type': 'off',
71
- 'array-parameter-serialization': 'off',
105
+ 'security-defined': 'error',
106
+ 'spec-strict-refs': 'off',
107
+ 'scalar-property-missing-example': 'off',
108
+ 'spec-components-invalid-map-name': 'error',
109
+ 'tag-description': 'warn',
110
+ 'tags-alphabetical': 'off',
72
111
  },
73
112
  oas3_1Rules: {
113
+ 'array-parameter-serialization': 'off',
114
+ 'boolean-parameter-prefixes': 'off',
115
+ 'component-name-unique': 'off',
116
+ 'info-contact': 'off',
117
+ 'info-license': 'warn',
118
+ 'info-license-url': 'off',
119
+ 'info-license-strict': 'warn',
120
+ 'no-path-trailing-slash': 'error',
121
+ 'no-identical-paths': 'error',
122
+ 'no-ambiguous-paths': 'warn',
123
+ 'no-invalid-schema-examples': 'off',
124
+ 'no-invalid-parameter-examples': 'off',
125
+ 'no-http-verbs-in-paths': 'off',
126
+ 'no-enum-type-mismatch': 'error',
127
+ 'no-unresolved-refs': 'error',
128
+ 'no-required-schema-properties-undefined': 'off',
74
129
  'no-invalid-media-type-examples': 'warn',
75
130
  'no-server-example.com': 'warn',
76
131
  'no-server-trailing-slash': 'error',
@@ -79,51 +134,71 @@ const recommended = {
79
134
  'no-unused-components': 'warn',
80
135
  'no-undefined-server-variable': 'error',
81
136
  'no-server-variables-empty-enum': 'error',
82
- 'spec-components-invalid-map-name': 'error',
83
- 'boolean-parameter-prefixes': 'off',
84
- 'component-name-unique': 'off',
137
+ 'operation-summary': 'error',
138
+ 'operation-operationId': 'warn',
139
+ 'operation-operationId-unique': 'error',
140
+ 'operation-operationId-url-safe': 'error',
141
+ 'operation-description': 'off',
142
+ 'operation-2xx-response': 'warn',
143
+ 'operation-4xx-response': 'warn',
85
144
  'operation-4xx-problem-details-rfc7807': 'off',
145
+ 'operation-parameters-unique': 'error',
146
+ 'operation-tag-defined': 'off',
147
+ 'operation-singular-tag': 'off',
148
+ 'parameter-description': 'off',
149
+ 'path-declaration-must-exist': 'error',
150
+ 'path-not-include-query': 'error',
151
+ 'path-parameters-defined': 'error',
152
+ 'paths-kebab-case': 'off',
153
+ 'path-excludes-patterns': 'off',
154
+ 'path-http-verbs-order': 'off',
155
+ 'path-params-defined': 'off',
156
+ 'path-segment-plural': 'off',
157
+ 'required-string-property-missing-min-length': 'off',
158
+ 'response-contains-header': 'off',
86
159
  'request-mime-type': 'off',
87
160
  'response-contains-property': 'off',
88
161
  'response-mime-type': 'off',
89
- 'array-parameter-serialization': 'off',
162
+ 'security-defined': 'error',
163
+ 'spec-strict-refs': 'off',
164
+ 'scalar-property-missing-example': 'off',
165
+ 'spec-components-invalid-map-name': 'error',
166
+ 'tag-description': 'warn',
167
+ 'tags-alphabetical': 'off',
90
168
  },
91
169
  async2Rules: {
92
- spec: 'error',
170
+ 'channels-kebab-case': 'off',
93
171
  'info-contact': 'off',
94
172
  'info-license-strict': 'warn',
173
+ 'no-channel-trailing-slash': 'off',
95
174
  'operation-operationId': 'warn',
96
175
  'tag-description': 'warn',
97
176
  'tags-alphabetical': 'off',
98
- 'channels-kebab-case': 'off',
99
- 'no-channel-trailing-slash': 'off',
100
177
  },
101
178
  async3Rules: {
102
- spec: 'error',
179
+ 'channels-kebab-case': 'off',
103
180
  'info-contact': 'off',
104
181
  'info-license-strict': 'warn',
182
+ 'no-channel-trailing-slash': 'off',
105
183
  'operation-operationId': 'warn',
106
184
  'tag-description': 'warn',
107
185
  'tags-alphabetical': 'off',
108
- 'channels-kebab-case': 'off',
109
- 'no-channel-trailing-slash': 'off',
110
186
  },
111
- arazzoRules: {
112
- spec: 'error',
187
+ arazzo1Rules: {
188
+ 'criteria-unique': 'warn',
189
+ 'no-criteria-xpath': 'warn',
113
190
  'parameters-not-in-body': 'warn',
191
+ 'parameters-unique': 'error',
192
+ 'requestBody-replacements-unique': 'warn',
114
193
  'sourceDescription-type': 'error',
115
- 'version-enum': 'warn',
116
- 'workflowId-unique': 'error',
194
+ 'step-onSuccess-unique': 'warn',
195
+ 'step-onFailure-unique': 'warn',
117
196
  'stepId-unique': 'error',
118
197
  'sourceDescription-name-unique': 'error',
198
+ 'sourceDescriptions-not-empty': 'error',
199
+ 'version-enum': 'warn',
200
+ 'workflowId-unique': 'error',
119
201
  'workflow-dependsOn': 'error',
120
- 'parameters-unique': 'error',
121
- 'step-onSuccess-unique': 'warn',
122
- 'step-onFailure-unique': 'warn',
123
- 'requestBody-replacements-unique': 'warn',
124
- 'no-criteria-xpath': 'warn',
125
- 'no-actions-type-end': 'warn',
126
- 'criteria-unique': 'warn',
127
202
  },
128
203
  };
129
204
  exports.default = recommended;
@@ -1,4 +1,4 @@
1
- import type { ArazzoRuleSet, Async2RuleSet, Async3RuleSet, Oas2RuleSet, Oas3RuleSet, SpecVersion } from '../oas-types';
1
+ import type { Arazzo1RuleSet, Async2RuleSet, Async3RuleSet, Oas2RuleSet, Oas3RuleSet, SpecVersion } from '../oas-types';
2
2
  import type { StyleguideConfig } from './config';
3
3
  import type { ProblemSeverity } from '../walk';
4
4
  type InitializedRule = {
@@ -6,5 +6,5 @@ type InitializedRule = {
6
6
  ruleId: string;
7
7
  visitor: any;
8
8
  };
9
- export declare function initRules(rules: (Oas3RuleSet | Oas2RuleSet | Async2RuleSet | Async3RuleSet | ArazzoRuleSet)[], config: StyleguideConfig, type: 'rules' | 'preprocessors' | 'decorators', oasVersion: SpecVersion): InitializedRule[];
9
+ export declare function initRules(rules: (Oas3RuleSet | Oas2RuleSet | Async2RuleSet | Async3RuleSet | Arazzo1RuleSet)[], config: StyleguideConfig, type: 'rules' | 'preprocessors' | 'decorators', oasVersion: SpecVersion): InitializedRule[];
10
10
  export {};
@@ -0,0 +1,3 @@
1
+ import type { PluginStyleguideConfig } from './types';
2
+ declare const spec: PluginStyleguideConfig<'built-in'>;
3
+ export default spec;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const spec = {
4
+ rules: {
5
+ struct: 'error',
6
+ },
7
+ // TODO: populate with spec-related rules similar to `arazzo1Rules`
8
+ oas2Rules: {},
9
+ oas3_0Rules: {},
10
+ oas3_1Rules: {},
11
+ async2Rules: {},
12
+ async3Rules: {},
13
+ arazzo1Rules: {
14
+ 'parameters-not-in-body': 'error',
15
+ 'sourceDescription-type': 'error',
16
+ 'version-enum': 'error',
17
+ 'workflowId-unique': 'error',
18
+ 'stepId-unique': 'error',
19
+ 'sourceDescription-name-unique': 'error',
20
+ 'sourceDescriptions-not-empty': 'error',
21
+ 'workflow-dependsOn': 'error',
22
+ 'parameters-unique': 'error',
23
+ 'step-onSuccess-unique': 'error',
24
+ 'step-onFailure-unique': 'error',
25
+ 'requestBody-replacements-unique': 'error',
26
+ 'no-criteria-xpath': 'error',
27
+ 'criteria-unique': 'error',
28
+ },
29
+ };
30
+ exports.default = spec;
@@ -1,9 +1,8 @@
1
1
  import type { Location } from '../ref-utils';
2
2
  import type { ProblemSeverity, UserContext } from '../walk';
3
- import type { Oas3PreprocessorsSet, SpecMajorVersion, Oas3DecoratorsSet, Oas2RuleSet, Oas2PreprocessorsSet, Oas2DecoratorsSet, Oas3RuleSet, SpecVersion, Async2PreprocessorsSet, Async2DecoratorsSet, Async2RuleSet, Async3PreprocessorsSet, Async3DecoratorsSet, Async3RuleSet, ArazzoRuleSet, ArazzoPreprocessorsSet, ArazzoDecoratorsSet, RuleMap } from '../oas-types';
3
+ import type { Oas3PreprocessorsSet, SpecMajorVersion, Oas3DecoratorsSet, Oas2RuleSet, Oas2PreprocessorsSet, Oas2DecoratorsSet, Oas3RuleSet, SpecVersion, Async2PreprocessorsSet, Async2DecoratorsSet, Async2RuleSet, Async3PreprocessorsSet, Async3DecoratorsSet, Async3RuleSet, Arazzo1RuleSet, Arazzo1PreprocessorsSet, Arazzo1DecoratorsSet, RuleMap } from '../oas-types';
4
4
  import type { NodeType } from '../types';
5
5
  import type { SkipFunctionContext } from '../visitors';
6
- import type { BuiltInAsync2RuleId, BuiltInAsync3RuleId, BuiltInCommonOASRuleId, BuiltInOAS2RuleId, BuiltInOAS3RuleId, BuiltInArazzoRuleId } from '../types/redocly-yaml';
7
6
  import type { JSONSchema } from 'json-schema-to-ts';
8
7
  export type RuleSeverity = ProblemSeverity | 'off';
9
8
  export type RuleSettings = {
@@ -22,27 +21,27 @@ export type StyleguideRawConfig<T = undefined> = {
22
21
  extends?: string[];
23
22
  doNotResolveExamples?: boolean;
24
23
  recommendedFallback?: boolean;
25
- rules?: RuleMap<BuiltInCommonOASRuleId, RuleConfig, T>;
26
- oas2Rules?: RuleMap<BuiltInOAS2RuleId, RuleConfig, T>;
27
- oas3_0Rules?: RuleMap<BuiltInOAS3RuleId, RuleConfig, T>;
28
- oas3_1Rules?: RuleMap<BuiltInOAS3RuleId, RuleConfig, T>;
29
- async2Rules?: RuleMap<BuiltInAsync2RuleId, RuleConfig, T>;
30
- async3Rules?: RuleMap<BuiltInAsync3RuleId, RuleConfig, T>;
31
- arazzoRules?: RuleMap<BuiltInArazzoRuleId, RuleConfig, T>;
24
+ rules?: RuleMap<string, RuleConfig, T>;
25
+ oas2Rules?: RuleMap<string, RuleConfig, T>;
26
+ oas3_0Rules?: RuleMap<string, RuleConfig, T>;
27
+ oas3_1Rules?: RuleMap<string, RuleConfig, T>;
28
+ async2Rules?: RuleMap<string, RuleConfig, T>;
29
+ async3Rules?: RuleMap<string, RuleConfig, T>;
30
+ arazzo1Rules?: RuleMap<string, RuleConfig, T>;
32
31
  preprocessors?: Record<string, PreprocessorConfig>;
33
32
  oas2Preprocessors?: Record<string, PreprocessorConfig>;
34
33
  oas3_0Preprocessors?: Record<string, PreprocessorConfig>;
35
34
  oas3_1Preprocessors?: Record<string, PreprocessorConfig>;
36
35
  async2Preprocessors?: Record<string, PreprocessorConfig>;
37
36
  async3Preprocessors?: Record<string, PreprocessorConfig>;
38
- arazzoPreprocessors?: Record<string, PreprocessorConfig>;
37
+ arazzo1Preprocessors?: Record<string, PreprocessorConfig>;
39
38
  decorators?: Record<string, DecoratorConfig>;
40
39
  oas2Decorators?: Record<string, DecoratorConfig>;
41
40
  oas3_0Decorators?: Record<string, DecoratorConfig>;
42
41
  oas3_1Decorators?: Record<string, DecoratorConfig>;
43
42
  async2Decorators?: Record<string, DecoratorConfig>;
44
43
  async3Decorators?: Record<string, DecoratorConfig>;
45
- arazzoDecorators?: Record<string, DecoratorConfig>;
44
+ arazzo1Decorators?: Record<string, DecoratorConfig>;
46
45
  };
47
46
  export type ApiStyleguideRawConfig = Omit<StyleguideRawConfig, 'plugins'>;
48
47
  export type ResolvedStyleguideConfig = PluginStyleguideConfig & {
@@ -57,24 +56,25 @@ export type PreprocessorsConfig = {
57
56
  oas2?: Oas2PreprocessorsSet;
58
57
  async2?: Async2PreprocessorsSet;
59
58
  async3?: Async3PreprocessorsSet;
60
- arazzo?: ArazzoPreprocessorsSet;
59
+ arazzo1?: Arazzo1PreprocessorsSet;
61
60
  };
62
61
  export type DecoratorsConfig = {
63
62
  oas3?: Oas3DecoratorsSet;
64
63
  oas2?: Oas2DecoratorsSet;
65
64
  async2?: Async2DecoratorsSet;
66
65
  async3?: Async3DecoratorsSet;
67
- arazzo?: ArazzoDecoratorsSet;
66
+ arazzo1?: Arazzo1DecoratorsSet;
68
67
  };
69
68
  export type TypesExtensionFn = (types: Record<string, NodeType>, oasVersion: SpecVersion) => Record<string, NodeType>;
70
69
  export type TypeExtensionsConfig = Partial<Record<SpecMajorVersion, TypesExtensionFn>>;
71
- export type CustomRulesConfig = {
72
- oas3?: Oas3RuleSet;
73
- oas2?: Oas2RuleSet;
74
- async2?: Async2RuleSet;
75
- async3?: Async3RuleSet;
76
- arazzo?: ArazzoRuleSet;
77
- };
70
+ export type RulesConfig<T> = {
71
+ oas3?: Oas3RuleSet<T>;
72
+ oas2?: Oas2RuleSet<T>;
73
+ async2?: Async2RuleSet<T>;
74
+ async3?: Async3RuleSet<T>;
75
+ arazzo1?: Arazzo1RuleSet<T>;
76
+ };
77
+ export type CustomRulesConfig = RulesConfig<undefined>;
78
78
  export type AssertionContext = Partial<UserContext> & SkipFunctionContext & {
79
79
  node: any;
80
80
  };
@@ -84,10 +84,10 @@ export type AssertResult = {
84
84
  };
85
85
  export type CustomFunction = (value: any, options: unknown, baseLocation: Location) => AssertResult[];
86
86
  export type AssertionsConfig = Record<string, CustomFunction>;
87
- export type Plugin = {
87
+ export type Plugin<T = undefined> = {
88
88
  id: string;
89
89
  configs?: Record<string, PluginStyleguideConfig>;
90
- rules?: CustomRulesConfig;
90
+ rules?: RulesConfig<T>;
91
91
  preprocessors?: PreprocessorsConfig;
92
92
  decorators?: DecoratorsConfig;
93
93
  typeExtension?: TypeExtensionsConfig;
@@ -186,5 +186,5 @@ export type ThemeRawConfig = {
186
186
  openapi?: Record<string, any>;
187
187
  mockServer?: Record<string, any>;
188
188
  };
189
- export type RulesFields = 'rules' | 'oas2Rules' | 'oas3_0Rules' | 'oas3_1Rules' | 'async2Rules' | 'async3Rules' | 'arazzoRules' | 'preprocessors' | 'oas2Preprocessors' | 'oas3_0Preprocessors' | 'oas3_1Preprocessors' | 'async2Preprocessors' | 'async3Preprocessors' | 'arazzoPreprocessors' | 'decorators' | 'oas2Decorators' | 'oas3_0Decorators' | 'oas3_1Decorators' | 'async2Decorators' | 'async3Decorators' | 'arazzoDecorators';
189
+ export type RulesFields = 'rules' | 'oas2Rules' | 'oas3_0Rules' | 'oas3_1Rules' | 'async2Rules' | 'async3Rules' | 'arazzo1Rules' | 'preprocessors' | 'oas2Preprocessors' | 'oas3_0Preprocessors' | 'oas3_1Preprocessors' | 'async2Preprocessors' | 'async3Preprocessors' | 'arazzo1Preprocessors' | 'decorators' | 'oas2Decorators' | 'oas3_0Decorators' | 'oas3_1Decorators' | 'async2Decorators' | 'async3Decorators' | 'arazzo1Decorators';
190
190
  export {};
@@ -8,7 +8,7 @@ export declare function transformApiDefinitionsToApis(apiDefinitions?: Deprecate
8
8
  export declare function prefixRules<T extends Record<string, any>>(rules: T, prefix: string): any;
9
9
  export declare function mergeExtends(rulesConfList: ResolvedStyleguideConfig[]): Omit<ResolvedStyleguideConfig, RulesFields> & Required<Pick<ResolvedStyleguideConfig, RulesFields>>;
10
10
  export declare function getMergedConfig(config: Config, apiName?: string): Config;
11
- export declare function checkForDeprecatedFields(deprecatedField: keyof (DeprecatedInRawConfig & RawConfig), updatedField: keyof FlatRawConfig | undefined, rawConfig: DeprecatedInRawConfig & RawConfig & FlatRawConfig, updatedObject: keyof FlatRawConfig | undefined): void;
11
+ export declare function checkForDeprecatedFields(deprecatedField: keyof (DeprecatedInRawConfig & RawConfig), updatedField: keyof FlatRawConfig | undefined, rawConfig: DeprecatedInRawConfig & RawConfig & FlatRawConfig, updatedObject: keyof FlatRawConfig | undefined, link?: string | undefined): void;
12
12
  export declare function transformConfig(rawConfig: DeprecatedInRawConfig & RawConfig & FlatRawConfig): RawConfig;
13
13
  export declare function getResolveConfig(resolve?: RawResolveConfig): ResolveConfig;
14
14
  export declare function getUniquePlugins(plugins: Plugin[]): Plugin[];
@@ -34,7 +34,7 @@ function transformApiDefinitionsToApis(apiDefinitions) {
34
34
  }
35
35
  return apis;
36
36
  }
37
- function extractFlatConfig({ plugins, extends: _extends, rules, oas2Rules, oas3_0Rules, oas3_1Rules, async2Rules, async3Rules, arazzoRules, preprocessors, oas2Preprocessors, oas3_0Preprocessors, oas3_1Preprocessors, async2Preprocessors, async3Preprocessors, arazzoPreprocessors, decorators, oas2Decorators, oas3_0Decorators, oas3_1Decorators, async2Decorators, async3Decorators, arazzoDecorators, ...rawConfigRest }) {
37
+ function extractFlatConfig({ plugins, extends: _extends, rules, oas2Rules, oas3_0Rules, oas3_1Rules, async2Rules, async3Rules, arazzo1Rules, preprocessors, oas2Preprocessors, oas3_0Preprocessors, oas3_1Preprocessors, async2Preprocessors, async3Preprocessors, arazzo1Preprocessors, decorators, oas2Decorators, oas3_0Decorators, oas3_1Decorators, async2Decorators, async3Decorators, arazzo1Decorators, ...rawConfigRest }) {
38
38
  const styleguideConfig = {
39
39
  plugins,
40
40
  extends: _extends,
@@ -44,21 +44,21 @@ function extractFlatConfig({ plugins, extends: _extends, rules, oas2Rules, oas3_
44
44
  oas3_1Rules,
45
45
  async2Rules,
46
46
  async3Rules,
47
- arazzoRules,
47
+ arazzo1Rules,
48
48
  preprocessors,
49
49
  oas2Preprocessors,
50
50
  oas3_0Preprocessors,
51
51
  oas3_1Preprocessors,
52
52
  async2Preprocessors,
53
53
  async3Preprocessors,
54
- arazzoPreprocessors,
54
+ arazzo1Preprocessors,
55
55
  decorators,
56
56
  oas2Decorators,
57
57
  oas3_0Decorators,
58
58
  oas3_1Decorators,
59
59
  async2Decorators,
60
60
  async3Decorators,
61
- arazzoDecorators,
61
+ arazzo1Decorators,
62
62
  doNotResolveExamples: rawConfigRest.resolve?.doNotResolveExamples,
63
63
  };
64
64
  if ((rawConfigRest.lint && rawConfigRest.styleguide) ||
@@ -103,21 +103,21 @@ function mergeExtends(rulesConfList) {
103
103
  oas3_1Rules: {},
104
104
  async2Rules: {},
105
105
  async3Rules: {},
106
- arazzoRules: {},
106
+ arazzo1Rules: {},
107
107
  preprocessors: {},
108
108
  oas2Preprocessors: {},
109
109
  oas3_0Preprocessors: {},
110
110
  oas3_1Preprocessors: {},
111
111
  async2Preprocessors: {},
112
112
  async3Preprocessors: {},
113
- arazzoPreprocessors: {},
113
+ arazzo1Preprocessors: {},
114
114
  decorators: {},
115
115
  oas2Decorators: {},
116
116
  oas3_0Decorators: {},
117
117
  oas3_1Decorators: {},
118
118
  async2Decorators: {},
119
119
  async3Decorators: {},
120
- arazzoDecorators: {},
120
+ arazzo1Decorators: {},
121
121
  plugins: [],
122
122
  pluginPaths: [],
123
123
  extendPaths: [],
@@ -137,8 +137,8 @@ function mergeExtends(rulesConfList) {
137
137
  (0, utils_1.assignOnlyExistingConfig)(result.async2Rules, rulesConf.rules);
138
138
  (0, utils_1.assignConfig)(result.async3Rules, rulesConf.async3Rules);
139
139
  (0, utils_1.assignOnlyExistingConfig)(result.async3Rules, rulesConf.rules);
140
- (0, utils_1.assignConfig)(result.arazzoRules, rulesConf.arazzoRules);
141
- (0, utils_1.assignOnlyExistingConfig)(result.arazzoRules, rulesConf.rules);
140
+ (0, utils_1.assignConfig)(result.arazzo1Rules, rulesConf.arazzo1Rules);
141
+ (0, utils_1.assignOnlyExistingConfig)(result.arazzo1Rules, rulesConf.rules);
142
142
  (0, utils_1.assignConfig)(result.preprocessors, rulesConf.preprocessors);
143
143
  (0, utils_1.assignConfig)(result.oas2Preprocessors, rulesConf.oas2Preprocessors);
144
144
  (0, utils_1.assignOnlyExistingConfig)(result.oas2Preprocessors, rulesConf.preprocessors);
@@ -150,8 +150,8 @@ function mergeExtends(rulesConfList) {
150
150
  (0, utils_1.assignOnlyExistingConfig)(result.async2Preprocessors, rulesConf.preprocessors);
151
151
  (0, utils_1.assignConfig)(result.async3Preprocessors, rulesConf.async3Preprocessors);
152
152
  (0, utils_1.assignOnlyExistingConfig)(result.async3Preprocessors, rulesConf.preprocessors);
153
- (0, utils_1.assignConfig)(result.arazzoPreprocessors, rulesConf.arazzoPreprocessors);
154
- (0, utils_1.assignOnlyExistingConfig)(result.arazzoPreprocessors, rulesConf.preprocessors);
153
+ (0, utils_1.assignConfig)(result.arazzo1Preprocessors, rulesConf.arazzo1Preprocessors);
154
+ (0, utils_1.assignOnlyExistingConfig)(result.arazzo1Preprocessors, rulesConf.preprocessors);
155
155
  (0, utils_1.assignConfig)(result.decorators, rulesConf.decorators);
156
156
  (0, utils_1.assignConfig)(result.oas2Decorators, rulesConf.oas2Decorators);
157
157
  (0, utils_1.assignOnlyExistingConfig)(result.oas2Decorators, rulesConf.decorators);
@@ -163,8 +163,8 @@ function mergeExtends(rulesConfList) {
163
163
  (0, utils_1.assignOnlyExistingConfig)(result.async2Decorators, rulesConf.decorators);
164
164
  (0, utils_1.assignConfig)(result.async3Decorators, rulesConf.async3Decorators);
165
165
  (0, utils_1.assignOnlyExistingConfig)(result.async3Decorators, rulesConf.decorators);
166
- (0, utils_1.assignConfig)(result.arazzoDecorators, rulesConf.arazzoDecorators);
167
- (0, utils_1.assignOnlyExistingConfig)(result.arazzoDecorators, rulesConf.decorators);
166
+ (0, utils_1.assignConfig)(result.arazzo1Decorators, rulesConf.arazzo1Decorators);
167
+ (0, utils_1.assignOnlyExistingConfig)(result.arazzo1Decorators, rulesConf.decorators);
168
168
  result.plugins.push(...(rulesConf.plugins || []));
169
169
  result.pluginPaths.push(...(rulesConf.pluginPaths || []));
170
170
  result.extendPaths.push(...new Set(rulesConf.extendPaths));
@@ -203,11 +203,11 @@ function getMergedConfig(config, apiName) {
203
203
  }, config.configFile)
204
204
  : config;
205
205
  }
206
- function checkForDeprecatedFields(deprecatedField, updatedField, rawConfig, updatedObject) {
206
+ function checkForDeprecatedFields(deprecatedField, updatedField, rawConfig, updatedObject, link) {
207
207
  const isDeprecatedFieldInApis = rawConfig.apis &&
208
208
  Object.values(rawConfig.apis).some((api) => api[deprecatedField]);
209
209
  if (rawConfig[deprecatedField] && updatedField === null) {
210
- (0, utils_1.showWarningForDeprecatedField)(deprecatedField);
210
+ (0, utils_1.showWarningForDeprecatedField)(deprecatedField, undefined, updatedObject, link);
211
211
  }
212
212
  if (rawConfig[deprecatedField] && updatedField && rawConfig[updatedField]) {
213
213
  (0, utils_1.showErrorForDeprecatedField)(deprecatedField, updatedField);
@@ -216,19 +216,29 @@ function checkForDeprecatedFields(deprecatedField, updatedField, rawConfig, upda
216
216
  (0, utils_1.showErrorForDeprecatedField)(deprecatedField, updatedField, updatedObject);
217
217
  }
218
218
  if (rawConfig[deprecatedField] || isDeprecatedFieldInApis) {
219
- (0, utils_1.showWarningForDeprecatedField)(deprecatedField, updatedField, updatedObject);
219
+ (0, utils_1.showWarningForDeprecatedField)(deprecatedField, updatedField, updatedObject, link);
220
220
  }
221
221
  }
222
222
  function transformConfig(rawConfig) {
223
223
  const migratedFields = [
224
- ['apiDefinitions', 'apis', undefined],
225
- ['referenceDocs', 'openapi', 'theme'],
226
- ['lint', undefined, undefined],
227
- ['styleguide', undefined, undefined],
228
- ['features.openapi', 'openapi', 'theme'],
224
+ ['apiDefinitions', 'apis', undefined, undefined],
225
+ ['referenceDocs', 'openapi', 'theme', undefined],
226
+ [
227
+ 'lint',
228
+ undefined,
229
+ undefined,
230
+ 'https://redocly.com/docs/api-registry/guides/migration-guide-config-file/#changed-properties',
231
+ ],
232
+ [
233
+ 'styleguide',
234
+ undefined,
235
+ undefined,
236
+ 'https://redocly.com/docs/api-registry/guides/migration-guide-config-file/#changed-properties',
237
+ ],
238
+ ['features.openapi', 'openapi', 'theme', undefined],
229
239
  ];
230
- for (const [deprecatedField, updatedField, updatedObject] of migratedFields) {
231
- checkForDeprecatedFields(deprecatedField, updatedField, rawConfig, updatedObject);
240
+ for (const [deprecatedField, updatedField, updatedObject, link] of migratedFields) {
241
+ checkForDeprecatedFields(deprecatedField, updatedField, rawConfig, updatedObject, link);
232
242
  }
233
243
  const { apis, apiDefinitions, referenceDocs, lint, ...rest } = rawConfig;
234
244
  const { styleguideConfig, rawConfigRest } = extractFlatConfig(rest);
package/lib/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { BundleOutputFormat, readFileFromUrl, slash, doesYamlFileExist, isTruthy, getProxyAgent, pause, } from './utils';
2
2
  export { Oas3_1Types } from './types/oas3_1';
3
- export { ArazzoTypes } from './types/arazzo';
3
+ export { Arazzo1Types } from './types/arazzo';
4
4
  export { Oas3Types } from './types/oas3';
5
5
  export { Oas2Types } from './types/oas2';
6
6
  export { AsyncApi2Types } from './types/asyncapi2';
package/lib/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.validate = exports.lint = exports.getTotals = exports.formatProblems = exports.getLineColLocation = exports.getAstNodeByPointer = exports.walkDocument = exports.normalizeVisitors = exports.getTypes = exports.detectSpec = exports.SpecVersion = exports.getMajorSpecVersion = exports.SpecMajorVersion = exports.isAbsoluteUrl = exports.isRef = exports.unescapePointer = exports.stringifyYaml = exports.parseYaml = exports.makeDocumentFromString = exports.YamlParseError = exports.ResolveError = exports.resolveDocument = exports.BaseResolver = exports.Source = exports.RedoclyClient = exports.createConfig = exports.CONFIG_FILE_NAMES = exports.findConfig = exports.getConfig = exports.loadConfig = exports.transformConfig = exports.getMergedConfig = exports.IGNORE_FILE = exports.StyleguideConfig = exports.Config = exports.Stats = exports.normalizeTypes = exports.ConfigTypes = exports.AsyncApi3Types = exports.AsyncApi2Types = exports.Oas2Types = exports.Oas3Types = exports.ArazzoTypes = exports.Oas3_1Types = exports.pause = exports.getProxyAgent = exports.isTruthy = exports.doesYamlFileExist = exports.slash = exports.readFileFromUrl = void 0;
17
+ exports.validate = exports.lint = exports.getTotals = exports.formatProblems = exports.getLineColLocation = exports.getAstNodeByPointer = exports.walkDocument = exports.normalizeVisitors = exports.getTypes = exports.detectSpec = exports.SpecVersion = exports.getMajorSpecVersion = exports.SpecMajorVersion = exports.isAbsoluteUrl = exports.isRef = exports.unescapePointer = exports.stringifyYaml = exports.parseYaml = exports.makeDocumentFromString = exports.YamlParseError = exports.ResolveError = exports.resolveDocument = exports.BaseResolver = exports.Source = exports.RedoclyClient = exports.createConfig = exports.CONFIG_FILE_NAMES = exports.findConfig = exports.getConfig = exports.loadConfig = exports.transformConfig = exports.getMergedConfig = exports.IGNORE_FILE = exports.StyleguideConfig = exports.Config = exports.Stats = exports.normalizeTypes = exports.ConfigTypes = exports.AsyncApi3Types = exports.AsyncApi2Types = exports.Oas2Types = exports.Oas3Types = exports.Arazzo1Types = exports.Oas3_1Types = exports.pause = exports.getProxyAgent = exports.isTruthy = exports.doesYamlFileExist = exports.slash = exports.readFileFromUrl = void 0;
18
18
  exports.bundleFromString = exports.mapTypeToComponent = exports.bundleDocument = exports.bundle = exports.lintConfig = exports.lintFromString = exports.lintDocument = void 0;
19
19
  var utils_1 = require("./utils");
20
20
  Object.defineProperty(exports, "readFileFromUrl", { enumerable: true, get: function () { return utils_1.readFileFromUrl; } });
@@ -26,7 +26,7 @@ Object.defineProperty(exports, "pause", { enumerable: true, get: function () { r
26
26
  var oas3_1_1 = require("./types/oas3_1");
27
27
  Object.defineProperty(exports, "Oas3_1Types", { enumerable: true, get: function () { return oas3_1_1.Oas3_1Types; } });
28
28
  var arazzo_1 = require("./types/arazzo");
29
- Object.defineProperty(exports, "ArazzoTypes", { enumerable: true, get: function () { return arazzo_1.ArazzoTypes; } });
29
+ Object.defineProperty(exports, "Arazzo1Types", { enumerable: true, get: function () { return arazzo_1.Arazzo1Types; } });
30
30
  var oas3_1 = require("./types/oas3");
31
31
  Object.defineProperty(exports, "Oas3Types", { enumerable: true, get: function () { return oas3_1.Oas3Types; } });
32
32
  var oas2_1 = require("./types/oas2");
package/lib/lint.js CHANGED
@@ -13,7 +13,7 @@ const types_1 = require("./types");
13
13
  const ajv_1 = require("./rules/ajv");
14
14
  const oas_types_1 = require("./oas-types");
15
15
  const redocly_yaml_1 = require("./types/redocly-yaml");
16
- const spec_1 = require("./rules/common/spec");
16
+ const struct_1 = require("./rules/common/struct");
17
17
  const no_unresolved_refs_1 = require("./rules/no-unresolved-refs");
18
18
  async function lint(opts) {
19
19
  const { ref, externalRefResolver = new resolve_1.BaseResolver(opts.config.resolve) } = opts;
@@ -41,7 +41,7 @@ async function lintDocument(opts) {
41
41
  const { document, customTypes, externalRefResolver, config } = opts;
42
42
  const specVersion = (0, oas_types_1.detectSpec)(document.parsed);
43
43
  const specMajorVersion = (0, oas_types_1.getMajorSpecVersion)(specVersion);
44
- const rules = config.getRulesForOasVersion(specMajorVersion);
44
+ const rules = config.getRulesForSpecVersion(specMajorVersion);
45
45
  const types = (0, types_1.normalizeTypes)(config.extendTypes(customTypes ?? (0, oas_types_1.getTypes)(specVersion), specVersion), config);
46
46
  const ctx = {
47
47
  problems: [],
@@ -92,7 +92,7 @@ async function lintConfig(opts) {
92
92
  {
93
93
  severity: severity || 'error',
94
94
  ruleId: 'configuration spec',
95
- visitor: (0, spec_1.Spec)({ severity: 'error' }),
95
+ visitor: (0, struct_1.Struct)({ severity: 'error' }),
96
96
  },
97
97
  {
98
98
  severity: severity || 'error',