@lcap/nasl
Version:
NetEase Application Specific Language
21 lines • 702 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ruleDeleteVoidExpression = void 0;
const regex = /无返回值的(.*)不能在(.*)中作为表达式使用。/;
exports.ruleDeleteVoidExpression = {
isFixable(diagnostic) {
const match = diagnostic.message?.match(regex);
if (match) {
return { hint: `一键删除 ${match[1]}` };
}
return false;
},
commitFix(node) {
let currNode = node;
while (currNode.parentNode?.concept === 'MemberExpression') {
currNode = currNode.parentNode;
}
currNode.delete();
},
};
//# sourceMappingURL=rule-delete-void-expression.js.map