spaced-comment

在注释中的 ///* 之后强制保持一致的间距

一些该规则报告的问题可以通过 --fix 命令行选项 自动修复

一些样式指南要求或不允许在注释的初始 ///* 之后立即使用空格。///* 之后的空格使阅读评论中的文本更容易。另一方面,注释掉代码更容易,无需在 ///* 之后放置空格。

规则详情

此规则将强制注释 ///* 开始后的间距保持一致。它还为各种文档样式提供了几个例外。

选项

该规则有两个选项。

    byufHkX+4Xnvul1vYvW0AIINfS/0siEqgrAqzd3AR5MaIyhWa8FH/AKzCLjSKjSZskdReDthIPFpwv4p/kuSoV60agbTSPOEBaUSz3hQ9tvlp6HemmOdSHEGCYQUt4lBw8jslh1NH7nBMRbI2mUYrga1UxcFD5AGSaac0Arc4Wz0TIi6V67mS31inTri0N34Q8PTGyaqoLnVqwRdLecosOybQiRxa6PogpmAbtGPqN7Z49C3OO2ifBPkFyTybteqEXuzCy8nTpF1oj9V+D2j0W2jwVg7MuK0dklaVnGJ/ebNtnlz6KspzBCBS2ucD352k1Nu+J4Xv1UyuVPQdO4EL27QlrDkTzE56sb9o7oer/wCd2wT5PmDpHR8NeKIJlGw8DCc5Y+6JJ5rGPnhnuTUIb/oWX72s205PBGD62GlIGqS0v/Sudi4QAKn5OpHLSzs387IBLiRR/SIa4h/MRFh33GSRuS85asf6BHc0HHo9Qp5ldZ+xEIsgboT6ZXFCUKQZGxbBG9VpPNHxipuWWp/0OaH9/xtbunW0YGkrIkdkdDbTB2bQWq3BJm1/b35QZpF39mMVWCTQAbd5IO7TOIL98TFPEV1kRGucpTJGVOGSjMz2N0ydO6OAyASSOp2buhsxTeVfdFYNhxSq/2YCENea7CDZV6zMEz/s5XFzVgCAnMfPo1dL5TCH0+gnq0h960vrQNsdW8q+41ve+syzkzYZgJd842gYzmtUN1u/u6OQa/VNiqSdP3QZoyCNqnXh66Kh9A0s0MBjVYP5YH7zvtPODWc43/EWOn4PFcX8JCsshRzBBM53zi067rjzjbhinWCifjEvvyUYRfCc3QSI2YTku/Lc0MXcOYGdGpRPmAjZ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KoLJfKd9M6
"spaced-comment": ["error", "always", {
    "line": {
        "markers": ["/"],
        "exceptions": ["-", "+"]
    },
    "block": {
        "markers": ["!"],
        "exceptions": ["*"],
        "balanced": true
    }
}]

always

dg8a89Fcmdiuqkj/gGSI6n35puJvbFhv9IINqugqNY5a8t7H2Amg3Rp9cav/D8AHEqJke80GIPIUkIFMte4VQqKsD+iB9eSo+NsyAoG5J40=

/*eslint spaced-comment: ["error", "always"]*/

//This is a comment with no whitespace at the beginning

/*This is a comment with no whitespace at the beginning */
/* eslint spaced-comment: ["error", "always", { "block": { "balanced": true } }] */
/* This is a comment with whitespace at the beginning but not the end*/

dg8a89Fcmdiuqkj/gGSI6n35puJvbFhv9IINqugqNY4aJ3YzCb5PIUZ8Wx07NQxGmH/h2EjHtDeTPA05gjiHeEH84uHpDh58slEKpK28o0M=

/* eslint spaced-comment: ["error", "always"] */

// This is a comment with a whitespace at the beginning

/* This is a comment with a whitespace at the beginning */

/*
 * This is a comment with a whitespace at the beginning
 */

/*
This comment has a newline
*/
/* eslint spaced-comment: ["error", "always"] */

/**
* I am jsdoc
*/

never

dg8a89Fcmdiuqkj/gGSI6vs0/n9MU3NtHqKp9l0P2W+BiIryCUAxJRbflLJ+TIHSF4+CJBYIVIqz8b/DB/Tq5WQyntq9wuqk9CKHn5BE4Wc=

/*eslint spaced-comment: ["error", "never"]*/

// This is a comment with a whitespace at the beginning

/* This is a comment with a whitespace at the beginning */

/* \nThis is a comment with a whitespace at the beginning */
/*eslint spaced-comment: ["error", "never", { "block": { "balanced": true } }]*/
/*This is a comment with whitespace at the end */

