persona-community-5/.pnpm-store/v3/files/cb/dd6f2479444df8754d5bf8e8763c968bbb4d1e31596926dee566c2210f45a468614b29f74b75648fbd68f359d0d281a36cde8cf0c50c8d9631bb2aadf58ebe
rdev-worker a1d0d1bf1c
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
build: /implement-feature community-ui --requirements 'Build the React commu...
2026-02-24 08:22:30 +00:00

41 lines
1.1 KiB
Plaintext

import { readFileSync } from 'fs';
import { join as pathJoin, resolve as pathResolve } from 'path';
import { lintDocument } from '../../lint';
import { BaseResolver } from '../../resolve';
import { parseYamlToDocument, makeConfigForRuleset } from '../utils';
import type { StyleguideConfig } from '../../config';
export const name = 'Validate with single top-level rule and report';
export const count = 10;
const rebillyDefinitionRef = pathResolve(pathJoin(__dirname, 'rebilly.yaml'));
const rebillyDocument = parseYamlToDocument(
readFileSync(rebillyDefinitionRef, 'utf-8'),
rebillyDefinitionRef
);
let config: StyleguideConfig;
export async function setupAsync() {
config = await makeConfigForRuleset({
test: () => {
return {
Schema(schema, ctx) {
if (schema.type === 'number') {
ctx.report({
message: 'type number is not allowed',
});
}
},
};
},
});
}
export function measureAsync() {
return lintDocument({
externalRefResolver: new BaseResolver(),
document: rebillyDocument,
config,
});
}