eslint-plugin-comment-length
Version:
An ESLint plugin that provides rules that limit the line length of your comments
58 lines (51 loc) • 1.49 kB
text/typescript
import type { ESLint, Linter, Rule } from "eslint";
import { limitMultiLineCommentsRule } from "./rules/limit-multi-line-comments/rule.js";
import { limitSingleLineCommentsRule } from "./rules/limit-single-line-comments/rule.js";
import { limitTaggedTemplateLiteralCommentsRule } from "./rules/limit-tagged-template-literal-comments/rule.js";
export const rules = {
"limit-single-line-comments": limitSingleLineCommentsRule,
"limit-multi-line-comments": limitMultiLineCommentsRule,
"limit-tagged-template-literal-comments":
limitTaggedTemplateLiteralCommentsRule,
} as unknown as Record<string, Rule.RuleModule>;
const plugin = {
meta: {
name: "eslint-plugin-comment-length",
version: "2.0.0",
},
rules,
};
export const configs = {
recommended: {
plugins: ["comment-length"],
rules: {
"comment-length/limit-single-line-comments": ["warn"],
"comment-length/limit-multi-line-comments": ["warn"],
},
} satisfies ESLint.ConfigData,
"flat/recommended": {
files: [
"**/*.js",
"**/*.mjs",
"**/*.jsx",
"**/*.ts",
"**/*.mts",
"**/*.tsx",
],
plugins: {
"comment-length": plugin,
},
rules: {
"comment-length/limit-single-line-comments": ["warn"],
"comment-length/limit-multi-line-comments": ["warn"],
},
} satisfies Linter.Config,
} as const;
export default {
meta: {
name: "eslint-plugin-comment-length",
version: "2.0.0",
},
rules,
configs,
};