dg8a89Fcmdiuqkj/gGSI6vs0/n9MU3NtHqKp9l0P2W/hT8xIfpXP8Bk6l4lL4GL0NTubkH9EiXRk5IZATK7Cf4QK8WGXiIl7OAgxlEObOZY=

/*eslint spaced-comment: ["error", "never"]*/

/*This is a comment with no whitespace at the beginning */
/*eslint spaced-comment: ["error", "never"]*/

/**
* I am jsdoc
*/

exceptions

Wk+Mu7oFIccqpNSe5orR0+KPX8Ta2P+WQHONLKIxHELuwL2gN30hIc9TVn/9XBZ4hyGn6gbAFN78anqLW8nJURVWCDg9rCAGJMhxHAbF/NkUmkHkV6QLp2qeK8/j2vaXdLx9cMDT3CUCgQcqBwRV4Q==

/* eslint spaced-comment: ["error", "always", { "block": { "exceptions": ["-"] } }] */

//--------------
// Comment block
//--------------
/* eslint spaced-comment: ["error", "always", { "exceptions": ["-", "+"] }] */

//------++++++++
// Comment block
//------++++++++
/* eslint spaced-comment: ["error", "always", { "exceptions": ["-", "+"] }] */

/*------++++++++*/
/* Comment block */
/*------++++++++*/
/* eslint spaced-comment: ["error", "always", { "line": { "exceptions": ["-+"] } }] */

/*-+-+-+-+-+-+-+*/
// Comment block
/*-+-+-+-+-+-+-+*/
/* eslint spaced-comment: ["error", "always", { "block": { "exceptions": ["*"] } }] */

/******** COMMENT *******/

UubGaThNGVSAZCEeqgdAA695w3ttTInEplD9yHJVNiQiDBUa6P/xdi95EF/CwZrEtD5GLcD9lJhPJMicl23ynXHj8QdkwVqepu1PTZ7Qubkh22p9tN68iI9VrHPaZPigGEvNRtqtq/nGW4CLPHolzw==

/* eslint spaced-comment: ["error", "always", { "exceptions": ["-"] }] */

//--------------
// Comment block
//--------------
/* eslint spaced-comment: ["error", "always", { "line": { "exceptions": ["-"] } }] */

//--------------
// Comment block
//--------------
/* eslint spaced-comment: ["error", "always", { "exceptions": ["*"] }] */

/****************
 * Comment block
 ****************/
/* eslint spaced-comment: ["error", "always", { "exceptions": ["-+"] }] */

//-+-+-+-+-+-+-+
// Comment block
//-+-+-+-+-+-+-+

/*-+-+-+-+-+-+-+*/
// Comment block
/*-+-+-+-+-+-+-+*/
/* eslint spaced-comment: ["error", "always", { "block": { "exceptions": ["-+"] } }] */

/*-+-+-+-+-+-+-+*/
// Comment block
/*-+-+-+-+-+-+-+*/
/* eslint spaced-comment: ["error", "always", { "block": { "exceptions": ["*"] } }] */

/***************/

/********
COMMENT
*******/

markers

Wk+Mu7oFIccqpNSe5orR0+KPX8Ta2P+WQHONLKIxHELuwL2gN30hIc9TVn/9XBZ4hyGn6gbAFN78anqLW8nJUeIfw/j03oCYcXDjMUgf5hmRLDC0/RM4LCfPyWTA+Ac9

/* eslint spaced-comment: ["error", "always", { "markers": ["/"] }] */

///This is a comment with a marker but without whitespace
/*eslint spaced-comment: ["error", "always", { "block": { "markers": ["!"], "balanced": true } }]*/
/*! This is a comment with a marker but without whitespace at the end*/
/*eslint spaced-comment: ["error", "never", { "block": { "markers": ["!"], "balanced": true } }]*/
/*!This is a comment with a marker but with whitespace at the end */

UubGaThNGVSAZCEeqgdAA695w3ttTInEplD9yHJVNiQiDBUa6P/xdi95EF/CwZrEtD5GLcD9lJhPJMicl23ynYhvdgIzc/P9L7gq6Pn28MDJXcIn/1YLFLAksIM4OTec

/* eslint spaced-comment: ["error", "always", { "markers": ["/"] }] */

/// This is a comment with a marker
/*eslint spaced-comment: ["error", "never", { "markers": ["!<"] }]*/

//!<This is a line comment with a marker

/*!<this is a block comment with a marker
subsequent lines are ignored
*/
/* eslint spaced-comment: ["error", "always", { "markers": ["global"] }] */

/*global ABC*/