@redocly/openapi-core
Version:
See https://github.com/Redocly/redocly-cli
16 lines • 664 B
JavaScript
export const NoServerExample = () => {
return {
Server(server, { report, location }) {
// eslint-disable-next-line no-useless-escape
const pattern = /^(.*[\/.])?(example\.com|localhost)([\/:?].*|$)/;
if (server.url && pattern.test(server.url)) {
report({
message: 'Server `url` should not point to example.com or localhost.',
location: location.child(['url']),
reference: 'https://redocly.com/docs/cli/rules/oas/no-server-example-com',
});
}
},
};
};
//# sourceMappingURL=no-server-example.com.js.map