-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add built-in recommeded-strict ruleset (#1311)
- Loading branch information
Showing
14 changed files
with
173 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@redocly/openapi-core': minor | ||
'@redocly/cli': minor | ||
--- | ||
|
||
Added `recommended-strict` ruleset which uses the same rules as `recommended` but with the severity level set to `error` for all rules. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
import type { PluginStyleguideConfig } from './types'; | ||
|
||
const recommendedStrict: PluginStyleguideConfig<'built-in'> = { | ||
rules: { | ||
'info-contact': 'off', | ||
'info-license': 'error', | ||
'info-license-url': 'error', | ||
'tag-description': 'error', | ||
'tags-alphabetical': 'off', | ||
'parameter-description': 'off', | ||
'no-path-trailing-slash': 'error', | ||
'no-identical-paths': 'error', | ||
'no-ambiguous-paths': 'error', | ||
'path-declaration-must-exist': 'error', | ||
'path-not-include-query': 'error', | ||
'path-parameters-defined': 'error', | ||
'operation-description': 'off', | ||
'operation-2xx-response': 'error', | ||
'operation-4xx-response': 'error', | ||
'operation-operationId': 'error', | ||
'operation-summary': 'error', | ||
'operation-operationId-unique': 'error', | ||
'operation-operationId-url-safe': 'error', | ||
'operation-parameters-unique': 'error', | ||
'operation-tag-defined': 'off', | ||
'security-defined': 'error', | ||
'operation-singular-tag': 'off', | ||
'no-unresolved-refs': 'error', | ||
'no-enum-type-mismatch': 'error', | ||
'paths-kebab-case': 'off', | ||
spec: 'error', | ||
'spec-strict-refs': 'off', | ||
'no-http-verbs-in-paths': 'off', | ||
'no-invalid-parameter-examples': 'off', | ||
'no-invalid-schema-examples': 'off', | ||
'path-excludes-patterns': 'off', | ||
'path-http-verbs-order': 'off', | ||
'path-params-defined': 'off', | ||
'path-segment-plural': 'off', | ||
'required-string-property-missing-min-length': 'off', | ||
'response-contains-header': 'off', | ||
'scalar-property-missing-example': 'off', | ||
}, | ||
oas2Rules: { | ||
'boolean-parameter-prefixes': 'off', | ||
'request-mime-type': 'off', | ||
'response-contains-property': 'off', | ||
'response-mime-type': 'off', | ||
}, | ||
oas3_0Rules: { | ||
'no-invalid-media-type-examples': { | ||
severity: 'error', | ||
allowAdditionalProperties: false, | ||
}, | ||
'no-server-example.com': 'error', | ||
'no-server-trailing-slash': 'error', | ||
'no-empty-servers': 'error', | ||
'no-example-value-and-externalValue': 'error', | ||
'no-unused-components': 'error', | ||
'no-undefined-server-variable': 'error', | ||
'no-server-variables-empty-enum': 'error', | ||
'spec-components-invalid-map-name': 'error', | ||
'boolean-parameter-prefixes': 'off', | ||
'component-name-unique': 'off', | ||
'operation-4xx-problem-details-rfc7807': 'off', | ||
'request-mime-type': 'off', | ||
'response-contains-property': 'off', | ||
'response-mime-type': 'off', | ||
}, | ||
oas3_1Rules: { | ||
'no-invalid-media-type-examples': 'error', | ||
'no-server-example.com': 'error', | ||
'no-server-trailing-slash': 'error', | ||
'no-empty-servers': 'error', | ||
'no-example-value-and-externalValue': 'error', | ||
'no-unused-components': 'error', | ||
'no-undefined-server-variable': 'error', | ||
'no-server-variables-empty-enum': 'error', | ||
'spec-components-invalid-map-name': 'error', | ||
'boolean-parameter-prefixes': 'off', | ||
'component-name-unique': 'off', | ||
'operation-4xx-problem-details-rfc7807': 'off', | ||
'request-mime-type': 'off', | ||
'response-contains-property': 'off', | ||
'response-mime-type': 'off', | ||
}, | ||
async2Rules: { | ||
'channels-kebab-case': 'off', | ||
'no-channel-trailing-slash': 'off', | ||
}, | ||
}; | ||
|
||
export default recommendedStrict; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4620f79
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage report
Test suite run success
646 tests passing in 93 suites.
Report generated by 🧪jest coverage report action from 4620f79