mirror of
https://github.com/nodejs/node.git
synced 2025-05-13 21:16:45 +00:00

Greatly simplify how ESLint and its plugins are installed. PR-URL: https://github.com/nodejs/node/pull/53413 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
54 lines
1022 B
JavaScript
54 lines
1022 B
JavaScript
import iterateJsdoc from '../iterateJsdoc.js';
|
|
|
|
export default iterateJsdoc(({
|
|
context,
|
|
jsdoc,
|
|
utils,
|
|
}) => {
|
|
if (jsdoc.tags.length) {
|
|
return;
|
|
}
|
|
|
|
const {
|
|
description,
|
|
lastDescriptionLine,
|
|
} = utils.getDescription();
|
|
if (description.trim()) {
|
|
return;
|
|
}
|
|
|
|
const {
|
|
enableFixer,
|
|
} = context.options[0] || {};
|
|
|
|
utils.reportJSDoc(
|
|
'No empty blocks',
|
|
{
|
|
line: lastDescriptionLine,
|
|
},
|
|
enableFixer ? () => {
|
|
jsdoc.source.splice(0, jsdoc.source.length);
|
|
} : null,
|
|
);
|
|
}, {
|
|
iterateAllJsdocs: true,
|
|
meta: {
|
|
docs: {
|
|
description: 'Removes empty blocks with nothing but possibly line breaks',
|
|
url: 'https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-blank-blocks.md#repos-sticky-header',
|
|
},
|
|
fixable: 'code',
|
|
schema: [
|
|
{
|
|
additionalProperties: false,
|
|
properties: {
|
|
enableFixer: {
|
|
type: 'boolean',
|
|
},
|
|
},
|
|
},
|
|
],
|
|
type: 'suggestion',
|
|
},
|
|
});
|