mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
25 lines
636 B
TypeScript
25 lines
636 B
TypeScript
import { defineRule } from "@oxlint/plugins";
|
|
|
|
export const noCommentsRule = defineRule({
|
|
meta: {
|
|
type: "problem",
|
|
docs: {
|
|
description: "Disallow every comment, including JSDoc comments.",
|
|
},
|
|
messages: {
|
|
comment:
|
|
"Remove this comment. Express intent through names, types, and tests instead of comments.",
|
|
},
|
|
},
|
|
createOnce(context) {
|
|
return {
|
|
Program() {
|
|
for (const comment of context.sourceCode.getAllComments()) {
|
|
if (comment.type === "Shebang") continue;
|
|
context.report({ loc: comment.loc, messageId: "comment" });
|
|
}
|
|
},
|
|
};
|
|
},
|
|
});
|