Skip to content

Commit

Permalink
fix: nom is not an attribute anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
Clemog committed Jan 5, 2024
1 parent a230461 commit d31c2d9
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions source/compilation/resolveImports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,21 +162,6 @@ ${importedRule.description}`
}
}

/**
* @throws {Error} If the `nom` attribute is different from the `ruleNameToCheck`.
*/
function removeRawNodeNom(
rawNode: Rule,
ruleNameToCheck: string,
): Omit<Rule, 'nom'> {
const { nom, ...rest } = rawNode
if (nom !== ruleNameToCheck)
throw Error(
`Imported rule's publicode raw node "nom" attribute is different from the resolveImport script ruleName. Please investigate`,
)
return rest
}

function appearsMoreThanOnce(
rulesToImport: RuleToImport[],
ruleName: RuleName,
Expand Down Expand Up @@ -252,10 +237,7 @@ export function resolveImports(
utils
.ruleParents(ruleName)
.forEach((rule) => neededNamespaces.add(`${namespace} . ${rule}`))
return [
`${namespace} . ${ruleName}`,
removeRawNodeNom(ruleWithUpdatedDescription, ruleName),
]
return [`${namespace} . ${ruleName}`, ruleWithUpdatedDescription]
}

const ruleWithOverridenAttributes = { ...rule.rawNode, ...attrs }
Expand Down

0 comments on commit d31c2d9

Please sign in to comment.