persona-community-5/.pnpm-store/v3/files/78/24270dbe75b422ade95c0f48340b4b84b7ec15872a83b7787b8ed3b4b07cd369e6693c9d791ffa6a79d591c92006588c34e3ce1fae046270849243008b14f2
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

19 lines
651 B
Plaintext

import type { Async2Rule } from '../../visitors';
import type { UserContext } from '../../walk';
export const ChannelsKebabCase: Async2Rule = () => {
return {
Channel(_channel: object, { report, key }: UserContext) {
const segments = (key as string)
.split(/[/.:]/) // split on / or : as likely channel namespacers
.filter((s) => s !== ''); // filter out empty segments
if (!segments.every((segment) => /^{.+}$/.test(segment) || /^[a-z0-9-.]+$/.test(segment))) {
report({
message: `\`${key}\` does not use kebab-case.`,
location: { reportOnKey: true },
});
}
},
};
};