Skip to content

Commit

Permalink
chore: update tools/update-rule-types
Browse files Browse the repository at this point in the history
  • Loading branch information
aladdin-add committed May 18, 2021
1 parent f0ad699 commit 1ec5564
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions tools/update-rule-types.js
Expand Up @@ -30,29 +30,11 @@ module.exports = (fileInfo, api) => {
}

const typeNode = metaNode.value.properties.find(node => node.key.name === "type");
const docsNode = metaNode.value.properties.find(node => node.key.name === "docs");
const categoryNode = docsNode.value.properties.find(node => node.key.name === "category").value;

let ruleType;

// the rule-types.json file takes highest priority
if (ruleName in ruleTypes) {
ruleType = ruleTypes[ruleName];
} else {

// otherwise fallback to category
switch (categoryNode.value) {
case "Stylistic Issues":
ruleType = "style";
break;

case "Possible Errors":
ruleType = "problem";
break;

default:
ruleType = "suggestion";
}
}

if (typeNode) {
Expand Down

0 comments on commit 1ec5564

Please sign in to comment.