diff --git a/publicodes/source/components/rule/Rule.tsx b/publicodes/source/components/rule/Rule.tsx index 3cba6d4d6..25751eae6 100644 --- a/publicodes/source/components/rule/Rule.tsx +++ b/publicodes/source/components/rule/Rule.tsx @@ -1,7 +1,8 @@ -import React, { useState } from 'react' +import React from 'react' import { Trans } from 'react-i18next' import Engine from '../..' import { formatValue } from '../../format' +import { ruleWithDedicatedDocumentationPage } from '../../ruleUtils' import { serializeUnit } from '../../units' import { Markdown } from '../Markdown' import { RuleLinkWithContext } from '../RuleLink' @@ -112,11 +113,14 @@ function AssociatedRules({ dottedName: Name engine: Engine }) { - const namespaceRules = Object.keys(engine.getParsedRules()).filter( - ruleDottedName => - ruleDottedName.startsWith(dottedName) && - ruleDottedName.split(' . ').length === dottedName.split(' . ').length + 1 - ) + const namespaceRules = Object.keys(engine.getParsedRules()) + .filter( + ruleDottedName => + ruleDottedName.startsWith(dottedName) && + ruleDottedName.split(' . ').length === + dottedName.split(' . ').length + 1 + ) + .filter(rule => !ruleWithDedicatedDocumentationPage(rule)) if (!namespaceRules.length) { return null }