@nekoyasuii/config 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-8m4by0h8.js → chunk-0xdbbpn5.js} +47 -23
- package/dist/chunk-97s6xvc6.js +32 -0
- package/dist/{chunk-1chg07xf.js → chunk-fqcw0kzp.js} +17 -1
- package/dist/tools/oxlint/config/anti-slop/index.d.ts +15 -0
- package/dist/tools/oxlint/config/core/index.d.ts +19 -0
- package/dist/tools/oxlint/config/index.d.ts +70 -24
- package/dist/tools/oxlint/config/index.js +12 -3
- package/dist/tools/oxlint/config/js-plugins/index.d.ts +180 -5
- package/dist/tools/oxlint/config/js-plugins/index.js +1 -1
- package/dist/tools/oxlint/config/no-comment-slop/index.d.ts +19 -0
- package/dist/tools/oxlint/config/no-comment-slop/index.js +7 -0
- package/dist/tools/oxlint/config/no-comment-slop/plugin.d.ts +658 -0
- package/dist/tools/oxlint/config/no-comment-slop/plugin.js +918 -0
- package/dist/tools/oxlint/config/react/index.d.ts +80 -21
- package/dist/tools/oxlint/config/react/index.js +1 -1
- package/dist/tools/oxlint/config/tanstack/index.d.ts +10 -0
- package/dist/tools/oxlint/config/tanstack/js-plugins/index.d.ts +18 -0
- package/dist/tools/oxlint/rules/index.js +261 -1
- package/dist/tools/shared/tsconfig-aliases.d.ts +3 -2
- package/package.json +1 -1
|
@@ -0,0 +1,918 @@
|
|
|
1
|
+
import"../../../../chunk-5wgwscd0.js";
|
|
2
|
+
|
|
3
|
+
// tools/oxlint/config/no-comment-slop/plugin.ts
|
|
4
|
+
var DIRECTIVE = new RegExp([
|
|
5
|
+
/^\s*@ts-(?:ignore|expect-error|nocheck|check)/,
|
|
6
|
+
/^\s*@(?:type|typedef|satisfies|license|preserve|jsx|jsxImportSource|vite-ignore|vue-ignore|__PURE__)\b/,
|
|
7
|
+
/^\s*#__(?:PURE|NO_SIDE_EFFECTS)__/,
|
|
8
|
+
/^\s*(?:eslint|oxlint|biome)-(?:disable|enable)/,
|
|
9
|
+
/^\s*eslint(?:\s|-env\b|$)/,
|
|
10
|
+
/^\s*tslint:/,
|
|
11
|
+
/^\s*biome-ignore/,
|
|
12
|
+
/^\s*(?:prettier|deno-lint|deno-fmt)-ignore/,
|
|
13
|
+
/^\s*(?:istanbul|c8|v8|node|jest|vitest)\s+ignore/,
|
|
14
|
+
/^\s*(?:globals?|exported)\s/,
|
|
15
|
+
/^\s*SPDX-License-Identifier/,
|
|
16
|
+
/^\s*\/\s*<(?:reference|amd-module|amd-dependency)\b/,
|
|
17
|
+
/^\s*webpack[A-Z]/
|
|
18
|
+
].map((r) => `(?:${r.source})`).join("|"), "i");
|
|
19
|
+
var isDirective = (comment) => DIRECTIVE.test(comment.value);
|
|
20
|
+
var isJsdoc = (comment) => comment.type === "Block" && comment.value.startsWith("*");
|
|
21
|
+
function getSource(context) {
|
|
22
|
+
const anyContext = context;
|
|
23
|
+
return anyContext.sourceCode ?? anyContext.getSourceCode();
|
|
24
|
+
}
|
|
25
|
+
var sourceText = (sourceCode) => typeof sourceCode.text === "string" ? sourceCode.text : sourceCode.getText();
|
|
26
|
+
function getComments(sourceCode) {
|
|
27
|
+
return sourceCode.getAllComments().filter((comment) => comment.type === "Line" || comment.type === "Block");
|
|
28
|
+
}
|
|
29
|
+
function lineStart(text, index) {
|
|
30
|
+
const nl = text.lastIndexOf(`
|
|
31
|
+
`, index - 1);
|
|
32
|
+
return nl === -1 ? 0 : nl + 1;
|
|
33
|
+
}
|
|
34
|
+
function isTrailing(text, comment) {
|
|
35
|
+
return text.slice(lineStart(text, comment.range[0]), comment.range[0]).trim() !== "";
|
|
36
|
+
}
|
|
37
|
+
var VALUE_OFFSET = 2;
|
|
38
|
+
function locAt(comment, index) {
|
|
39
|
+
const before = comment.value.slice(0, index);
|
|
40
|
+
const nl = before.lastIndexOf(`
|
|
41
|
+
`);
|
|
42
|
+
if (nl === -1) {
|
|
43
|
+
return {
|
|
44
|
+
line: comment.loc.start.line,
|
|
45
|
+
column: comment.loc.start.column + VALUE_OFFSET + index
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
let line = comment.loc.start.line;
|
|
49
|
+
for (const ch of before)
|
|
50
|
+
if (ch === `
|
|
51
|
+
`)
|
|
52
|
+
line++;
|
|
53
|
+
return { line, column: index - nl - 1 };
|
|
54
|
+
}
|
|
55
|
+
var spanAt = (comment, index, length) => ({
|
|
56
|
+
start: locAt(comment, index),
|
|
57
|
+
end: locAt(comment, index + length)
|
|
58
|
+
});
|
|
59
|
+
var rangeAt = (comment, index, length) => [
|
|
60
|
+
comment.range[0] + VALUE_OFFSET + index,
|
|
61
|
+
comment.range[0] + VALUE_OFFSET + index + length
|
|
62
|
+
];
|
|
63
|
+
function commentBlocks(text, comments) {
|
|
64
|
+
const blocks = [];
|
|
65
|
+
let run = null;
|
|
66
|
+
for (const comment of comments) {
|
|
67
|
+
if (comment.type === "Block" || isTrailing(text, comment)) {
|
|
68
|
+
blocks.push([comment]);
|
|
69
|
+
run = null;
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
const prev = run && run[run.length - 1];
|
|
73
|
+
if (prev && prev.loc.end.line + 1 === comment.loc.start.line && prev.loc.start.column === comment.loc.start.column) {
|
|
74
|
+
run.push(comment);
|
|
75
|
+
} else {
|
|
76
|
+
run = [comment];
|
|
77
|
+
blocks.push(run);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return blocks;
|
|
81
|
+
}
|
|
82
|
+
var blockLoc = (block) => ({
|
|
83
|
+
start: block[0].loc.start,
|
|
84
|
+
end: block[block.length - 1].loc.end
|
|
85
|
+
});
|
|
86
|
+
function commentLines(comment) {
|
|
87
|
+
return comment.value.split(`
|
|
88
|
+
`).map((raw, index) => {
|
|
89
|
+
const text = raw.replace(/^\s*\*+/, "").trim();
|
|
90
|
+
const first = index === 0;
|
|
91
|
+
return {
|
|
92
|
+
text,
|
|
93
|
+
blank: text === "",
|
|
94
|
+
line: comment.loc.start.line + index,
|
|
95
|
+
column: first ? comment.loc.start.column : 0,
|
|
96
|
+
endColumn: first ? comment.loc.start.column + VALUE_OFFSET + raw.length : raw.length
|
|
97
|
+
};
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
function splitSections(lines) {
|
|
101
|
+
const sections = [];
|
|
102
|
+
let current = null;
|
|
103
|
+
for (const line of lines) {
|
|
104
|
+
if (line.blank) {
|
|
105
|
+
current = null;
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
if (!current || /^@\w/.test(line.text)) {
|
|
109
|
+
current = [];
|
|
110
|
+
sections.push(current);
|
|
111
|
+
}
|
|
112
|
+
current.push(line);
|
|
113
|
+
}
|
|
114
|
+
return sections;
|
|
115
|
+
}
|
|
116
|
+
function withoutFencedCode(lines) {
|
|
117
|
+
const kept = [];
|
|
118
|
+
let inFence = false;
|
|
119
|
+
for (const line of lines) {
|
|
120
|
+
if (line.text.startsWith("```")) {
|
|
121
|
+
inFence = !inFence;
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
if (!inFence)
|
|
125
|
+
kept.push(line);
|
|
126
|
+
}
|
|
127
|
+
return kept;
|
|
128
|
+
}
|
|
129
|
+
var isExampleSection = (section) => /^@example\b/.test(section[0].text);
|
|
130
|
+
var sectionLoc = (section) => ({
|
|
131
|
+
start: { line: section[0].line, column: section[0].column },
|
|
132
|
+
end: {
|
|
133
|
+
line: section[section.length - 1].line,
|
|
134
|
+
column: section[section.length - 1].endColumn
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
function isFileHeaderAt(text, start) {
|
|
138
|
+
return /^\s*(?:#![^\n]*\n\s*)?$/.test(text.slice(0, start));
|
|
139
|
+
}
|
|
140
|
+
function documentsExportAt(text, firstStart, end, exportStart) {
|
|
141
|
+
if (exportStart < end)
|
|
142
|
+
return false;
|
|
143
|
+
const between = text.slice(end, exportStart);
|
|
144
|
+
if (between.trim() !== "")
|
|
145
|
+
return false;
|
|
146
|
+
const newlines = between.split(`
|
|
147
|
+
`).length - 1;
|
|
148
|
+
if (newlines <= 1)
|
|
149
|
+
return true;
|
|
150
|
+
return !isFileHeaderAt(text, firstStart);
|
|
151
|
+
}
|
|
152
|
+
var LICENSE_HEADER = /\b(?:copyright|licen[cs]e|spdx)\b|©|\(c\)/i;
|
|
153
|
+
function maskLiterals(value) {
|
|
154
|
+
return value.replace(/`[^`\n]*`|"[^"\n]*"/g, (span) => " ".repeat(span.length));
|
|
155
|
+
}
|
|
156
|
+
var docsUrl = (name) => `https://github.com/jantimon/eslint-plugin-no-comment-slop/blob/main/docs/rules/${name}.md`;
|
|
157
|
+
var maxCommentLines = {
|
|
158
|
+
meta: {
|
|
159
|
+
type: "suggestion",
|
|
160
|
+
docs: {
|
|
161
|
+
description: "Limit how many lines a comment may span",
|
|
162
|
+
recommended: true,
|
|
163
|
+
url: docsUrl("max-comment-lines")
|
|
164
|
+
},
|
|
165
|
+
schema: [
|
|
166
|
+
{
|
|
167
|
+
type: "object",
|
|
168
|
+
properties: {
|
|
169
|
+
max: { type: "integer", minimum: 1 },
|
|
170
|
+
headerMax: { type: "integer", minimum: 1 },
|
|
171
|
+
jsdocSectionMax: { type: "integer", minimum: 1 },
|
|
172
|
+
exportDescriptionMax: { type: "integer", minimum: 1 },
|
|
173
|
+
exportTagMax: { type: "integer", minimum: 1 }
|
|
174
|
+
},
|
|
175
|
+
additionalProperties: false
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
messages: {
|
|
179
|
+
tooLong: "Comment is {{lines}} lines (max {{max}}). If it needs this much explaining, put it in the docs and leave a link",
|
|
180
|
+
sectionTooLong: "This JSDoc section is {{lines}} lines (max {{max}}). Break it up with a blank line or move it to the docs"
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
create(context) {
|
|
184
|
+
const options = context.options[0] ?? {};
|
|
185
|
+
const max = options.max ?? 3;
|
|
186
|
+
const headerMax = options.headerMax ?? 5;
|
|
187
|
+
const jsdocSectionMax = options.jsdocSectionMax ?? 5;
|
|
188
|
+
const exportDescriptionMax = options.exportDescriptionMax ?? 10;
|
|
189
|
+
const exportTagMax = options.exportTagMax ?? 7;
|
|
190
|
+
const sourceCode = getSource(context);
|
|
191
|
+
const text = sourceText(sourceCode);
|
|
192
|
+
const exportStarts = [];
|
|
193
|
+
const collect = (node) => {
|
|
194
|
+
if (node.range)
|
|
195
|
+
exportStarts.push(node.range[0]);
|
|
196
|
+
};
|
|
197
|
+
return {
|
|
198
|
+
ExportNamedDeclaration: collect,
|
|
199
|
+
ExportDefaultDeclaration: collect,
|
|
200
|
+
"Program:exit"() {
|
|
201
|
+
for (const block of commentBlocks(text, getComments(sourceCode))) {
|
|
202
|
+
if (block.some(isDirective))
|
|
203
|
+
continue;
|
|
204
|
+
const limit = isFileHeaderAt(text, block[0].range[0]) ? headerMax : max;
|
|
205
|
+
if (isJsdoc(block[0])) {
|
|
206
|
+
const comment = block[0];
|
|
207
|
+
const documentsExport = exportStarts.some((start) => documentsExportAt(text, comment.range[0], comment.range[1], start));
|
|
208
|
+
const lines2 = withoutFencedCode(commentLines(comment));
|
|
209
|
+
for (const section of splitSections(lines2)) {
|
|
210
|
+
if (isExampleSection(section))
|
|
211
|
+
continue;
|
|
212
|
+
const isTag = /^@\w/.test(section[0].text);
|
|
213
|
+
const sectionMax = documentsExport ? isTag ? exportTagMax : exportDescriptionMax : jsdocSectionMax;
|
|
214
|
+
if (section.length > sectionMax) {
|
|
215
|
+
context.report({
|
|
216
|
+
loc: sectionLoc(section),
|
|
217
|
+
messageId: "sectionTooLong",
|
|
218
|
+
data: { lines: String(section.length), max: String(sectionMax) }
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
const lines = withoutFencedCode(block.flatMap(commentLines)).filter((line) => !line.blank);
|
|
225
|
+
if (lines.length > limit) {
|
|
226
|
+
context.report({
|
|
227
|
+
loc: blockLoc(block),
|
|
228
|
+
messageId: "tooLong",
|
|
229
|
+
data: { lines: String(lines.length), max: String(limit) }
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
var RULER = /^([-=*_~#+/\\.<>|:•])\1{2,}$/;
|
|
238
|
+
var TITLED = /^([-=*_~#+/\\|<>])\1{2,}\s*(.*?)\s*\1{3,}$/;
|
|
239
|
+
var noBannerComment = {
|
|
240
|
+
meta: {
|
|
241
|
+
type: "suggestion",
|
|
242
|
+
fixable: "code",
|
|
243
|
+
docs: {
|
|
244
|
+
description: "Disallow ASCII separator and banner comments",
|
|
245
|
+
recommended: true,
|
|
246
|
+
url: docsUrl("no-banner-comment")
|
|
247
|
+
},
|
|
248
|
+
schema: [
|
|
249
|
+
{
|
|
250
|
+
type: "object",
|
|
251
|
+
properties: {
|
|
252
|
+
flagTitled: { type: "boolean" },
|
|
253
|
+
minLength: { type: "integer", minimum: 2 }
|
|
254
|
+
},
|
|
255
|
+
additionalProperties: false
|
|
256
|
+
}
|
|
257
|
+
],
|
|
258
|
+
messages: {
|
|
259
|
+
ruler: "No separator comments. Use a blank line, or split the file",
|
|
260
|
+
titled: "No banner comments. Write the heading without the ASCII fencing"
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
create(context) {
|
|
264
|
+
const options = context.options[0] ?? {};
|
|
265
|
+
const flagTitled = options.flagTitled ?? true;
|
|
266
|
+
const minLength = options.minLength ?? 3;
|
|
267
|
+
const sourceCode = getSource(context);
|
|
268
|
+
const text = sourceText(sourceCode);
|
|
269
|
+
const ruler = minLength === 3 ? RULER : new RegExp(`^([-=*_~#+/\\\\.<>|•])\\1{${minLength - 1},}$`);
|
|
270
|
+
return {
|
|
271
|
+
Program() {
|
|
272
|
+
for (const comment of getComments(sourceCode)) {
|
|
273
|
+
if (isDirective(comment))
|
|
274
|
+
continue;
|
|
275
|
+
for (const line of commentLines(comment)) {
|
|
276
|
+
if (line.blank)
|
|
277
|
+
continue;
|
|
278
|
+
const isRuler = ruler.test(line.text);
|
|
279
|
+
const titled = !isRuler && flagTitled ? TITLED.exec(line.text) : null;
|
|
280
|
+
if (!isRuler && !titled)
|
|
281
|
+
continue;
|
|
282
|
+
const report = {
|
|
283
|
+
loc: {
|
|
284
|
+
start: { line: line.line, column: line.column },
|
|
285
|
+
end: { line: line.line, column: line.endColumn }
|
|
286
|
+
},
|
|
287
|
+
messageId: isRuler ? "ruler" : "titled"
|
|
288
|
+
};
|
|
289
|
+
const solo = comment.type === "Line" && !isTrailing(text, comment) && /^[ \t]*(\r?\n|$)/.exec(text.slice(comment.range[1]));
|
|
290
|
+
if (solo) {
|
|
291
|
+
const title = titled?.[2];
|
|
292
|
+
if (title) {
|
|
293
|
+
report.fix = (fixer) => fixer.replaceTextRange([comment.range[0], comment.range[1]], `// ${title}`);
|
|
294
|
+
} else {
|
|
295
|
+
const start = lineStart(text, comment.range[0]);
|
|
296
|
+
const end = comment.range[1] + solo[0].length;
|
|
297
|
+
report.fix = (fixer) => fixer.removeRange([start, end]);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
context.report(report);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
var noTrailingComment = {
|
|
308
|
+
meta: {
|
|
309
|
+
type: "suggestion",
|
|
310
|
+
docs: {
|
|
311
|
+
description: "Disallow comments on the same line as code",
|
|
312
|
+
recommended: true,
|
|
313
|
+
url: docsUrl("no-trailing-comment")
|
|
314
|
+
},
|
|
315
|
+
schema: [
|
|
316
|
+
{
|
|
317
|
+
type: "object",
|
|
318
|
+
properties: {
|
|
319
|
+
allowShort: { type: "integer", minimum: 0 }
|
|
320
|
+
},
|
|
321
|
+
additionalProperties: false
|
|
322
|
+
}
|
|
323
|
+
],
|
|
324
|
+
messages: {
|
|
325
|
+
trailing: "Move this comment onto its own line above the code"
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
create(context) {
|
|
329
|
+
const options = context.options[0] ?? {};
|
|
330
|
+
const allowShort = options.allowShort ?? 3;
|
|
331
|
+
const sourceCode = getSource(context);
|
|
332
|
+
const text = sourceText(sourceCode);
|
|
333
|
+
return {
|
|
334
|
+
Program() {
|
|
335
|
+
for (const comment of getComments(sourceCode)) {
|
|
336
|
+
if (isDirective(comment))
|
|
337
|
+
continue;
|
|
338
|
+
if (!isTrailing(text, comment))
|
|
339
|
+
continue;
|
|
340
|
+
if (comment.value.trim().length <= allowShort)
|
|
341
|
+
continue;
|
|
342
|
+
context.report({ loc: comment.loc, messageId: "trailing" });
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
var preferJsdocForExports = {
|
|
349
|
+
meta: {
|
|
350
|
+
type: "suggestion",
|
|
351
|
+
fixable: "code",
|
|
352
|
+
docs: {
|
|
353
|
+
description: "Require /** */ rather than // for the comment documenting an export",
|
|
354
|
+
recommended: true,
|
|
355
|
+
url: docsUrl("prefer-jsdoc-for-exports")
|
|
356
|
+
},
|
|
357
|
+
schema: [],
|
|
358
|
+
messages: {
|
|
359
|
+
useJsdoc: "Use a /** */ block here: editors only show JSDoc in hover tooltips, not // comments"
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
create(context) {
|
|
363
|
+
const sourceCode = getSource(context);
|
|
364
|
+
const text = sourceText(sourceCode);
|
|
365
|
+
const exportStarts = [];
|
|
366
|
+
const collect = (node) => {
|
|
367
|
+
if (node.range)
|
|
368
|
+
exportStarts.push(node.range[0]);
|
|
369
|
+
};
|
|
370
|
+
return {
|
|
371
|
+
ExportNamedDeclaration: collect,
|
|
372
|
+
ExportDefaultDeclaration: collect,
|
|
373
|
+
"Program:exit"() {
|
|
374
|
+
if (exportStarts.length === 0)
|
|
375
|
+
return;
|
|
376
|
+
const lineRuns = commentBlocks(text, getComments(sourceCode)).filter((block) => block[0].type === "Line" && !isTrailing(text, block[0]));
|
|
377
|
+
for (const exportStart of exportStarts) {
|
|
378
|
+
const run = lineRuns.find((block) => documentsExportAt(text, block[0].range[0], block[block.length - 1].range[1], exportStart));
|
|
379
|
+
if (!run || run.some(isDirective))
|
|
380
|
+
continue;
|
|
381
|
+
if (run.some((comment) => LICENSE_HEADER.test(comment.value)))
|
|
382
|
+
continue;
|
|
383
|
+
const first = run[0];
|
|
384
|
+
const indent = text.slice(lineStart(text, first.range[0]), first.range[0]);
|
|
385
|
+
const exportIndent = text.slice(lineStart(text, exportStart), exportStart);
|
|
386
|
+
const body = run.map((comment) => `${indent} * ${comment.value.trim()}`.trimEnd()).join(`
|
|
387
|
+
`);
|
|
388
|
+
context.report({
|
|
389
|
+
loc: blockLoc(run),
|
|
390
|
+
messageId: "useJsdoc",
|
|
391
|
+
fix: (fixer) => fixer.replaceTextRange([first.range[0], exportStart], `/**
|
|
392
|
+
${body}
|
|
393
|
+
${indent} */
|
|
394
|
+
${exportIndent}`)
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
};
|
|
401
|
+
var GUTTER = /^[ \t]*\**[ \t]*/;
|
|
402
|
+
var multilineJsdocFormat = {
|
|
403
|
+
meta: {
|
|
404
|
+
type: "suggestion",
|
|
405
|
+
fixable: "code",
|
|
406
|
+
docs: {
|
|
407
|
+
description: "Require /** and */ on their own lines in a multi-line JSDoc comment",
|
|
408
|
+
recommended: true,
|
|
409
|
+
url: docsUrl("multiline-jsdoc-format")
|
|
410
|
+
},
|
|
411
|
+
schema: [],
|
|
412
|
+
messages: {
|
|
413
|
+
openText: "Break the line after /**: a one-liner stays on one line, anything longer opens with /** alone",
|
|
414
|
+
closeText: "Put */ on its own line: a one-liner stays on one line, anything longer closes with */ alone"
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
create(context) {
|
|
418
|
+
const sourceCode = getSource(context);
|
|
419
|
+
const text = sourceText(sourceCode);
|
|
420
|
+
return {
|
|
421
|
+
Program() {
|
|
422
|
+
for (const comment of getComments(sourceCode)) {
|
|
423
|
+
if (!isJsdoc(comment) || isDirective(comment))
|
|
424
|
+
continue;
|
|
425
|
+
const value = comment.value;
|
|
426
|
+
const firstBreak = value.indexOf(`
|
|
427
|
+
`);
|
|
428
|
+
if (firstBreak === -1)
|
|
429
|
+
continue;
|
|
430
|
+
const indent = text.slice(lineStart(text, comment.range[0]), comment.range[0]);
|
|
431
|
+
const ownLine = /^[ \t]*$/.test(indent);
|
|
432
|
+
const head = value.slice(1, firstBreak);
|
|
433
|
+
const textStart = 1 + GUTTER.exec(head)[0].length;
|
|
434
|
+
if (value.slice(textStart, firstBreak).trim() !== "") {
|
|
435
|
+
const report = {
|
|
436
|
+
loc: { start: comment.loc.start, end: locAt(comment, textStart) },
|
|
437
|
+
messageId: "openText"
|
|
438
|
+
};
|
|
439
|
+
if (ownLine) {
|
|
440
|
+
report.fix = (fixer) => fixer.replaceTextRange(rangeAt(comment, 1, textStart - 1), `
|
|
441
|
+
${indent} * `);
|
|
442
|
+
}
|
|
443
|
+
context.report(report);
|
|
444
|
+
}
|
|
445
|
+
const tail = value.slice(value.lastIndexOf(`
|
|
446
|
+
`) + 1);
|
|
447
|
+
if (tail.slice(GUTTER.exec(tail)[0].length).trim() !== "") {
|
|
448
|
+
const textEnd = value.trimEnd().length;
|
|
449
|
+
const report = {
|
|
450
|
+
loc: { start: locAt(comment, value.length), end: comment.loc.end },
|
|
451
|
+
messageId: "closeText"
|
|
452
|
+
};
|
|
453
|
+
if (ownLine) {
|
|
454
|
+
report.fix = (fixer) => fixer.replaceTextRange(rangeAt(comment, textEnd, value.length - textEnd), `
|
|
455
|
+
${indent} `);
|
|
456
|
+
}
|
|
457
|
+
context.report(report);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
};
|
|
464
|
+
var ABBREVIATION = /(?:\be\.g|\bi\.e|\betc|\bvs|\bapprox|\bapp|\bmax|\bmin|\bInc|\bLtd|\bal|\bAve|\bcf|\bfig|\bref)\.$/i;
|
|
465
|
+
var noTrailingPeriod = {
|
|
466
|
+
meta: {
|
|
467
|
+
type: "suggestion",
|
|
468
|
+
fixable: "whitespace",
|
|
469
|
+
docs: {
|
|
470
|
+
description: "Disallow a trailing period at the end of a comment",
|
|
471
|
+
recommended: true,
|
|
472
|
+
url: docsUrl("no-trailing-period")
|
|
473
|
+
},
|
|
474
|
+
schema: [
|
|
475
|
+
{
|
|
476
|
+
type: "object",
|
|
477
|
+
properties: {
|
|
478
|
+
includeJsdoc: { type: "boolean" },
|
|
479
|
+
ignoreMultiSentence: { type: "boolean" }
|
|
480
|
+
},
|
|
481
|
+
additionalProperties: false
|
|
482
|
+
}
|
|
483
|
+
],
|
|
484
|
+
messages: { period: "Drop the trailing period" }
|
|
485
|
+
},
|
|
486
|
+
create(context) {
|
|
487
|
+
const options = context.options[0] ?? {};
|
|
488
|
+
const includeJsdoc = options.includeJsdoc ?? true;
|
|
489
|
+
const ignoreMultiSentence = options.ignoreMultiSentence ?? true;
|
|
490
|
+
const sourceCode = getSource(context);
|
|
491
|
+
return {
|
|
492
|
+
Program() {
|
|
493
|
+
for (const comment of getComments(sourceCode)) {
|
|
494
|
+
if (isDirective(comment))
|
|
495
|
+
continue;
|
|
496
|
+
if (!includeJsdoc && isJsdoc(comment))
|
|
497
|
+
continue;
|
|
498
|
+
const value = comment.value;
|
|
499
|
+
let i = value.length - 1;
|
|
500
|
+
while (i >= 0 && (value[i] === "*" || /\s/.test(value[i])))
|
|
501
|
+
i--;
|
|
502
|
+
if (i < 0 || value[i] !== ".")
|
|
503
|
+
continue;
|
|
504
|
+
const upTo = value.slice(0, i + 1);
|
|
505
|
+
if (upTo.endsWith(".."))
|
|
506
|
+
continue;
|
|
507
|
+
if (ABBREVIATION.test(upTo))
|
|
508
|
+
continue;
|
|
509
|
+
if (ignoreMultiSentence && /[.!?]\s/.test(value.slice(0, i)))
|
|
510
|
+
continue;
|
|
511
|
+
context.report({
|
|
512
|
+
loc: spanAt(comment, i, 1),
|
|
513
|
+
messageId: "period",
|
|
514
|
+
fix: (fixer) => fixer.removeRange(rangeAt(comment, i, 1))
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
};
|
|
521
|
+
var noEmDash = {
|
|
522
|
+
meta: {
|
|
523
|
+
type: "suggestion",
|
|
524
|
+
docs: {
|
|
525
|
+
description: "Disallow em dashes (and optionally en dashes) in comments",
|
|
526
|
+
recommended: true,
|
|
527
|
+
url: docsUrl("no-em-dash")
|
|
528
|
+
},
|
|
529
|
+
schema: [
|
|
530
|
+
{
|
|
531
|
+
type: "object",
|
|
532
|
+
properties: {
|
|
533
|
+
includeEnDash: { type: "boolean" }
|
|
534
|
+
},
|
|
535
|
+
additionalProperties: false
|
|
536
|
+
}
|
|
537
|
+
],
|
|
538
|
+
messages: {
|
|
539
|
+
dash: "Rewrite this without {{name}}: split the sentence, or use a comma, colon, or parentheses. For the literal character, wrap it in backticks"
|
|
540
|
+
}
|
|
541
|
+
},
|
|
542
|
+
create(context) {
|
|
543
|
+
const options = context.options[0] ?? {};
|
|
544
|
+
const includeEnDash = options.includeEnDash ?? false;
|
|
545
|
+
const sourceCode = getSource(context);
|
|
546
|
+
const chars = includeEnDash ? /[—–]/g : /—/g;
|
|
547
|
+
return {
|
|
548
|
+
Program() {
|
|
549
|
+
for (const comment of getComments(sourceCode)) {
|
|
550
|
+
if (isDirective(comment))
|
|
551
|
+
continue;
|
|
552
|
+
const masked = maskLiterals(comment.value);
|
|
553
|
+
chars.lastIndex = 0;
|
|
554
|
+
let match;
|
|
555
|
+
while ((match = chars.exec(masked)) !== null) {
|
|
556
|
+
const index = match.index;
|
|
557
|
+
context.report({
|
|
558
|
+
loc: spanAt(comment, index, 1),
|
|
559
|
+
messageId: "dash",
|
|
560
|
+
data: { name: match[0] === "—" ? "an em dash" : "an en dash" }
|
|
561
|
+
});
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
};
|
|
566
|
+
}
|
|
567
|
+
};
|
|
568
|
+
var defaultJargonWords = [
|
|
569
|
+
"utilize",
|
|
570
|
+
"utilise",
|
|
571
|
+
"leverage",
|
|
572
|
+
"delve",
|
|
573
|
+
"facilitate",
|
|
574
|
+
"streamline",
|
|
575
|
+
"seamless",
|
|
576
|
+
"seamlessly",
|
|
577
|
+
"robust",
|
|
578
|
+
"comprehensive",
|
|
579
|
+
"meticulous",
|
|
580
|
+
"meticulously",
|
|
581
|
+
"crucial",
|
|
582
|
+
"pivotal",
|
|
583
|
+
"myriad",
|
|
584
|
+
"plethora"
|
|
585
|
+
];
|
|
586
|
+
var SUGGESTIONS = {
|
|
587
|
+
utilize: "use",
|
|
588
|
+
utilise: "use",
|
|
589
|
+
leverage: "use",
|
|
590
|
+
facilitate: "help"
|
|
591
|
+
};
|
|
592
|
+
var escapeRe = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
593
|
+
function wordPattern(word) {
|
|
594
|
+
const escaped = escapeRe(word);
|
|
595
|
+
if (/e$/i.test(word))
|
|
596
|
+
return `${escaped.slice(0, -1)}(?:e|es|ed|ing)`;
|
|
597
|
+
return `${escaped}(?:s|es|ed|ing)?`;
|
|
598
|
+
}
|
|
599
|
+
function jargonRegex(words) {
|
|
600
|
+
const alternatives = words.slice().sort((a, b) => b.length - a.length).map(wordPattern);
|
|
601
|
+
return new RegExp(`(?<![\\w-])(?:${alternatives.join("|")})(?![\\w-])`, "giu");
|
|
602
|
+
}
|
|
603
|
+
var noJargon = {
|
|
604
|
+
meta: {
|
|
605
|
+
type: "suggestion",
|
|
606
|
+
hasSuggestions: true,
|
|
607
|
+
docs: {
|
|
608
|
+
description: "Disallow inflated vocabulary in comments",
|
|
609
|
+
recommended: true,
|
|
610
|
+
url: docsUrl("no-jargon")
|
|
611
|
+
},
|
|
612
|
+
schema: [
|
|
613
|
+
{
|
|
614
|
+
type: "object",
|
|
615
|
+
properties: {
|
|
616
|
+
words: { type: "array", items: { type: "string" } },
|
|
617
|
+
extraWords: { type: "array", items: { type: "string" } },
|
|
618
|
+
allow: { type: "array", items: { type: "string" } },
|
|
619
|
+
includeJsdoc: { type: "boolean" }
|
|
620
|
+
},
|
|
621
|
+
additionalProperties: false
|
|
622
|
+
}
|
|
623
|
+
],
|
|
624
|
+
messages: {
|
|
625
|
+
jargon: "“{{word}}” reads like generated prose. Say it plainly",
|
|
626
|
+
jargonSuggest: "“{{word}}” reads like generated prose. Say “{{with}}”",
|
|
627
|
+
replaceWith: "Replace with “{{with}}”"
|
|
628
|
+
}
|
|
629
|
+
},
|
|
630
|
+
create(context) {
|
|
631
|
+
const options = context.options[0] ?? {};
|
|
632
|
+
const words = options.words ?? defaultJargonWords;
|
|
633
|
+
const extraWords = options.extraWords ?? [];
|
|
634
|
+
const allow = options.allow ?? [];
|
|
635
|
+
const includeJsdoc = options.includeJsdoc ?? true;
|
|
636
|
+
const denied = [...words, ...extraWords].filter((word) => !allow.some((a) => a.toLowerCase() === word.toLowerCase()));
|
|
637
|
+
if (denied.length === 0)
|
|
638
|
+
return {};
|
|
639
|
+
const pattern = jargonRegex(denied);
|
|
640
|
+
const sourceCode = getSource(context);
|
|
641
|
+
return {
|
|
642
|
+
Program() {
|
|
643
|
+
for (const comment of getComments(sourceCode)) {
|
|
644
|
+
if (isDirective(comment))
|
|
645
|
+
continue;
|
|
646
|
+
if (!includeJsdoc && isJsdoc(comment))
|
|
647
|
+
continue;
|
|
648
|
+
const masked = maskLiterals(comment.value);
|
|
649
|
+
pattern.lastIndex = 0;
|
|
650
|
+
let match;
|
|
651
|
+
while ((match = pattern.exec(masked)) !== null) {
|
|
652
|
+
const word = match[0];
|
|
653
|
+
const index = match.index;
|
|
654
|
+
const replacement = SUGGESTIONS[word.toLowerCase()];
|
|
655
|
+
const report = {
|
|
656
|
+
loc: spanAt(comment, index, word.length),
|
|
657
|
+
messageId: replacement === undefined ? "jargon" : "jargonSuggest",
|
|
658
|
+
data: replacement === undefined ? { word } : { word, with: replacement }
|
|
659
|
+
};
|
|
660
|
+
if (replacement !== undefined) {
|
|
661
|
+
const range = rangeAt(comment, index, word.length);
|
|
662
|
+
report.suggest = [
|
|
663
|
+
{
|
|
664
|
+
messageId: "replaceWith",
|
|
665
|
+
data: { with: replacement },
|
|
666
|
+
fix: (fixer) => fixer.replaceTextRange(range, replacement)
|
|
667
|
+
}
|
|
668
|
+
];
|
|
669
|
+
}
|
|
670
|
+
context.report(report);
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
};
|
|
675
|
+
}
|
|
676
|
+
};
|
|
677
|
+
var asArray = (value) => Array.isArray(value) ? value : [];
|
|
678
|
+
var memberInfo = (node) => node.range && node.loc ? { range: node.range, loc: node.loc } : null;
|
|
679
|
+
var classMembers = (body) => asArray(body.body).filter((member) => member.kind !== "constructor" && member.type !== "StaticBlock");
|
|
680
|
+
var enumMembers = (node) => Array.isArray(node.members) ? node.members : asArray(node.body?.members);
|
|
681
|
+
function containerLabel(node) {
|
|
682
|
+
const parent = node.parent;
|
|
683
|
+
const name = node.id?.name ?? parent?.id?.name;
|
|
684
|
+
if (node.type === "TSEnumDeclaration")
|
|
685
|
+
return name ? `enum ${name}` : "this enum";
|
|
686
|
+
if (node.type === "ClassBody")
|
|
687
|
+
return name ? `class ${name}` : "this class";
|
|
688
|
+
if (node.type === "TSInterfaceBody")
|
|
689
|
+
return name ? `interface ${name}` : "this interface";
|
|
690
|
+
return name ? `type ${name}` : "this type";
|
|
691
|
+
}
|
|
692
|
+
var noJsdocMemberComment = {
|
|
693
|
+
meta: {
|
|
694
|
+
type: "suggestion",
|
|
695
|
+
fixable: "code",
|
|
696
|
+
docs: {
|
|
697
|
+
description: "Require /** */ rather than // for the comment documenting a member",
|
|
698
|
+
recommended: true,
|
|
699
|
+
url: docsUrl("prefer-jsdoc-for-members")
|
|
700
|
+
},
|
|
701
|
+
schema: [],
|
|
702
|
+
messages: {
|
|
703
|
+
useJsdoc: "Use a /** */ block here: editors show JSDoc for the member on hover, // comments stay invisible"
|
|
704
|
+
}
|
|
705
|
+
},
|
|
706
|
+
create(context) {
|
|
707
|
+
const sourceCode = getSource(context);
|
|
708
|
+
const text = sourceText(sourceCode);
|
|
709
|
+
const memberStarts = [];
|
|
710
|
+
const add = (nodes) => {
|
|
711
|
+
for (const node of nodes)
|
|
712
|
+
if (node.range)
|
|
713
|
+
memberStarts.push(node.range[0]);
|
|
714
|
+
};
|
|
715
|
+
return {
|
|
716
|
+
TSInterfaceBody: (node) => add(asArray(node.body)),
|
|
717
|
+
TSTypeLiteral: (node) => add(node.members ?? []),
|
|
718
|
+
ClassBody: (node) => add(classMembers(node)),
|
|
719
|
+
TSEnumDeclaration: (node) => add(enumMembers(node)),
|
|
720
|
+
ObjectExpression: (node) => add((node.properties ?? []).filter((p) => p.type !== "SpreadElement")),
|
|
721
|
+
"Program:exit"() {
|
|
722
|
+
if (memberStarts.length === 0)
|
|
723
|
+
return;
|
|
724
|
+
const lineRuns = commentBlocks(text, getComments(sourceCode)).filter((block) => block[0].type === "Line" && !isTrailing(text, block[0]));
|
|
725
|
+
for (const run of lineRuns) {
|
|
726
|
+
if (run.some(isDirective))
|
|
727
|
+
continue;
|
|
728
|
+
const first = run[0];
|
|
729
|
+
const last = run[run.length - 1];
|
|
730
|
+
const memberStart = memberStarts.find((start) => documentsExportAt(text, first.range[0], last.range[1], start));
|
|
731
|
+
if (memberStart === undefined)
|
|
732
|
+
continue;
|
|
733
|
+
const indent = text.slice(lineStart(text, first.range[0]), first.range[0]);
|
|
734
|
+
const memberIndent = text.slice(lineStart(text, memberStart), memberStart);
|
|
735
|
+
const replacement = run.length === 1 ? `/** ${first.value.trim()} */
|
|
736
|
+
${memberIndent}` : `/**
|
|
737
|
+
${run.map((comment) => `${indent} * ${comment.value.trim()}`.trimEnd()).join(`
|
|
738
|
+
`)}
|
|
739
|
+
${indent} */
|
|
740
|
+
${memberIndent}`;
|
|
741
|
+
context.report({
|
|
742
|
+
loc: blockLoc(run),
|
|
743
|
+
messageId: "useJsdoc",
|
|
744
|
+
fix: (fixer) => fixer.replaceTextRange([first.range[0], memberStart], replacement)
|
|
745
|
+
});
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
};
|
|
749
|
+
}
|
|
750
|
+
};
|
|
751
|
+
var requireMemberDocs = {
|
|
752
|
+
meta: {
|
|
753
|
+
type: "suggestion",
|
|
754
|
+
docs: {
|
|
755
|
+
description: "Require docs on every member once most of a type is documented",
|
|
756
|
+
recommended: true,
|
|
757
|
+
url: docsUrl("require-member-docs")
|
|
758
|
+
},
|
|
759
|
+
schema: [
|
|
760
|
+
{
|
|
761
|
+
type: "object",
|
|
762
|
+
properties: {
|
|
763
|
+
minDocumented: { type: "integer", minimum: 1 },
|
|
764
|
+
minRatio: { type: "number", minimum: 0, maximum: 1 }
|
|
765
|
+
},
|
|
766
|
+
additionalProperties: false
|
|
767
|
+
}
|
|
768
|
+
],
|
|
769
|
+
messages: {
|
|
770
|
+
missing: "{{documented}} of {{total}} members of {{container}} are documented. Give this one at least a /** one liner */ too"
|
|
771
|
+
}
|
|
772
|
+
},
|
|
773
|
+
create(context) {
|
|
774
|
+
const options = context.options[0] ?? {};
|
|
775
|
+
const minDocumented = options.minDocumented ?? 3;
|
|
776
|
+
const minRatio = options.minRatio ?? 0.4;
|
|
777
|
+
const sourceCode = getSource(context);
|
|
778
|
+
const text = sourceText(sourceCode);
|
|
779
|
+
const containers = [];
|
|
780
|
+
const add = (label, nodes) => {
|
|
781
|
+
const members = nodes.map(memberInfo).filter((m) => m !== null);
|
|
782
|
+
if (members.length > 0)
|
|
783
|
+
containers.push({ label, members });
|
|
784
|
+
};
|
|
785
|
+
return {
|
|
786
|
+
TSInterfaceBody: (node) => add(containerLabel(node), asArray(node.body)),
|
|
787
|
+
TSTypeLiteral: (node) => add(containerLabel(node), node.members ?? []),
|
|
788
|
+
ClassBody: (node) => add(containerLabel(node), classMembers(node)),
|
|
789
|
+
TSEnumDeclaration: (node) => add(containerLabel(node), enumMembers(node)),
|
|
790
|
+
"Program:exit"() {
|
|
791
|
+
if (containers.length === 0)
|
|
792
|
+
return;
|
|
793
|
+
const blocks = commentBlocks(text, getComments(sourceCode)).filter((block) => !isTrailing(text, block[0]) && !block.some(isDirective));
|
|
794
|
+
for (const { label, members } of containers) {
|
|
795
|
+
const documented = members.map((member) => blocks.some((block) => documentsExportAt(text, block[0].range[0], block[block.length - 1].range[1], member.range[0])));
|
|
796
|
+
const count = documented.filter(Boolean).length;
|
|
797
|
+
if (count === 0)
|
|
798
|
+
continue;
|
|
799
|
+
if (count < minDocumented && count / members.length < minRatio)
|
|
800
|
+
continue;
|
|
801
|
+
members.forEach((member, index) => {
|
|
802
|
+
if (documented[index])
|
|
803
|
+
return;
|
|
804
|
+
context.report({
|
|
805
|
+
loc: member.loc,
|
|
806
|
+
messageId: "missing",
|
|
807
|
+
data: {
|
|
808
|
+
documented: String(count),
|
|
809
|
+
total: String(members.length),
|
|
810
|
+
container: label
|
|
811
|
+
}
|
|
812
|
+
});
|
|
813
|
+
});
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
};
|
|
817
|
+
}
|
|
818
|
+
};
|
|
819
|
+
var XML_DOC_TAG = /<\/?summary>|<\/?remarks>|<param\s+name=|<\/?returns>|<typeparam\b|<inheritdoc\b|<see\s+cref\b/i;
|
|
820
|
+
var REGION = /^\s*#\s*(?:end)?region\b/;
|
|
821
|
+
var noForeignSyntax = {
|
|
822
|
+
meta: {
|
|
823
|
+
type: "suggestion",
|
|
824
|
+
docs: {
|
|
825
|
+
description: "Disallow comment syntax imported from other languages",
|
|
826
|
+
recommended: true,
|
|
827
|
+
url: docsUrl("no-foreign-syntax")
|
|
828
|
+
},
|
|
829
|
+
schema: [],
|
|
830
|
+
messages: {
|
|
831
|
+
tripleSlash: "Use /** */ for doc comments: /// is Rust and C# syntax and JS tooling ignores it",
|
|
832
|
+
xmlDoc: "Use JSDoc tags instead of C# XML doc tags",
|
|
833
|
+
region: "Drop the {{marker}} marker: split the file instead of folding it"
|
|
834
|
+
}
|
|
835
|
+
},
|
|
836
|
+
create(context) {
|
|
837
|
+
const sourceCode = getSource(context);
|
|
838
|
+
return {
|
|
839
|
+
Program() {
|
|
840
|
+
for (const comment of getComments(sourceCode)) {
|
|
841
|
+
if (isDirective(comment))
|
|
842
|
+
continue;
|
|
843
|
+
if (comment.type === "Line" && comment.value.startsWith("/")) {
|
|
844
|
+
context.report({ loc: comment.loc, messageId: "tripleSlash" });
|
|
845
|
+
continue;
|
|
846
|
+
}
|
|
847
|
+
if (comment.type === "Line") {
|
|
848
|
+
const region = REGION.exec(comment.value);
|
|
849
|
+
if (region) {
|
|
850
|
+
context.report({
|
|
851
|
+
loc: comment.loc,
|
|
852
|
+
messageId: "region",
|
|
853
|
+
data: { marker: region[0].trim() }
|
|
854
|
+
});
|
|
855
|
+
continue;
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
const match = XML_DOC_TAG.exec(comment.value);
|
|
859
|
+
if (match) {
|
|
860
|
+
context.report({
|
|
861
|
+
loc: spanAt(comment, match.index, match[0].length),
|
|
862
|
+
messageId: "xmlDoc"
|
|
863
|
+
});
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
};
|
|
868
|
+
}
|
|
869
|
+
};
|
|
870
|
+
var plugin = {
|
|
871
|
+
meta: {
|
|
872
|
+
name: "eslint-plugin-no-comment-slop",
|
|
873
|
+
version: "0.2.0",
|
|
874
|
+
namespace: "no-comment-slop"
|
|
875
|
+
},
|
|
876
|
+
rules: {
|
|
877
|
+
"max-comment-lines": maxCommentLines,
|
|
878
|
+
"no-banner-comment": noBannerComment,
|
|
879
|
+
"no-trailing-comment": noTrailingComment,
|
|
880
|
+
"prefer-jsdoc-for-exports": preferJsdocForExports,
|
|
881
|
+
"prefer-jsdoc-for-members": noJsdocMemberComment,
|
|
882
|
+
"require-member-docs": requireMemberDocs,
|
|
883
|
+
"multiline-jsdoc-format": multilineJsdocFormat,
|
|
884
|
+
"no-trailing-period": noTrailingPeriod,
|
|
885
|
+
"no-em-dash": noEmDash,
|
|
886
|
+
"no-jargon": noJargon,
|
|
887
|
+
"no-foreign-syntax": noForeignSyntax
|
|
888
|
+
},
|
|
889
|
+
configs: {}
|
|
890
|
+
};
|
|
891
|
+
Object.assign(plugin.configs, {
|
|
892
|
+
recommended: {
|
|
893
|
+
name: "no-comment-slop/recommended",
|
|
894
|
+
plugins: { "no-comment-slop": plugin },
|
|
895
|
+
rules: {
|
|
896
|
+
"no-comment-slop/max-comment-lines": "error",
|
|
897
|
+
"no-comment-slop/no-banner-comment": "error",
|
|
898
|
+
"no-comment-slop/no-trailing-comment": "error",
|
|
899
|
+
"no-comment-slop/prefer-jsdoc-for-exports": "error",
|
|
900
|
+
"no-comment-slop/prefer-jsdoc-for-members": "error",
|
|
901
|
+
"no-comment-slop/require-member-docs": "error",
|
|
902
|
+
"no-comment-slop/multiline-jsdoc-format": "error",
|
|
903
|
+
"no-comment-slop/no-trailing-period": "error",
|
|
904
|
+
"no-comment-slop/no-em-dash": "error",
|
|
905
|
+
"no-comment-slop/no-jargon": "error",
|
|
906
|
+
"no-comment-slop/no-foreign-syntax": "error"
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
});
|
|
910
|
+
var { meta, rules, configs } = plugin;
|
|
911
|
+
var src_default = plugin;
|
|
912
|
+
export {
|
|
913
|
+
configs,
|
|
914
|
+
src_default as default,
|
|
915
|
+
defaultJargonWords,
|
|
916
|
+
meta,
|
|
917
|
+
rules
|
|
918
|
+
};
|