Open LorisSigrist opened 1 week ago
After looking at how ESLint handles lint rule configuration:
ESLint uses a combination of pre, and post-filtering for their lint-reports.
Lint rule severity (warn/error) and filter rules are not exposed to the lint-rule. They're purely in ESLint's own config
Visually:
As for fixing: Rules return callbacks for fixing the issue as part of the message-report.
context.report({
node: node, // the AST node where the issue is
message: "Missing semicolon", // the error-message
fix(fixer) { //callback to fix it
return fixer.insertTextAfter(node, ";");
}
});
IMO this is suboptimal since the callback cannot be passed between worker boundaries, so having the lint process in a separate worker will be inconvenient. We should consider having the fix be a separate function that get's passed the report.
fix(report, fixer) {
return fixer.insertTextAfter(report.node, ";");
}
fix function attached to the report function seems to make most sense đ
regarding severity:
Context
Lint rules need a lot of configuration
Open Questions